Create a video from references
Combine two reference images into a video with consistent subjects and a scene you describe.
تنزيل سير العملجرّبه في Cloud وثائق API
00:00
داخل سير العمل
معاينة للقراءة فقط للقالب المصدر. افتحه في Cloud لاستكشاف العُقد وإجراء التغييرات.
Loading the graph
Open full-size workflow previewاستدعِ هذا النموذج من التعليمة البرمجية الخاصة بك
يستخدم الطلب أدناه المخطط والإعدادات المُعدّة نفسها كما في Playground. يمكن لكل إرسال أن يبدأ تشغيلًا مدفوعًا؛ لا تُعِد تلقائيًا محاولة إرسال لا تُعرف نتيجته.
1 الحصول على مفتاح API ↗
What you need
- Runs on
- Comfy Cloud
- المفتاح
- COMFY_API_KEY
- ملفاتك
- تُرفع بواسطة التعليمة البرمجية من عناوين URL الخاصة بها
يتطلب خطة Cloud مدفوعة ورصيدًا.
# Python 3.10+: pip install comfy-sdk==0.4.0
import os
from comfy_sdk import Comfy
api_key = os.environ.get("COMFY_API_KEY", "").strip()
if not api_key: raise RuntimeError("Set COMFY_API_KEY")
os.environ.setdefault("COMFY_BASE_URL", "https://cloud.comfy.org")
client = Comfy(api_key=api_key)
workflow = client.workflows.from_json({
"92": {
"class_type": "SaveVideo",
"inputs": {
"filename_prefix": "video/MiniMax_H3",
"format": "auto",
"format.codec": "auto",
"video": [
"130",
0
]
},
"_meta": {
"title": "Save Video"
}
},
"115": {
"class_type": "ResolutionSelector",
"inputs": {
"aspect_ratio": "16:9 (Widescreen)",
"megapixels": 0.4,
"multiple": 32
},
"_meta": {
"title": "Resolution Selector (Size)"
}
},
"119": {
"class_type": "VAELoader",
"inputs": {
"vae_name": "minimax_h3_video_vae_fp16.safetensors"
},
"_meta": {
"title": "Load VAE"
}
},
"120": {
"class_type": "VAELoader",
"inputs": {
"vae_name": "minimax_h3_audio_vae_fp32.safetensors"
},
"_meta": {
"title": "Load VAE"
}
},
"121": {
"class_type": "VAEDecodeAudio",
"inputs": {
"samples": [
"125",
0
],
"vae": [
"120",
0
]
},
"_meta": {
"title": "VAE Decode Audio"
}
},
"122": {
"class_type": "VAEDecode",
"inputs": {
"samples": [
"125",
0
],
"vae": [
"119",
0
]
},
"_meta": {
"title": "VAE Decode"
}
},
"123": {
"class_type": "KSamplerSelect",
"inputs": {
"sampler_name": "res_multistep"
},
"_meta": {
"title": "KSamplerSelect"
}
},
"124": {
"class_type": "BasicScheduler",
"inputs": {
"denoise": 1,
"model": [
"127",
0
],
"scheduler": "simple",
"steps": [
"142",
0
]
},
"_meta": {
"title": "BasicScheduler"
}
},
"125": {
"class_type": "SamplerCustomAdvanced",
"inputs": {
"guider": [
"126",
0
],
"latent_image": [
"136",
1
],
"noise": [
"129",
0
],
"sampler": [
"123",
0
],
"sigmas": [
"124",
0
]
},
"_meta": {
"title": "SamplerCustomAdvanced"
}
},
"126": {
"class_type": "BasicGuider",
"inputs": {
"conditioning": [
"136",
0
],
"model": [
"141",
0
]
},
"_meta": {
"title": "Basic Guider"
}
},
"127": {
"class_type": "UNETLoader",
"inputs": {
"unet_name": "minimax_h3_ref2va_pruned_int8_convrot.safetensors",
"weight_dtype": "default"
},
"_meta": {
"title": "Load Diffusion Model"
}
},
"128": {
"class_type": "CLIPLoader",
"inputs": {
"clip_name": "qwen3vl_32b_minimax_h3_nvfp4_awq.safetensors",
"device": "default",
"type": "minimax"
},
"_meta": {
"title": "Load CLIP"
}
},
"129": {
"class_type": "RandomNoise",
"inputs": {
"noise_seed": 261662374822964
},
"_meta": {
"title": "RandomNoise"
}
},
"130": {
"class_type": "CreateVideo",
"inputs": {
"audio": [
"121",
0
],
"bit_depth": 8,
"codec": "none",
"color_space": "sRGB",
"fps": 24,
"images": [
"122",
0
]
},
"_meta": {
"title": "Create Video"
}
},
"131": {
"class_type": "ComfyMathExpression",
"inputs": {
"expression": "max(5, round(a * 24)) + (5 - (max(5, round(a * 24)) % 17)) % 17",
"values.a": [
"132",
0
]
},
"_meta": {
"title": "Math Expression"
}
},
"132": {
"class_type": "PrimitiveFloat",
"inputs": {
"value": 5
},
"_meta": {
"title": "Float (Duration)"
}
},
"136": {
"class_type": "MiniMaxH3ReferenceToVideo",
"inputs": {
"audio_vae": [
"120",
0
],
"clip": [
"128",
0
],
"height": [
"115",
1
],
"length": [
"131",
1
],
"prompt": [
"138",
0
],
"ref_image_size": "match",
"ref_images.ref_image_0": [
"137",
0
],
"ref_images.ref_image_1": [
"139",
0
],
"vae": [
"119",
0
],
"width": [
"115",
0
]
},
"_meta": {
"title": "MiniMax H3 Reference to Video"
}
},
"137": {
"class_type": "LoadImage",
"inputs": {
"image": "UPLOADED_image1_FILENAME"
},
"_meta": {
"title": "Load Image"
}
},
"138": {
"class_type": "PrimitiveStringMultiline",
"inputs": {
"value": "Use the first reference for the young superhero and rooftop setting, and the second reference for the mechanical dragon. In a bold comic-book style, the superhero looks up as the dragon sweeps across the night skyline. Keep both subjects consistent with their references. A smooth camera push-in builds anticipation."
},
"_meta": {
"title": "Input Text (Prompt)"
}
},
"139": {
"class_type": "LoadImage",
"inputs": {
"image": "UPLOADED_image2_FILENAME"
},
"_meta": {
"title": "Load Image"
}
},
"141": {
"class_type": "ComfySwitchNode",
"inputs": {
"on_false": [
"127",
0
],
"on_true": [
"145",
0
],
"switch": [
"146",
0
]
},
"_meta": {
"title": "If/Else Switch (model)"
}
},
"142": {
"class_type": "ComfySwitchNode",
"inputs": {
"on_false": [
"143",
0
],
"on_true": [
"144",
0
],
"switch": [
"146",
0
]
},
"_meta": {
"title": "If/Else Switch (Steps)"
}
},
"143": {
"class_type": "PrimitiveInt",
"inputs": {
"value": 20
},
"_meta": {
"title": "Int (Full)"
}
},
"144": {
"class_type": "PrimitiveInt",
"inputs": {
"value": 4
},
"_meta": {
"title": "Int (Lightning LoRA)"
}
},
"145": {
"class_type": "LoraLoaderModelOnly",
"inputs": {
"lora_name": "minimax_h3_ref2v_turbo_4step_v0.1_comfyui_bf16.safetensors",
"model": [
"127",
0
],
"strength_model": 1
},
"_meta": {
"title": "Load LoRA"
}
},
"146": {
"class_type": "PrimitiveBoolean",
"inputs": {
"value": False
},
"_meta": {
"title": "Boolean (Enable Lightning LoRA)"
}
}
})
workflow.set_input("137", "image", client.assets.from_url("https://cdn.jsdelivr.net/gh/Comfy-Org/workflow_templates@90c71fb78b3726392d010ff62a8e79e92d7296ad/input/red_superboy_on_city_roof.png"))
workflow.set_input("139", "image", client.assets.from_url("https://cdn.jsdelivr.net/gh/Comfy-Org/workflow_templates@90c71fb78b3726392d010ff62a8e79e92d7296ad/input/mecha_dragon_lightning.png"))
# run() also passes api_key to the partner nodes in this workflow.
job = client.run(workflow, api_key=api_key)
for output in job.get_outputs("92"):
output.to_file(output.name)جرّب مثالًا
مهام سير عمل ذات صلة
- MiniMax H3
Aspect Ratio Reframe: MiniMax H3 Max
- LTX-2.3
Turn an image into a video
- LTX-2.3
Add camera motion first last frame
- Wan2.2
1.2 مبتدئ – صورة إلى فيديو
- عقدة شريكة
AI on the Lot 2026 - LTX-2.3 - i2v
- Google Gemini, Kling 3.0, Z-Image-Turbo
AIrt MAchIne (نسخة API)
- SSD1.5
AnimateDiff - رسوم متحركة متكررة IPAdapters
- Seedance1.0 Pro, ByteDance
ByteDance: من البداية والنهاية إلى فيديو
- ععقدة شريكة
FastVideo FastH3: Text to Video
- Flux
FLUX 3 Video: نص إلى فيديو
- Flux
FLUX 3 فيديو: من نص إلى فيديو
- عقدة شريكة
Gemini Omni 1.1 Flash: Image to Video