建一个网站需要多少钱?,wordpress链接的index.php,新网站怎么让百度收录,在百度做橱柜网站2025 年 2 月 25 日晚上 11#xff1a;00 通义万相 2.1 开源发布#xff0c;前两周太忙没空搞它#xff0c;这个周末#xff0c;也来本地化部署一个#xff0c;体验生成效果如何#xff0c;总的来说#xff0c;它在国内文生视频、图生视频的行列处于领先位置#xff0c…2025 年 2 月 25 日晚上 1100 通义万相 2.1 开源发布前两周太忙没空搞它这个周末也来本地化部署一个体验生成效果如何总的来说它在国内文生视频、图生视频的行列处于领先位置同时也支持文生图。
一、开源代码下载来源
GitHubhttps://github.com/Wan-Video/Wan2.1
这个源码包中可以做的事包括
Wan2.1 Text-to-Video Multi-GPU Inference code of the 14B and 1.3B models Checkpoints of the 14B and 1.3B models Gradio demo ComfyUI integration Diffusers integration Diffusers Multi-GPU Inference Wan2.1 Image-to-Video Multi-GPU Inference code of the 14B model Checkpoints of the 14B model Gradio demo ComfyUI integration Diffusers integration Diffusers Multi-GPU Inference 以下相关网址有在线体验的有可以下载配套模型的也有可以下载源码的根据需要自行选择访问国外的网站请提前准备好科学上网。
官网https://tongyi.aliyun.com/wanxiang/
博客https://wanxai.com/
Modelscopehttps://modelscope.cn/organization/Wan-AI
Hugging Facehttps://huggingface.co/Wan-AI
二、下载python虚拟环境管理软件安装较新版的python
下载地址https://docs.conda.io/en/latest/miniconda.html 安装好后打开它最好使用管理员模式打开。 依次敲入指令创建并激活项目所需的虚拟环境。关于conda的使用方法会单独出一篇教程这里就不多解释了
conda create --name Wan21 python3.12.9 三、安装git
https://git-scm.com/ 验证安装成功如下 四、安装cuda
到官网CUDA Toolkit Archive | NVIDIA Developer 下载驱动按提示安装。这里需要为自己的显卡选择具体的版本命令行输入指令nvidia-smi查看对应版本。 下载后安装完配置一下环境变量
五、下载万象2.1源码
git clone https://github.com/Wan-Video/Wan2.1.git 六、安装万象2.1所需的依赖包
到conda的虚拟环境中来安装给万象2.1配置专用的python运行环境。
conda activate Wan21 看看这个依赖源的清单数量不多建议还是手工一条条安装以便看到哪一个在安装中出问题了定向解决。 很多时候用上面的清单安装后torch版本不支持cuda可以参照下面这个网址找到对应的版本去下载。
https://github.com/facebookresearch/xformers#installing-xformers 七、下载模型文件
pip install huggingface_hub[cli]
huggingface-cli download Wan-AI/Wan2.1-T2V-14B --local-dir ./Wan2.1-T2V-14B
因为模型文件比较大这个根据网速情况会有些慢 。如果发现下载速度变慢了可以ctrlc终止后重新启动。
模型文件种类 八、文生视频测试
单GPU情况下指令如下
python generate.py --task t2v-14B --size 1280*720 --ckpt_dir ./Wan2.1-T2V-14B --save_file output --prompt A cute little cat is cooking.
如果显存不够大会报“Out-of-Memory”错误可以使用参数--offload_model True and --t5_cpu启用cpu计算同时改用小点的模型使用低分辨率的像素来生成。 python generate.py --task t2v-1.3B --size 480*832 --ckpt_dir ./Wan2.1-T2V-1.3B --offload_model True --t5_cpu --sample_shift 8 --sample_guide_scale 6 --save_file output --prompt A cute little cat is cooking. 九、图生视频测试 单GPU情况下指令如下
python generate.py --task i2v-14B --size 1280*720 --ckpt_dir ./Wan2.1-I2V-14B-720P --image examples/test.JPG --prompt Summer beach vacation style, a white cat wearing sunglasses sits on a surfboard. The fluffy-furred feline gazes directly at the camera with a relaxed expression. Blurred beach scenery forms the background featuring crystal-clear waters, distant green hills, and a blue sky dotted with white clouds. The cat assumes a naturally relaxed posture, as if savoring the sea breeze and warm sunlight. A close-up shot highlights the felines intricate details and the refreshing atmosphere of the seaside.
十、文生图片测试
python generate.py --task t2v-1.3B --size 480*832 --ckpt_dir ./Wan2.1-T2V-1.3B --prompt 一个漂亮的女孩 --save_file output --offload_model True --t5_cpu 想看指令可以带哪些参数可以查看源码文件generate.py其中片段如下
def _parse_args():parser argparse.ArgumentParser(descriptionGenerate a image or video from a text prompt or image using Wan)parser.add_argument(--task,typestr,defaultt2v-14B,choiceslist(WAN_CONFIGS.keys()),helpThe task to run.)parser.add_argument(--size,typestr,default1280*720,choiceslist(SIZE_CONFIGS.keys()),helpThe area (width*height) of the generated video. For the I2V task, the aspect ratio of the output video will follow that of the input image.)parser.add_argument(--frame_num,typeint,defaultNone,helpHow many frames to sample from a image or video. The number should be 4n1)parser.add_argument(--ckpt_dir,typestr,defaultNone,helpThe path to the checkpoint directory.)parser.add_argument(--offload_model,typestr2bool,defaultNone,helpWhether to offload the model to CPU after each model forward, reducing GPU memory usage.)parser.add_argument(--ulysses_size,typeint,default1,helpThe size of the ulysses parallelism in DiT.)parser.add_argument(--ring_size,typeint,default1,helpThe size of the ring attention parallelism in DiT.)parser.add_argument(--t5_fsdp,actionstore_true,defaultFalse,helpWhether to use FSDP for T5.)parser.add_argument(--t5_cpu,actionstore_true,defaultFalse,helpWhether to place T5 model on CPU.)parser.add_argument(--dit_fsdp,actionstore_true,defaultFalse,helpWhether to use FSDP for DiT.)parser.add_argument(--save_file,typestr,defaultNone,helpThe file to save the generated image or video to.)parser.add_argument(--prompt,typestr,defaultNone,helpThe prompt to generate the image or video from.)parser.add_argument(--use_prompt_extend,actionstore_true,defaultFalse,helpWhether to use prompt extend.)parser.add_argument(--prompt_extend_method,typestr,defaultlocal_qwen,choices[dashscope, local_qwen],helpThe prompt extend method to use.)parser.add_argument(--prompt_extend_model,typestr,defaultNone,helpThe prompt extend model to use.)parser.add_argument(--prompt_extend_target_lang,typestr,defaultzh,choices[zh, en],helpThe target language of prompt extend.)parser.add_argument(--base_seed,typeint,default-1,helpThe seed to use for generating the image or video.)parser.add_argument(--image,typestr,defaultNone,helpThe image to generate the video from.)parser.add_argument(--sample_solver,typestr,defaultunipc,choices[unipc, dpm],helpThe solver used to sample.)parser.add_argument(--sample_steps, typeint, defaultNone, helpThe sampling steps.)parser.add_argument(--sample_shift,typefloat,defaultNone,helpSampling shift factor for flow matching schedulers.)parser.add_argument(--sample_guide_scale,typefloat,default5.0,helpClassifier free guidance scale.)args parser.parse_args()_validate_args(args)return args
体验感受总的来说万象生成的视频质量还是不错的最大的亮点是它原生支持中文提示词对大部分的同胞们来说这是个福音。只不过这玩意太耗显存看下面官方给出的测试报告就知道了起步是4090也进一步验证了智能时代拼的是算力。