하늘 교체
Wan 모델을 사용해 빠르고 프로덕션에 바로 투입할 수 있는 하늘 교체를 위한 ComfyUI 워크플로입니다.
워크플로 내부
소스 템플릿의 읽기 전용 미리보기입니다. 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({
"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)예시 사용해 보기
이 워크플로 정보
이 ComfyUI 워크플로는 Wan의 고급 AI 모델을 활용해 비디오에서 하늘을 자연스럽게 교체하도록 설계되었습니다. WanVideoVAELoader 및 WanVideoModelLoader 같은 노드를 사용해 비디오 데이터를 효율적으로 로딩하고 처리합니다. 핵심 기법은 WanVideoSampler 및 WanVideoDecode 노드를 사용해 기존 영상에 새 하늘 비주얼을 합성하고 통합하는 것입니다. 이 워크플로의 차별점은 높은 제작 품질을 유지하면서도 새 하늘이 원본 비디오 콘텐츠와 자연스럽게 블렌딩되도록 한다는 점입니다. 또한 CLIPVisionLoader 및 WanVideoClipVisionEncode 노드를 포함해 영상의 의미적 이해를 강화함으로써, 하늘 교체가 장면 맥락에 맞게 이뤄지도록 합니다. 이로 인해 품질을 희생하지 않고 다양한 하늘 변화로 비디오 프로젝트를 개선하려는 영화 제작자와 콘텐츠 크리에이터에게 유용합니다.
질문과 답변
이 워크플로는 MP4 및 MOV 같은 일반적인 비디오 형식을 지원합니다. 최적의 결과를 위해 WanVideoVAELoader 노드와의 호환성을 확인하세요.
네. WanVideoTextEncodeCached 노드에 특정 프롬프트를 입력하거나 미리 정의된 하늘 모델 중에서 선택해 하늘을 커스텀할 수 있습니다.
CLIPVisionLoader 및 WanVideoClipVisionEncode 노드가 비디오 맥락을 분석해, 하늘 교체가 장면과 의미적으로 일관되게 이뤄지도록 합니다.
네. 이 워크플로는 실사 푸티지도 효과적으로 처리하도록 설계되었으며, 복잡한 장면에서도 고품질 결과를 유지합니다.
관련 워크플로
- Wan2.2
1.2 스타터 – 이미지에서 비디오로
- Qwen-Image-Edit, Wan2.2
1개 이미지 입력 분할 스택 - Qwen 멀티앵글 + Wan 2.2
- Wan2.2, Z-Image-Turbo
AIrt MAchIne
- Wan2.2, Wan
Wan 2.2 14B Fun 인페인팅
- Wan2.2, Wan
Wan 2.2 14B Fun 제어
- Wan2.2, Wan
Wan 2.2 14B Fun 카메라 제어
- Wan, Wan2.2
Wan 2.2 14B 이미지 기반 비디오 생성
- Wan2.2, Wan
Wan 2.2 14B 첫 번째-마지막 프레임 비디오
- Wan2.2, Wan
Wan 2.2 14B 텍스트 기반 비디오 생성
- Wan2.2, Wan
Wan 2.2 5B Fun 인페인트
- Wan2.2, Wan
Wan 2.2 5B Fun 제어
- Wan2.2, Wan
Wan 2.2 5B 비디오 생성