ARTICLE DETAIL

资讯详情

深耕网站视觉设计与运营推广的一线实战洞察。

vLLM-Omni 图生视频(Image-to-Video)统一实践指南:基于 image_to_video.py 的多模型推理示例全解

vLLM-Omni 图生视频(Image-to-Video)统一实践指南:基于 image_to_video.py 的多模型推理示例全解 vLLM-Omni 图生视频Image-to-Video统一实践指南基于 image_to_video.py 的多模型推理示例全解【免费下载链接】vllm-omniA framework for efficient model inference with omni-modality models项目地址: https://gitcode.com/GitHub_Trending/vl/vllm-omni导读vLLM-Omni 在examples/offline_inference/image_to_video/目录下提供了一个统一 CLI 脚本image_to_video.py用一套参数约定同时驱动 Wan2.2I2V/TI2V、LTX-2、HunyuanVideo-1.5、SANA-Video、Cosmos3、MAGI-2 以及 Wan2.1 VACE 等图生视频管线并自动为不同模型家族挑选实用的生成默认值。阅读本文后你将掌握如何用 Python API 与命令行快速生成视频、如何理解并调优全部关键采样/并行/内存参数、如何用同一脚本完成 VACE 的五类条件任务I2V、V2LF、FLF2V、Inpainting、R2V以及这些参数在 vLLM-Omni 源码中的底层实现逻辑。Overview一个脚本覆盖多模型家族examples/offline_inference/image_to_video/image_to_video.py是一个约 900 行的独立命令行脚本面向 用一张或多张图片生成视频 这一任务。它的设计目标是对支持的模型家族给出实用默认值同时暴露通用的采样、内存与并行选项避免每个模型各写一套示例脚本。脚本开头image_to_video.py明确列出了支持能力Wan2.2-I2V-A14B-DiffusersMoE 模型使用 CLIP 图像编码器有独立的高/低噪声两阶段 DiTWan2.2-TI2V-5B-DiffusersT2V I2V 统一的稠密 5B 模型LTX2图生视频管线含 LTX-2.3、蒸馏版HunyuanVideo-1.5 I2VSigLIP VAE 双图像条件SANA-Video 2B首帧潜空间条件支持 480p / 720pWan2.1 VACE首帧/末帧、inpainting、reference 图像条件此外还兼容 Cosmos3 与 MAGI-2见下述配方文档。支持模型与默认配置矩阵下表来自官方 READMEREADME.md列出各模型的默认分辨率、帧数、采样步数与 CFG 值模型默认分辨率默认帧数默认步数GuidanceVRAM 说明Wan-AI/Wan2.2-I2V-A14B-Diffusers480 x 83281505.0基础单卡约 60 GiB BF16Wan-AI/Wan2.2-TI2V-5B-Diffusers480 x 83281504.0约 20–25 GiB BF16最小 I2V 模型hunyuanvideo-community/HunyuanVideo-1.5-Diffusers-480p_i2v480 x 832121506.0默认约 100 GiB示例启用--enable-cpu-offload VAE tiling/slicing 以适配 80 GiB 显卡Lightricks/LTX-2512 x 76812140video 3.0 / audio 7.0显存占用取决于帧数与张量并行sand-ai/MAGI-2-preview512 x 896125100模型固定原生四卡 TP/SPSP4 常驻默认支持 DLOEfficient-Large-Model/SANA-Video_2B_480p_diffusers480 x 83281506.0原生SanaImageToVideoPipelineWan VAEEfficient-Large-Model/SANA-Video_2B_720p_diffusers704 x 128081506.0原生SanaImageToVideoPipelineLTX-2 Video VAE提示峰值显存数据基于 batch size 1 的基础单卡使用且不开启任何加速/优化特性。部分模型权重无法放入单张 80 GiB 显存此时需要考虑 CPU offload 方案。脚本默认模型为Wan-AI/Wan2.2-I2V-A14B-Diffusers见 image_to_video.py 中--model的默认值。MAGI-2 原生的四卡拓扑、DLO 选择与八卡验证状态详见 MAGI-2 Preview L20X 配方。默认值从何而来模型感知的参数解析从源码看这些模型特定默认值并非硬编码在 README 里而是由脚本运行时动态解析image_to_video.py通过resolve_model_class_name(args.model)解析管线类名并调用get_video_generation_defaults()查询 model_extras/registry.py 注册表注册表以VideoGenerationDefaults数据类video_generation.py承载width / height / num_frames / num_inference_steps / fps / guidance_scale / flow_shift / dimension_multiple等字段对于未在注册表中声明的模型脚本按字符串匹配兜底is_cosmos_edge480x832、gs 5.0、flow_shift 3.0、is_cosmos720p、gs 6.0、flow_shift 10.0、is_ltx2_distilled121 帧、8 步、64 倍对齐、is_ltx2121 帧、40 步、32 倍对齐、is_sana480p 或 720p 分别对齐 16/32以及默认的 Wan2.2/HunyuanVideo 分支16fps、81 帧、50 步、480x832。注释特别强调Cosmos3 若不单独处理会静默继承 Wan2.2 的默认值导致尺寸/步数/flow shift 错误。LingBot-Video TI2V 快速示例LingBot-Video 接受恰好一张首帧图像并复用与 T2I、T2V 模式相同的稠密或 MoE 检查点python examples/offline_inference/image_to_video/image_to_video.py \ --model robbyant/lingbot-video-dense-1.3b \ --model-class-name LingBotVideoPipeline \ --image /path/to/input.png \ --prompt the fox looks toward the camera \ --height 192 --width 320 --num-frames 9 --num-inference-steps 2 \ --guidance-scale 3.0 --flow-shift 3.0 --fps 24 \ --output lingbot_ti2v.mp4输入图像会保持原始几何尺寸直到 LingBot 管线执行其模型特定的 resize 与中心裁剪。这背后对应注册表中LingBotVideoPipeline声明的output_tensor_range zero_to_oneregistry.py表示管线输出已是归一化张量脚本在保存前无需再做 [-1, 1] 到 [0, 1] 的换算。Prerequisites准备示例输入图README 中的示例片段统一使用同一张示例图请先下载curl -L -o cherry_blossom.jpg https://vllm-public-assets.s3.us-west-2.amazonaws.com/vision_model_images/cherry_blossom.jpgQuick Start两条上手路径路径一Python APIOmni 引擎以轻量的 TI2V-5B 为例单条 prompt 生成完整代码见 README.mdimport PIL.Image import torch from vllm_omni.entrypoints.omni import Omni from vllm_omni.inputs.data import OmniDiffusionSamplingParams if __name__ __main__: image PIL.Image.open(cherry_blossom.jpg).convert(RGB) image image.resize((576, 320)) omni Omni( modelWan-AI/Wan2.2-TI2V-5B-Diffusers, flow_shift12.0, ) outputs omni.generate( { prompt: Cherry blossoms swaying gently in the breeze, petals falling, multi_modal_data: {image: image}, }, OmniDiffusionSamplingParams( height320, width576, num_frames17, num_inference_steps20, guidance_scale4.0, generatortorch.Generator(devicecuda).manual_seed(42), ), ) from diffusers.utils import export_to_video frames outputs[0].images export_to_video(frames, quick_test_i2v.mp4, fps16)要点OmniDiffusionSamplingParams与 CLI 参数一一对应generator显式指定 CUDA 设备与随机种子42保证采样可复现输出帧列表通过diffusers的export_to_video落盘为 MP4。路径二本地 CLI小分辨率冒烟测试python image_to_video.py \ --model Wan-AI/Wan2.2-TI2V-5B-Diffusers \ --image cherry_blossom.jpg \ --prompt Cherry blossoms swaying gently in the breeze, petals falling, smooth motion \ --height 320 \ --width 576 \ --num-frames 17 \ --guidance-scale 4.0 \ --num-inference-steps 20 \ --flow-shift 12.0 \ --fps 16 \ --output quick_test_i2v.mp4注意文档示例中的--flow-shift 12.0适用于 480p 档位脚本文档说明 Wan 系默认flow_shift 5.0720p480p 建议 12.0。Key ArgumentsCLI 参数全表与源码解读下表完整继承官方 README 的参数说明README.md并补充脚本源码中的细节对应 image_to_video.py 的 argparse 定义参数类型默认值说明--modelstrWan-AI/Wan2.2-I2V-A14B-DiffusersDiffusers I2V 模型 ID 或本地路径--model-class-namestrNone可选覆盖管线类名如 SANA-Video 需显式传SanaImageToVideoPipeline--imagestr必填之一输入首帧/源图像路径--last-imagestrNone末帧条件如 VACE--mask-imagestrNone修复掩码白色像素重新生成黑色像素保留--reference-imagestr可重复None参考图可重复传参提供多张参考--promptstr期望运动/动画的文本描述--negative-promptstrNone可选抑制伪影的负向提示默认值模型特定--seedint42采样随机种子--guidance-scalefloat模型特定CFG 比例默认 Wan 5.0、SANA 6.0、Cosmos3 6.0--guidance-scale-highfloatNone高噪声阶段独立 CFG仅 MoE 两阶段模型--height/--widthint自动视频高/宽未指定时由输入图像按纵横比自动推算需为对齐倍数--num-framesint模型特定帧数LTX 风格模型最佳为8k1Cosmos3 默认 189--num-inference-stepsint模型特定去噪步数Wan 50、LTX2 40、Cosmos3 35--boundary-ratiofloat0.875两阶段 MoE 模型的高低噪声阶段边界切分比例--flow-shiftfloat模型特定Scheduler flow shiftWan 5.0、Cosmos3 10.0LTX 不消费该参数--sample-solverstrunipcWan2.2 采样求解器unipc多步求解器euler用于 Lightning/Distill 检查点--fpsfloat模型特定输出 MP4 的帧率需diffusers的 export_to_video--frame-ratefloatNone生成帧率用于要求该参数的管线如 LTX2默认回退到--fps--outputstri2v_output.mp4视频保存路径--audio-sample-rateint24000内嵌音频的回退采样率--vae-use-slicingflagoff开启 VAE slicing 降低显存--vae-use-tilingflagoff开启 VAE tiling 降低显存--enable-cpu-offloadflagoff对 diffusion 模型开启 CPU offload--enable-layerwise-offloadflagoff对 DiT 模块开启逐层 offload--cfg-parallel-sizeint1设为2开启 CFG Parallel--tensor-parallel-sizeint1DiT 内部张量并行规模支持 TP 的模型有效如 LTX2--ulysses-degreeint1Ulysses 序列并行度--ring-degreeint1Ring 序列并行度--vae-patch-parallel-sizeint1VAE patch/tile 并行规模解码--pipeline-parallel-sizeint1流水线并行级数--cache-backendstrNone缓存加速后端cache_dit或tea_cache--use-hsdpflagoff开启 Hybrid Sharded Data Parallel 跨卡切分权重--hsdp-shard-sizeint-1每个副本组内切分权重的 GPU 数-1自动计算为 world_size / replicate_size--hsdp-replicate-sizeint1HSDP 副本组数默认 1 表示纯切分无复制--extra-bodyJSON 对象None模型特定生成参数按键名对照模型声明的extra_body_params过滤未知键静默丢弃--quantizationstrNone变换器量化方式fp8/mxfp8/mxfp4/mxfp4_dualscale/int8--enforce-eagerflagoff禁用 torch.compile强制 eager 执行--lora-path/--lora-scale/--lora-backend--附加 LoRA 适配器PEFT 请求时加载或 distill 初始化融合从源码看有几点值得注意--negative-prompt的实际默认值是模型感知的若注册表声明了default_negative_prompt则取之对非 LTX 模型保持历史空串行为image_to_video.py。--guidance-scale、--num-frames等参数在 argparse 中的默认值实际为None随后被video_defaults或按模型分支的默认值替换image_to_video.py因此 README 参数表中的默认值是模型特定默认值而非 argparse 字面默认。--extra-body的过滤逻辑依赖 model_extras/registry.py 中每个管线的extra_body_params白名单例如 Cosmos3 声明了flow_shift / max_sequence_length / guardrails / generate_sound / sound_gen等键cosmos3.pyLTX 系则声明video_cfg_scale / audio_cfg_scale / video_stg_scale等引导参数ltx2.py。对于未声明extra_body_params的模型脚本只把显式--extra-bodyJSON 中非空的值透传给sampling_params.extra_argsimage_to_video.py。More CLI Examples分模型实战命令Wan2.2-I2V-A14B-DiffusersMoE 两阶段python image_to_video.py \ --model Wan-AI/Wan2.2-I2V-A14B-Diffusers \ --image cherry_blossom.jpg \ --prompt Cherry blossoms swaying gently in the breeze, petals falling, smooth motion \ --negative-prompt low quality, blurry \ --height 480 \ --width 832 \ --num-frames 48 \ --guidance-scale 5.0 \ --guidance-scale-high 6.0 \ --num-inference-steps 40 \ --boundary-ratio 0.875 \ --flow-shift 12.0 \ --fps 16 \ --output i2v_wan_moe.mp4MoE 版本的关键差异在于两阶段去噪--guidance-scale作用于低噪声阶段--guidance-scale-high作用于高噪声阶段两者通过--boundary-ratio 0.875划分边界。脚本将guidance_scale_2与boundary_ratio一并传入OmniDiffusionSamplingParamsimage_to_video.py。Wan2.2-TI2V-5B-Diffusers统一模型python image_to_video.py \ --model Wan-AI/Wan2.2-TI2V-5B-Diffusers \ --image cherry_blossom.jpg \ --prompt Cherry blossoms swaying gently in the breeze, petals falling, smooth motion \ --negative-prompt low quality, blurry \ --height 480 \ --width 832 \ --num-frames 48 \ --guidance-scale 4.0 \ --num-inference-steps 40 \ --flow-shift 12.0 \ --fps 16 \ --output i2v_wan_ti2v.mp4TI2V-5B 是更小的统一 T2VI2V 模型不需要--guidance-scale-high与--boundary-ratio这类 MoE 专属参数。HunyuanVideo-1.5 I2V480pCPU offload 实战python image_to_video.py \ --model hunyuanvideo-community/HunyuanVideo-1.5-Diffusers-480p_i2v \ --image cherry_blossom.jpg \ --prompt Cherry blossoms swaying gently in the breeze, petals falling, smooth motion \ --height 480 \ --width 832 \ --num-frames 121 \ --guidance-scale 6.0 \ --flow-shift 5.0 \ --num-inference-steps 50 \ --fps 24 \ --enable-cpu-offload \ --vae-use-tiling \ --vae-use-slicing \ --output hunyuan_i2v.mp4该模型默认约 100 GiB 显存示例通过--enable-cpu-offload配合 VAE tiling/slicing 将运行压力降到 80 GiB 单卡可承载的范围。LTX-2python image_to_video.py \ --model Lightricks/LTX-2 \ --image cherry_blossom.jpg \ --prompt A cinematic dolly shot of cherry blossoms \ --output ltx2_i2v.mp4LTX-2 使用--frame-rate控制生成帧率默认回退到--fps尺寸需为32 的倍数蒸馏版LTX2Distilled*Pipeline步数默认仅 8 步、对齐倍数 64。所有检查点、管线选择、T2V 与高级选项见 LTX-2 配方。LTX 系模型在注册表中声明了ltx_preserves_reference_image_size解析器ltx2.py因此输入图像会保持原始几何直到管线执行条件压缩。SANA-Video-2B480p / 720ppython image_to_video.py \ --model Efficient-Large-Model/SANA-Video_2B_480p_diffusers \ --model-class-name SanaImageToVideoPipeline \ --image cherry_blossom.jpg \ --prompt Cherry blossoms sway in the breeze as petals drift past the camera. \ --negative-prompt blurry, low quality, temporal artifacts \ --height 480 \ --width 832 \ --num-frames 81 \ --num-inference-steps 50 \ --guidance-scale 6.0 \ --extra-body {motion_score: 30} \ --fps 16 \ --seed 42 \ --output sana_video_i2v_480p.mp4SANA-Video 的检查点元数据默认选择的是上游T2V管线因此做 I2V 时必须显式传--model-class-name SanaImageToVideoPipeline。720p 版本改用--height 704 --width 1280。81 帧 16 FPS 对应 SANA-Video 检查点约五秒的标准请求不启用LongSANA/LongLive 分钟级自回归工作流。从源码看原生SanaImageToVideoPipeline支持两种检查点变体480p 路径使用 vLLM-Omni 的DistributedAutoencoderKLWan包装器720p 路径使用DistributedAutoencoderKLLTX2Video分别包装对应的 Diffusers VAE 实现原生去噪循环刻意保留 Diffusers 检查点兼容的DPMSolverMultistepScheduler。官方已完成 480p/720p 两个档位的端到端 I2V 服务化验证在线适配器服务时需匹配检查点并用WIDTH1280 HEIGHT704发起 720p 请求。在线服务、native/adapter 验证边界与硬件说明见 SANA-Video 配方。Advanced Features高级能力CFG Parallel设置--cfg-parallel-size 2可在多卡场景启用 CFG Parallel将无分类器引导的正/负两条采样路径并行到不同 GPU 上加快推理。更多示例见 CFG Parallel 用户指南。Cache 加速Cache-DiT 与 TeaCache--cache-backend支持两种缓存加速后端cache_dit即 DBCache SCM TaylorSeer 的组合缓存策略tea_cacheTimestep Embedding Aware Cache时间步嵌入感知缓存。python image_to_video.py \ --model Wan-AI/Wan2.2-I2V-A14B-Diffusers \ --image cherry_blossom.jpg \ --prompt Cherry blossoms swaying gently in the breeze \ --cache-backend cache_dit \ --output i2v_cached.mp4脚本会按后端与模型填充缓存配置LTX 系使用Fn_compute_blocks2、max_warmup_steps8、residual_diff_threshold0.12等非 LTX 模型使用Fn_compute_blocks1、residual_diff_threshold0.24、scm_steps_policydynamicTeaCache 则只设rel_l1_thresh0.2image_to_video.py。详细原理参见 cache_dit 文档 与 teacache 文档。Cosmos3# Cosmos3 在 assets/ 下捆绑了示例帧任意 RGB 图也可 python image_to_video.py \ --model nvidia/Cosmos3-Nano \ --image /path/to/Cosmos3-Nano/assets/example_i2v_input.jpg \ --prompt The scene comes to life with smooth, natural motion. \ --negative-prompt blurry, distorted, low quality \ --height 720 --width 1280 --num-frames 189 --fps 24 \ --num-inference-steps 35 --guidance-scale 6.0 \ --extra-body {flow_shift: 10.0, max_sequence_length: 4096, guardrails: false} \ --output cosmos3_i2v.mp4Cosmos3 的关键参数--model模型 IDMoE 用 I2V-A14B统一模型用 TI2V-5B亦可传 LTX-2、Cosmos3、VACE--image首帧或源图路径--last-image末帧条件如 VACE--mask-image修复掩码白色像素重新生成、黑色像素保留--reference-image参考图可重复传参--extra-body模型特定生成参数的 JSON 对象按键过滤于模型声明的extra_body_params见 vllm_omni/model_extrasCosmos3 使用之--height/--width输出分辨率缺省按输入图自动推算。Wan 尺寸需 16 的倍数LTX 尺寸需 32 的倍数--num-frames帧数模型特定默认LTX 风格模型最佳8k1Cosmos3 默认 189--guidance-scale与--guidance-scale-highCFG 比例MoE 模型分低/高噪声两阶段--boundary-ratioMoE 两阶段边界切分比--flow-shiftScheduler flow shiftWan 默认 5.0、Cosmos3 默认 10.0LTX 不消费--sample-solverWan2.2 求解器unipc默认多步、euler用于 Lightning/Distill--num-inference-steps去噪步数模型特定默认Wan 50、LTX2 40、Cosmos3 35--fps输出 MP4 帧率需diffusers的 export_to_video--audio-sample-rate内嵌音频回退采样率--vae-use-slicing/--vae-use-tilingVAE 显存优化--cfg-parallel-size设为 2 开启 CFG Parallel另见 cfg_parallel 用户指南--tensor-parallel-size张量并行规模支持 TP 的模型有效如 LTX2--enable-cpu-offload开启 diffusion 模型 CPU offload--use-hsdp开启 HSDP 跨卡切分权重--hsdp-shard-size默认-1自动计算为 world_size / replicate_size--hsdp-replicate-size默认 1 表示纯切分无复制。一个容易踩坑的细节Cosmos3 的 guardrail 模型在引擎构建阶段加载因此--extra-body中的guardrails会被脚本提前提取为引擎级model_config离线版等价于服务端的--no-guardrails开关见 image_to_video.py。若遇到 OOM 错误优先尝试--vae-use-slicing与--vae-use-tiling降低显存占用。Wan2.1 VACE 条件任务一个脚本五种玩法VACEVideo All-in-one Creation and Editing系列任务的核心特点是脚本会根据媒体输入自动选择 VACE 的条件结构无需显式模式参数——脚本自动构造 VACE 管线消费的源视频、掩码或参考图序列。先下载与官方 VACE 示例相同的 Hugging Face 资源wget -O astronaut.jpg https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/astronaut.jpg wget -O vace_first_frame.png https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/flf2v_input_first_frame.png wget -O vace_last_frame.png https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/flf2v_input_last_frame.pngImage-to-VideoI2V单首帧条件python image_to_video.py \ --model Wan-AI/Wan2.1-VACE-1.3B-diffusers \ --image astronaut.jpg \ --prompt An astronaut emerging from a cracked, otherworldly egg on the surface of the moon \ --seed 42 --height 480 --width 832 --num-frames 81 \ --num-inference-steps 30 --guidance-scale 5.0 --flow-shift 5.0 \ --vae-use-tiling --output vace_i2v_output.mp4Video-to-Last-FrameV2LF末帧条件python image_to_video.py \ --model Wan-AI/Wan2.1-VACE-1.3B-diffusers \ --last-image astronaut.jpg \ --prompt An astronaut emerging from a cracked, otherworldly egg on the surface of the moon \ --seed 42 --height 480 --width 832 --num-frames 81 \ --num-inference-steps 30 --guidance-scale 5.0 --flow-shift 5.0 \ --vae-use-tiling --output vace_v2lf_output.mp4First-Last-Frame-to-VideoFLF2V首末帧双条件python image_to_video.py \ --model Wan-AI/Wan2.1-VACE-1.3B-diffusers \ --image vace_first_frame.png \ --last-image vace_last_frame.png \ --prompt CG animation style, a small blue bird takes off from a branch and lands on another branch \ --seed 42 --height 512 --width 512 --num-frames 81 \ --num-inference-steps 30 --guidance-scale 5.0 --flow-shift 5.0 \ --vae-use-tiling --output vace_flf2v_output.mp4Inpainting掩码修复先生成与官方 VACE 示例一致的掩码——一条 160 像素宽的白色竖条标记待重新生成的区域python - PY from PIL import Image mask Image.new(L, (832, 480), 0) mask.paste(255, (336, 0, 496, 480)) mask.save(vace_center_mask.png) PYpython image_to_video.py \ --model Wan-AI/Wan2.1-VACE-1.3B-diffusers \ --image astronaut.jpg \ --mask-image vace_center_mask.png \ --prompt Shrek, the ogre, walks out of a building in a happy mood \ --seed 42 --height 480 --width 832 --num-frames 81 \ --num-inference-steps 30 --guidance-scale 5.0 --flow-shift 5.0 \ --vae-use-tiling --output vace_inpaint_output.mp4Reference-to-VideoR2V多参考图重复--reference-image即可提供多张参考图python image_to_video.py \ --model Wan-AI/Wan2.1-VACE-1.3B-diffusers \ --reference-image astronaut.jpg \ --prompt Camera slowly zooms out from the character walking in a garden \ --seed 42 --height 480 --width 832 --num-frames 81 \ --num-inference-steps 30 --guidance-scale 5.0 --flow-shift 5.0 \ --vae-use-tiling --output vace_r2v_output.mp4VACE 条件结构的底层实现从 vllm_omni/model_extras/vace.py 的build_image_to_video_prompt可以看清自动构造条件的实现方式合法性校验vace.py参考图不能与 image/last_image/mask 混用mask 必须搭配 imagemask 与 last_image 不能共存必须至少提供一种条件媒体I2V构造[first_image, gray, gray, ...]的视频序列与[black_mask, white_mask, ...]的掩码序列长度均为num_framesV2LF构造[gray, ..., gray, last_image]与[white_mask, ..., black_mask]FLF2V首末帧各占一帧、中间填灰色帧要求num_frames 2Inpainting将首帧中掩码 128的像素置为灰色 128生成等长视频与掩码序列R2V直接把reference_images列表放入multi_modal_data。VACE 在注册表中声明extra_body_params 空集vace.py表示条件完全通过 prompt 媒体表达无需从sampling_params.extra_args读取模型特定值。VACE 的 T2V 命令记录在共享的 text_to_video.py 示例Wan2.2 LightX2V 转换的本地 Diffusers 目录及 LoRA 资源见 LoRA 指南。FAQ常见问题OOM 显存不足怎么办优先--vae-use-slicing--vae-use-tiling降低显存对超大模型再叠加--enable-cpu-offload或--enable-layerwise-offload。分辨率如何自动推算未指定--height/--width时脚本以输入图像为准保持纵横比并目标化 480 x 832 面积LTX2 为 512 x 768。底层由calculate_dimensions实现image_to_video.py按sqrt(max_area * aspect_ratio)计算后向下取整到mod_value的倍数Wan 为 16、LTX 为 32多条件输入image/last_image/reference_images并存时以首个有效图作为推算依据。另外若模型在注册表声明了固定尺寸则优先采用声明值。Wan2.2 MoE 与统一模型如何区分I2V-A14B是更大的 Mixture-of-Experts 模型具有独立的高低噪声 DiT 两阶段需配合--guidance-scale-high与--boundary-ratio使用TI2V-5B是更小的统一 T2VI2V 模型无需这些额外参数。为什么有些参数默认值与 argparse 显示不一致脚本将大量采样参数步数、帧数、CFG、flow shift、分辨率对齐倍数设计为模型感知默认值argparse 层默认None运行时按模型家族填充image_to_video.py并通过 model_extras/registry.py 的声明式注册表VideoGenerationDefaults承载模型自有默认这也是本示例能一套脚本多模型通用的架构基础。【免费下载链接】vllm-omniA framework for efficient model inference with omni-modality models项目地址: https://gitcode.com/GitHub_Trending/vl/vllm-omni创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考
返回列表