Remplacement du ciel
Un workflow ComfyUI pour des remplacements de ciel rapides et prêts pour la production avec les modèles Wan.
Dans le workflow
Un aperçu en lecture seule du modèle source. Ouvrez-le dans Cloud pour explorer les nœuds et apporter des modifications.
Loading the graph
Open full-size workflow previewAppelez ce modèle depuis votre code
La requête ci-dessous utilise le même graphe préparé et les mêmes paramètres que le Playground. Chaque envoi peut lancer une exécution payante ; ne relancez pas automatiquement un envoi dont l’issue est inconnue.
What you need
- Runs on
- Comfy Cloud
- Clé
- COMFY_API_KEY
- Vos fichiers
- Importés par le code depuis leurs URL
Nécessite un forfait Cloud payant et des crédits.
# 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)Essayer un exemple
À propos de ce workflow
Ce workflow ComfyUI est conçu pour un remplacement de ciel fluide dans les vidéos, en utilisant les modèles IA avancés de Wan. Grâce à des nœuds comme WanVideoVAELoader et WanVideoModelLoader, le workflow charge et traite efficacement les données vidéo. Le cœur de la technique repose sur l’utilisation des nœuds WanVideoSampler et WanVideoDecode pour synthétiser et intégrer de nouveaux ciels dans les séquences existantes. Ce workflow se distingue par sa capacité à maintenir une qualité de production élevée tout en assurant une intégration naturelle des nouveaux ciels avec la vidéo d’origine. Il intègre également les nœuds CLIPVisionLoader et WanVideoClipVisionEncode pour améliorer la compréhension sémantique de la séquence, garantissant que le remplacement du ciel est contextuellement approprié. Cela le rend particulièrement utile pour les réalisateurs et créateurs de contenu souhaitant enrichir leurs vidéos avec des ciels dynamiques sans compromis sur la qualité.
Questions-réponses
Le workflow prend en charge les formats courants comme MP4 et MOV. Assurez-vous que votre séquence est compatible avec le nœud WanVideoVAELoader pour des résultats optimaux.
Oui, vous pouvez personnaliser le ciel en utilisant le nœud WanVideoTextEncodeCached pour saisir des prompts spécifiques ou choisir parmi des modèles de ciel prédéfinis.
Le workflow utilise les nœuds CLIPVisionLoader et WanVideoClipVisionEncode pour analyser le contexte vidéo et garantir une cohérence sémantique du ciel avec la scène.
Oui, il est conçu pour traiter efficacement les séquences live-action, en maintenant une qualité élevée même dans des scènes complexes.
Workflows associés
- Qwen-Image-Edit, Wan2.2
1 entrée d'image Pile divisée - Qwen Multiangle + Wan 2.2
- Wan2.2
1.2 Démarrage – Image vers Vidéo
- Wan2.2, Z-Image-Turbo
AIrt MAchIne
- Wan, Wan2.2
Image vers Vidéo (Nouveau)
- Nano Banana, Google Gemini, Wan2.2
Restyleur en Boucle
- Wan2.2
Vidéo reliée début-fin en continu
- Wan2.2, Wan
Wan 2.2 14B Contrôle Caméra Fun
- Wan2.2, Wan
Wan 2.2 14B Fun Control
- Wan2.2, Wan
Wan 2.2 14B Fun Inpainting
- Wan, Wan2.2
Wan 2.2 14B image vers vidéo
- Wan2.2, Wan
Wan 2.2 14B Première-Dernière frame en Vidéo
- Wan2.2, Wan
Wan 2.2 14B texte vers vidéo