LTX-2.5:FLF2V
使用 LTX-2.5 由首尾影格參考圖生成影片,將兩張影像融合為單一動畫序列。適合製作轉場、主體或場景變形,以及由靜態參考圖構建多鏡頭敘事。
工作流程內部
來源範本的唯讀預覽。請在 Cloud 中開啟,以探索節點並進行變更。
從您的程式碼呼叫此模型
以下請求使用與 Playground 相同的已準備節點圖和設定。每次提交都可能啟動付費執行;若提交結果不明,請勿自動重試提交。
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({
"31": {
"class_type": "LoadImage",
"inputs": {
"image": "UPLOADED_first_frame_FILENAME"
},
"_meta": {
"title": "Load First Frame"
}
},
"39": {
"class_type": "LoadImage",
"inputs": {
"image": "UPLOADED_last_frame_FILENAME"
},
"_meta": {
"title": "Load Last Frame"
}
},
"68": {
"class_type": "SaveVideo",
"inputs": {
"filename_prefix": "video/ltx2.5_flf2v",
"format": "auto",
"format.codec": "auto",
"video": [
"251:218",
0
]
},
"_meta": {
"title": "Save Video"
}
},
"251:195": {
"class_type": "LTXVPreprocess",
"inputs": {
"image": [
"251:214",
0
],
"img_compression": 18
},
"_meta": {
"title": "LTXV Preprocess"
}
},
"251:196": {
"class_type": "RandomNoise",
"inputs": {
"noise_seed": 873293130933086
},
"_meta": {
"title": "RandomNoise"
}
},
"251:197": {
"class_type": "LTXVEmptyLatentAudio",
"inputs": {
"audio_vae": [
"251:227",
0
],
"batch_size": 1,
"frame_rate": [
"251:205",
0
],
"frames_number": [
"251:226",
1
]
},
"_meta": {
"title": "Empty LTXV Latent Audio"
}
},
"251:198": {
"class_type": "PrimitiveInt",
"inputs": {
"value": 5
},
"_meta": {
"title": "Duration"
}
},
"251:199": {
"class_type": "LTXVPreprocess",
"inputs": {
"image": [
"251:213",
0
],
"img_compression": 18
},
"_meta": {
"title": "LTXV Preprocess"
}
},
"251:200": {
"class_type": "LTXVCropGuides",
"inputs": {
"latent": [
"251:221",
0
],
"negative": [
"251:204",
1
],
"positive": [
"251:204",
0
]
},
"_meta": {
"title": "LTXVCropGuides"
}
},
"251:201": {
"class_type": "EmptyLTXVLatentVideo",
"inputs": {
"batch_size": 1,
"height": [
"251:203",
1
],
"length": [
"251:226",
1
],
"width": [
"251:203",
0
]
},
"_meta": {
"title": "Empty LTXV Latent Video"
}
},
"251:202": {
"class_type": "LTXVConditioning",
"inputs": {
"frame_rate": [
"251:212",
0
],
"negative": [
"251:217",
0
],
"positive": [
"251:222",
0
]
},
"_meta": {
"title": "LTXVConditioning"
}
},
"251:203": {
"class_type": "GetImageSize",
"inputs": {
"image": [
"251:213",
0
]
},
"_meta": {
"title": "Get Image Size"
}
},
"251:204": {
"class_type": "LTXVAddGuide",
"inputs": {
"frame_idx": -1,
"image": [
"251:195",
0
],
"latent": [
"251:206",
2
],
"negative": [
"251:206",
1
],
"positive": [
"251:206",
0
],
"strength": 0.7,
"vae": [
"251:229",
0
]
},
"_meta": {
"title": "LTXVAddGuide"
}
},
"251:205": {
"class_type": "PrimitiveInt",
"inputs": {
"value": 24
},
"_meta": {
"title": "Frame Rate(int)"
}
},
"251:206": {
"class_type": "LTXVAddGuide",
"inputs": {
"frame_idx": 0,
"image": [
"251:199",
0
],
"latent": [
"251:201",
0
],
"negative": [
"251:202",
1
],
"positive": [
"251:202",
0
],
"strength": 0.7,
"vae": [
"251:229",
0
]
},
"_meta": {
"title": "LTXVAddGuide"
}
},
"251:208": {
"class_type": "SamplerEulerAncestral",
"inputs": {
"eta": 0,
"s_noise": 1
},
"_meta": {
"title": "SamplerEulerAncestral"
}
},
"251:210": {
"class_type": "LTXVConcatAVLatent",
"inputs": {
"audio_latent": [
"251:197",
0
],
"video_latent": [
"251:204",
2
]
},
"_meta": {
"title": "Concat AV Latent"
}
},
"251:211": {
"class_type": "SamplerCustomAdvanced",
"inputs": {
"guider": [
"251:235",
0
],
"latent_image": [
"251:210",
0
],
"noise": [
"251:196",
0
],
"sampler": [
"251:208",
0
],
"sigmas": [
"251:239",
0
]
},
"_meta": {
"title": "SamplerCustomAdvanced"
}
},
"251:212": {
"class_type": "ComfyMathExpression",
"inputs": {
"expression": "a",
"values.a": [
"251:205",
0
]
},
"_meta": {
"title": "Math Expression"
}
},
"251:213": {
"class_type": "ResizeImageMaskNode",
"inputs": {
"input": [
"31",
0
],
"resize_type": "scale dimensions",
"resize_type.crop": "center",
"resize_type.height": [
"251:216",
0
],
"resize_type.width": [
"251:215",
0
],
"scale_method": "nearest-exact"
},
"_meta": {
"title": "Resize Image/Mask"
}
},
"251:214": {
"class_type": "ResizeImageMaskNode",
"inputs": {
"input": [
"39",
0
],
"resize_type": "scale dimensions",
"resize_type.crop": "center",
"resize_type.height": [
"251:216",
0
],
"resize_type.width": [
"251:215",
0
],
"scale_method": "nearest-exact"
},
"_meta": {
"title": "Resize Image/Mask"
}
},
"251:215": {
"class_type": "PrimitiveInt",
"inputs": {
"value": 1280
},
"_meta": {
"title": "Width"
}
},
"251:216": {
"class_type": "PrimitiveInt",
"inputs": {
"value": 720
},
"_meta": {
"title": "height"
}
},
"251:217": {
"class_type": "CLIPTextEncode",
"inputs": {
"clip": [
"251:228",
0
],
"text": "blurry, out of focus, overexposed, underexposed, low contrast, washed out colors, excessive noise, grainy texture, poor lighting, flickering, motion blur, distorted proportions, unnatural skin tones, deformed facial features, asymmetrical face, missing facial features, extra limbs, disfigured hands, wrong hand count, artifacts around text, unreadable text on shirt or hat, incorrect lettering on cap (“PNTR”), incorrect t-shirt slogan (“JUST DO IT”), missing microphone, misplaced microphone, inconsistent perspective, camera shake, incorrect depth of field, background too sharp, background clutter, distracting reflections, harsh shadows, inconsistent lighting direction, color banding, cartoonish rendering, 3D CGI look, unrealistic materials, uncanny valley effect, incorrect ethnicity, wrong gender, exaggerated expressions, smiling, laughing, exaggerated sadness, wrong gaze direction, eyes looking at camera, mismatched lip sync, silent or muted audio, distorted voice, robotic voice, echo, background noise, off-sync audio, missing sniff sounds, incorrect dialogue, added dialogue, repetitive speech, jittery movement, awkward pauses, incorrect timing, unnatural transitions, inconsistent framing, tilted camera, missing door or shelves, missing shallow depth of field, flat lighting, inconsistent tone, cinematic oversaturation, stylized filters, or AI artifacts."
},
"_meta": {
"title": "CLIP Text Encode (Prompt)"
}
},
"251:218": {
"class_type": "CreateVideo",
"inputs": {
"audio": [
"251:220",
0
],
"bit_depth": 8,
"codec": "none",
"color_space": "sRGB",
"fps": [
"251:212",
0
],
"images": [
"251:219",
0
]
},
"_meta": {
"title": "Create Video"
}
},
"251:219": {
"class_type": "VAEDecodeTiled",
"inputs": {
"overlap": 64,
"samples": [
"251:200",
2
],
"temporal_overlap": 64,
"temporal_size": 4096,
"tile_size": 768,
"vae": [
"251:229",
0
]
},
"_meta": {
"title": "VAE Decode (Tiled)"
}
},
"251:220": {
"class_type": "LTXVAudioVAEDecode",
"inputs": {
"audio_vae": [
"251:227",
0
],
"samples": [
"251:221",
1
]
},
"_meta": {
"title": "LTXV Audio VAE Decode"
}
},
"251:221": {
"class_type": "LTXVSeparateAVLatent",
"inputs": {
"av_latent": [
"251:211",
1
]
},
"_meta": {
"title": "Separate AV Latent"
}
},
"251:222": {
"class_type": "CLIPTextEncode",
"inputs": {
"clip": [
"251:228",
0
],
"text": [
"251:248",
0
]
},
"_meta": {
"title": "CLIP Text Encode (Prompt)"
}
},
"251:226": {
"class_type": "ComfyMathExpression",
"inputs": {
"expression": "a * b + 1",
"values.a": [
"251:198",
0
],
"values.b": [
"251:205",
0
]
},
"_meta": {
"title": "Math Expression"
}
},
"251:227": {
"class_type": "VAELoader",
"inputs": {
"vae_name": "ltx-2.5-audio-vae-bf16.safetensors"
},
"_meta": {
"title": "Load VAE"
}
},
"251:228": {
"class_type": "CLIPLoader",
"inputs": {
"clip_name": "gemma4-12b-with-proj-ltx-2.5-comfy-int8-convrot.safetensors",
"device": "default",
"type": "ltxv"
},
"_meta": {
"title": "Load CLIP"
}
},
"251:229": {
"class_type": "VAELoader",
"inputs": {
"vae_name": "ltx-2.5-video-vae-bf16.safetensors"
},
"_meta": {
"title": "Load VAE"
}
},
"251:230": {
"class_type": "UNETLoader",
"inputs": {
"unet_name": "ltx-2.5-22b-distilled-transformer-comfy-int8-convrot.safetensors",
"weight_dtype": "default"
},
"_meta": {
"title": "Load Diffusion Model"
}
},
"251:235": {
"class_type": "LTXVDualCFGGuider",
"inputs": {
"audio_cfg": 1,
"model": [
"251:230",
0
],
"negative": [
"251:204",
1
],
"positive": [
"251:204",
0
],
"video_cfg": 1
},
"_meta": {
"title": "LTXV Dual CFG Guider"
}
},
"251:239": {
"class_type": "ManualSigmas",
"inputs": {
"sigmas": "1.0, 0.99375, 0.9875, 0.98125, 0.975, 0.909375, 0.725, 0.421875, 0.0"
},
"_meta": {
"title": "ManualSigmas"
}
},
"251:246": {
"class_type": "CLIPLoader",
"inputs": {
"clip_name": "gemma4_e2b_it_bf16.safetensors",
"device": "default",
"type": "ltxv"
},
"_meta": {
"title": "Load CLIP"
}
},
"251:247": {
"class_type": "TextGenerateLTX2Prompt",
"inputs": {
"clip": [
"251:246",
0
],
"image": [
"251:199",
0
],
"max_length": 600,
"mtp": "auto",
"prompt": [
"251:252",
0
],
"sampling_mode": "on",
"sampling_mode.min_p": 0.05,
"sampling_mode.presence_penalty": 0,
"sampling_mode.repetition_penalty": 1.15,
"sampling_mode.seed": 0,
"sampling_mode.temperature": 0.7,
"sampling_mode.top_k": 64,
"sampling_mode.top_p": 0.95,
"thinking": False,
"use_default_template": True
},
"_meta": {
"title": "Generate LTX2 Prompt"
}
},
"251:248": {
"class_type": "ComfySwitchNode",
"inputs": {
"on_false": [
"251:252",
0
],
"on_true": [
"251:247",
0
],
"switch": [
"251:250",
0
]
},
"_meta": {
"title": "If/Else Switch"
}
},
"251:249": {
"class_type": "PreviewAny",
"inputs": {
"source": [
"251:248",
0
]
},
"_meta": {
"title": "Preview as Text"
}
},
"251:250": {
"class_type": "PrimitiveBoolean",
"inputs": {
"value": True
},
"_meta": {
"title": "Boolean (Enable Prompt Enhance)"
}
},
"251:252": {
"class_type": "PrimitiveStringMultiline",
"inputs": {
"value": "The video opens low on the black water, the colossal closed bud standing motionless under the stormy midnight sky while thin fog crawls across the surface and a cold wind hisses. A single beam of moonlight shifts across the frosted outer petals. With a deep creaking sound, the bud begins to loosen: the outer petals peel back one by one, slowly and heavily, shedding flakes of frost into the water with soft splashes. Ripples spread outward in rings, catching faint cyan glints from below. As the inner petals unfurl, a warm amber glow swells from the heart of the flower, rising into the mist and lighting the undersides of the petals and the nearby basalt rocks. The camera holds steady at water level, then drifts slightly closer as the flower opens fully and its glow hums softly."
},
"_meta": {
"title": "Prompt"
}
}
})
workflow.set_input("31", "image", client.assets.from_url("https://comfy.org/catalog-media/4f6040be-625a-4b93-a379-fe59a630c054/a4ded0e5-806b-42b3-ae29-8ebd7edc22f1"))
workflow.set_input("39", "image", client.assets.from_url("https://comfy.org/catalog-media/d12742d8-ff7e-4fd7-a6b6-dd80ef65305c/696609a3-c17b-4b2e-af69-29bb504a5295"))
# 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("68"):
output.to_file(output.name)試試範例
關於此工作流程
LTX-2.5:FLF2V 是專為將兩張靜態圖(首尾影格)轉為單一連貫影片的 ComfyUI 工作流程。適合製作平滑轉場、主體變形或在僅有靜態參考時串接鏡頭。兩個 LoadImage 節點分別提供起始與結束影像,傳入 LTX-2.5 FLF2V 生成節點(cf70afc4-5a03-47ce-8210-734b1de6c6bc)。生成影格交由 SaveVideo 編碼為可播放片段。流程中有 MarkdownNote 提供提示。
技術上,LTX-2.5 節點運用 Lightricks 開源影片生成模型的關鍵影格優先「Pixel Diffusion」方法,根據首尾圖合成中間影格。常用控制項有目標解析度、影格數(或長度)、FPS 與隨機種子。部分版本還有融合/緩動選項,可調整動作偏向首圖或尾圖。SaveVideo 會依你選定的 fps 編碼(MP4/WebM,視 ffmpeg 設定)。
為獲得最佳效果,請讓兩張參考圖長寬比、光線與構圖盡量一致。影格數越多、首尾內容越連貫,動作越平滑。如有拉伸或裁切,請先將輸入圖預裁為相同尺寸再載入。
問答
強烈建議長寬比一致。生成器會將輸入調整為工作解析度,但不一致會導致拉伸或裁切。請先將兩圖預裁或補白為相同尺寸以獲得最佳效果。
實際長度為影格數 ÷ fps。要讓轉場更慢更平滑,請增加影格數並保持 fps 不變。部分版本有融合/緩動控制,可用於緩進緩出,讓動作更自然。
可以。於 LTX-2.5 FLF2V 節點設定固定種子(如有提供)。同樣輸入與參數搭配相同種子會產生一致影片,便於反覆微調。
請降低目標解析度與影格數,並預先將兩圖調整為模型工作長寬比以避免額外縮放。建議用現代 GPU 執行,如仍遇記憶體不足,請再降低解析度並反覆測試。