Reemplazo de Cielo
Un flujo de trabajo de ComfyUI para reemplazo rápido y profesional de cielos usando modelos Wan.
Dentro del flujo de trabajo
Una vista previa de solo lectura de la plantilla de origen. Ábrela en Cloud para explorar los nodos y hacer cambios.
Loading the graph
Open full-size workflow previewArchivos de este flujo de trabajo
- Salida
- Video
- Autor
- ComfyUI
Llama a este modelo desde tu código
La solicitud a continuación utiliza el mismo grafo preparado y la misma configuración que el Playground. Cada envío puede iniciar una ejecución de pago; no reintentes automáticamente un envío cuyo resultado se desconozca.
What you need
- Runs on
- Comfy Cloud
- Clave
- COMFY_API_KEY
- Tus archivos
- El código los sube desde sus URL
Requiere un plan de pago de Cloud y créditos.
# 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({
"38": {
"class_type": "WanVideoVAELoader",
"inputs": {
"model_name": "Wan2_1_VAE_fp32.safetensors",
"precision": "fp32",
"use_cpu_cache": False,
"verbose": False
},
"_meta": {
"title": "WanVideo VAE Loader"
}
},
"195": {
"class_type": "WanVideoTorchCompileSettings",
"inputs": {
"allow_unmerged_lora_compile": False,
"backend": "inductor",
"compile_transformer_blocks_only": True,
"dynamic": False,
"dynamo_cache_size_limit": 64,
"dynamo_recompile_limit": 128,
"force_parameter_static_shapes": False,
"fullgraph": False,
"mode": "default"
},
"_meta": {
"title": "WanVideo Torch Compile Settings"
}
},
"891": {
"class_type": "WanVideoLoraSelectMulti",
"inputs": {
"lora_0": "WanAnimate_relight_lora_fp16.safetensors",
"lora_1": "lightx2v_I2V_14B_480p_cfg_step_distill_rank64_bf16.safetensors",
"lora_2": "none",
"lora_3": "none",
"lora_4": "none",
"low_mem_load": False,
"merge_loras": False,
"strength_0": 1,
"strength_1": 1,
"strength_2": 1,
"strength_3": 1,
"strength_4": 1
},
"_meta": {
"title": "WanVideo Lora Select Multi"
}
},
"935": {
"class_type": "CLIPVisionLoader",
"inputs": {
"clip_name": "clip_vision_h.safetensors"
},
"_meta": {
"title": "Load CLIP Vision"
}
},
"936": {
"class_type": "WanVideoClipVisionEncode",
"inputs": {
"clip_vision": [
"935",
0
],
"combine_embeds": "average",
"crop": "center",
"force_offload": True,
"image_1": [
"1295",
0
],
"ratio": 0.5,
"strength_1": 1,
"strength_2": 1,
"tiles": 0
},
"_meta": {
"title": "WanVideo ClipVision Encode"
}
},
"953": {
"class_type": "WanVideoSampler",
"inputs": {
"add_noise_to_samples": False,
"batched_cfg": False,
"cfg": 1,
"denoise_strength": 1,
"end_step": -1,
"force_offload": True,
"image_embeds": [
"1240",
0
],
"model": [
"979",
0
],
"riflex_freq_index": 0,
"rope_function": "comfy",
"scheduler": "dpm++_sde/beta",
"seed": 65346457346,
"shift": 6,
"start_step": 0,
"steps": 6,
"text_embeds": [
"982",
0
],
"uni3c_embeds": [
"1231",
0
]
},
"_meta": {
"title": "WanVideo Sampler"
}
},
"954": {
"class_type": "WanVideoDecode",
"inputs": {
"enable_vae_tiling": False,
"normalization": "default",
"samples": [
"953",
0
],
"tile_stride_x": 144,
"tile_stride_y": 128,
"tile_x": 272,
"tile_y": 272,
"vae": [
"38",
0
]
},
"_meta": {
"title": "WanVideo Decode"
}
},
"979": {
"class_type": "WanVideoModelLoader",
"inputs": {
"attention_mode": "sdpa",
"base_precision": "fp16_fast",
"compile_args": [
"195",
0
],
"load_device": "offload_device",
"lora": [
"891",
0
],
"model": "Wan2_2-Animate-14B_fp8_scaled_e4m3fn_KJ_v2.safetensors",
"quantization": "disabled",
"rms_norm_function": "default"
},
"_meta": {
"title": "WanVideo Model Loader"
}
},
"982": {
"class_type": "WanVideoTextEncodeCached",
"inputs": {
"device": "gpu",
"model_name": "umt5-xxl-enc-bf16.safetensors",
"negative_prompt": "色调艳丽,过曝,静态,细节模糊不清,字幕,风格,作品,画作,画面,静止,整体发灰,最差质量,低质量,JPEG压缩残留,丑陋的,残缺的,多余的手指,画得不好的手部,画得不好的脸部,畸形的,毁容的,形态畸形的肢体,手指融合,静止不动的画面,杂乱的背景,三条腿,背景人很多,倒着走",
"positive_prompt": [
"1201",
0
],
"precision": "bf16",
"quantization": "disabled",
"use_disk_cache": False
},
"_meta": {
"title": "WanVideo TextEncode Cached"
}
},
"1099": {
"class_type": "VHS_VideoInfoLoaded",
"inputs": {
"video_info": [
"1313",
3
]
},
"_meta": {
"title": "Video Info (Loaded) 🎥🅥🅗🅢"
}
},
"1181": {
"class_type": "PreviewImage",
"inputs": {
"images": [
"1295",
0
]
},
"_meta": {
"title": "Preview Image"
}
},
"1201": {
"class_type": "AILab_QwenVL",
"inputs": {
"attention_mode": "sdpa",
"custom_prompt": "Create a video prompt for this image. AI video model Wan2.2. Only respond with the video prompt and nothing else.",
"image": [
"1295",
0
],
"keep_model_loaded": False,
"max_tokens": 512,
"model_name": "Qwen3-VL-2B-Instruct",
"preset_prompt": "🖼️ Detailed Description",
"quantization": "None (FP16)",
"seed": 2074003516
},
"_meta": {
"title": "QwenVL"
}
},
"1231": {
"class_type": "WanVideoUni3C_embeds",
"inputs": {
"controlnet": [
"1232",
0
],
"end_percent": 1,
"offload": True,
"render_latent": [
"1233",
0
],
"start_percent": 0,
"strength": 1
},
"_meta": {
"title": "WanVideo Uni3C Embeds"
}
},
"1232": {
"class_type": "WanVideoUni3C_ControlnetLoader",
"inputs": {
"attention_mode": "sdpa",
"base_precision": "fp16",
"load_device": "main_device",
"model": "Wan21_Uni3C_controlnet_fp16.safetensors",
"quantization": "disabled"
},
"_meta": {
"title": "WanVideo Uni3C Controlnet Loader"
}
},
"1233": {
"class_type": "WanVideoEncode",
"inputs": {
"enable_vae_tiling": False,
"image": [
"1313",
0
],
"latent_strength": 1,
"noise_aug_strength": 0,
"tile_stride_x": 144,
"tile_stride_y": 128,
"tile_x": 272,
"tile_y": 272,
"vae": [
"38",
0
]
},
"_meta": {
"title": "WanVideo Encode"
}
},
"1240": {
"class_type": "WanVideoImageToVideoEncode",
"inputs": {
"augment_empty_frames": 0,
"clip_embeds": [
"936",
0
],
"end_latent_strength": 1,
"force_offload": True,
"fun_or_fl2v_model": False,
"height": [
"1300",
0
],
"noise_aug_strength": 0,
"num_frames": [
"1099",
1
],
"start_image": [
"1295",
0
],
"start_latent_strength": 1,
"tiled_vae": False,
"vae": [
"38",
0
],
"width": [
"1299",
0
]
},
"_meta": {
"title": "WanVideo ImageToVideo Encode"
}
},
"1281": {
"class_type": "GeminiImage2Node",
"inputs": {
"aspect_ratio": "auto",
"images": [
"1314",
0
],
"model": "gemini-3-pro-image-preview",
"prompt": "Replace only the flat, pale sky with a dramatic late-afternoon summer storm rolling in over the steppe. Towering anvil-shaped thunderheads in deep slate blue and bruised violet fill the upper half, their edges lit gold by a low sun breaking through a gap near the horizon. Long shafts of warm light fan down through the clouds, and a faint veil of distant rain hangs over the far left of the horizon. Relight the ground to match the new sky: warm golden light grazing across the cracked earth and grass tufts, with long soft shadows and a cooler, darker tone where cloud shadows fall. Keep the horizon line, the terrain, every pebble and every grass tuft exactly where they are. It must look like a natural photograph, not a composite.",
"resolution": "1K",
"response_modalities": "IMAGE",
"seed": 1085497317911772,
"system_prompt": "You are an expert image-generation engine. You must ALWAYS produce an image.\nInterpret all user input—regardless of format, intent, or abstraction—as literal visual directives for image composition.\nIf a prompt is conversational or lacks specific visual details, you must creatively invent a concrete visual scenario that depicts the concept.\nPrioritize generating the visual representation above any text, formatting, or conversational requests."
},
"_meta": {
"title": "Nano Banana Pro (Google Gemini Image)"
}
},
"1285": {
"class_type": "PreviewImage",
"inputs": {
"images": [
"1281",
0
]
},
"_meta": {
"title": "Preview Image"
}
},
"1295": {
"class_type": "ImageScale",
"inputs": {
"crop": "disabled",
"height": [
"1300",
0
],
"image": [
"1281",
0
],
"upscale_method": "nearest-exact",
"width": [
"1299",
0
]
},
"_meta": {
"title": "Upscale Image"
}
},
"1299": {
"class_type": "INTConstant",
"inputs": {
"value": 1280
},
"_meta": {
"title": "width"
}
},
"1300": {
"class_type": "INTConstant",
"inputs": {
"value": 704
},
"_meta": {
"title": "height"
}
},
"1312": {
"class_type": "PreviewAny",
"inputs": {
"source": [
"1201",
0
]
},
"_meta": {
"title": "Preview as Text"
}
},
"1313": {
"class_type": "VHS_LoadVideoFFmpeg",
"inputs": {
"custom_height": [
"1300",
0
],
"custom_width": [
"1299",
0
],
"force_rate": 0,
"format": "Wan",
"frame_load_cap": 0,
"start_time": 0,
"video": "UPLOADED_video_FILENAME"
},
"_meta": {
"title": "Load Video FFmpeg (Upload) 🎥🅥🅗🅢"
}
},
"1314": {
"class_type": "ImageFromBatch",
"inputs": {
"batch_index": 0,
"image": [
"1313",
0
],
"length": 1
},
"_meta": {
"title": "Get Image from Batch"
}
},
"1316": {
"class_type": "VHS_VideoCombine",
"inputs": {
"audio": [
"1313",
2
],
"crf": 22,
"filename_prefix": "SkyReplacement",
"format": "video/h265-mp4",
"frame_rate": [
"1099",
0
],
"images": [
"954",
0
],
"loop_count": 0,
"pingpong": False,
"pix_fmt": "yuv420p10le",
"save_metadata": True,
"save_output": True
},
"_meta": {
"title": "Video Combine 🎥🅥🅗🅢"
}
}
})
workflow.set_input("1313", "video", client.assets.from_url("https://comfy.org/catalog-media/237f4ae8-62d2-483b-a47b-10a35332ffb3/e47c4ffb-b061-4cde-bc56-fdaac2d38528"))
# 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("1316"):
output.to_file(output.name)Probar un ejemplo
Acerca de este flujo de trabajo
Este flujo de trabajo de ComfyUI está diseñado para reemplazo de cielo en vídeos, utilizando modelos avanzados de IA de Wan. Al aprovechar Nodos como WanVideoVAELoader y WanVideoModelLoader, el flujo de trabajo carga y procesa datos de vídeo de forma eficiente. El núcleo de la técnica consiste en usar los Nodos WanVideoSampler y WanVideoDecode para sintetizar e integrar nuevos cielos en metraje de vídeo existente. Lo que distingue a este flujo de trabajo es su capacidad para mantener una alta calidad de producción mientras asegura que los nuevos cielos se mezclen de forma natural con el contenido original. El flujo de trabajo también incorpora CLIPVisionLoader y WanVideoClipVisionEncode para mejorar la comprensión semántica del metraje, asegurando que los reemplazos de cielo sean adecuados al contexto. Esto lo hace especialmente útil para cineastas y creadores de contenido que quieren mejorar sus proyectos de vídeo con cambios dinámicos de cielo sin comprometer la calidad.
Preguntas y respuestas
El flujo soporta formatos comunes como MP4 y MOV. Asegúrate de que tu video sea compatible con el nodo WanVideoVAELoader para mejores resultados.
Sí, puedes personalizar el cielo usando el nodo WanVideoTextEncodeCached para ingresar prompts específicos o seleccionar modelos de cielo predefinidos.
El flujo utiliza los nodos CLIPVisionLoader y WanVideoClipVisionEncode para analizar el contexto del video, asegurando que el reemplazo de cielo sea semánticamente consistente con la escena.
Sí, el flujo está diseñado para manejar metraje de acción real manteniendo resultados de alta calidad incluso en escenas complejas.