LTX 클린플레이트(VFX용)
오브젝트를 프롬프트로 지정하면 SAM3와 LTX 2.3 마스크 조건 인페인팅이 해당 오브젝트를 제거하고 깨끗한 배경 플레이트를 복원합니다.
워크플로 내부
소스 템플릿의 읽기 전용 미리보기입니다. 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({
"52": {
"class_type": "SaveVideo",
"inputs": {
"codec": "auto",
"filename_prefix": "cleanplate_compare",
"format": "auto",
"format.codec": "auto",
"video": [
"54:31",
0
]
},
"_meta": {
"title": "Save Video Compared"
}
},
"53": {
"class_type": "SaveVideo",
"inputs": {
"codec": "auto",
"filename_prefix": "cleanplate_ltx_inpaint",
"format": "auto",
"format.codec": "auto",
"video": [
"54:36",
0
]
},
"_meta": {
"title": "Save Video"
}
},
"58": {
"class_type": "GetVideoComponents",
"inputs": {
"video": [
"117",
0
]
},
"_meta": {
"title": "Plate frames"
}
},
"59": {
"class_type": "GetVideoComponents",
"inputs": {
"video": [
"54:36",
0
]
},
"_meta": {
"title": "LTX inpaint frames"
}
},
"63": {
"class_type": "VHS_GetImageCount",
"inputs": {
"images": [
"58",
0
]
},
"_meta": {
"title": "n"
}
},
"64": {
"class_type": "ComfyMathExpression",
"inputs": {
"expression": "(int((a - 1) / 8)) * 8 + 1",
"values.a": [
"63",
0
]
},
"_meta": {
"title": "L = valid LTX length"
}
},
"65": {
"class_type": "GetImageRangeFromBatch",
"inputs": {
"images": [
"58",
0
],
"num_frames": [
"64",
1
],
"start_index": 0
},
"_meta": {
"title": "Trim plate to L"
}
},
"66": {
"class_type": "LTXVDilateVideoMask",
"inputs": {
"mask": [
"73",
0
],
"spatial_radius": 10,
"temporal_radius": 1
},
"_meta": {
"title": "Dilate matte"
}
},
"67": {
"class_type": "GrowMaskWithBlur",
"inputs": {
"blur_radius": 4,
"decay_factor": 1,
"expand": 0,
"fill_holes": False,
"flip_input": False,
"incremental_expandrate": 0,
"lerp_alpha": 1,
"mask": [
"66",
0
],
"tapered_corners": True
},
"_meta": {
"title": "Feather"
}
},
"68": {
"class_type": "LTXVInpaintPreprocess",
"inputs": {
"images": [
"65",
0
],
"mask": [
"67",
0
]
},
"_meta": {
"title": "Green-fill masked region"
}
},
"69": {
"class_type": "CreateVideo",
"inputs": {
"bit_depth": 8,
"codec": "none",
"color_space": "sRGB",
"fps": [
"58",
2
],
"images": [
"68",
0
]
},
"_meta": {
"title": "-> subgraph guide"
}
},
"70": {
"class_type": "LoadSAM3Model",
"inputs": {
"model_path": "models/sam3/sam3.pt"
},
"_meta": {
"title": "(down)Load SAM3 Model"
}
},
"71": {
"class_type": "SAM3VideoSegmentation",
"inputs": {
"frame_idx": 0,
"prompt_mode": "text",
"score_threshold": 0.3,
"text_prompt": [
"130",
0
],
"video_frames": [
"65",
0
]
},
"_meta": {
"title": "SAM3 (object prompt)"
}
},
"72": {
"class_type": "SAM3Propagate",
"inputs": {
"direction": "both",
"end_frame": -1,
"offload_model": False,
"sam3_model": [
"70",
0
],
"start_frame": 0,
"video_state": [
"71",
0
]
},
"_meta": {
"title": "SAM3 Propagate"
}
},
"73": {
"class_type": "SAM3VideoOutput",
"inputs": {
"masks": [
"72",
0
],
"obj_id": -1,
"plot_all_masks": True,
"scores": [
"72",
1
],
"video_state": [
"72",
2
]
},
"_meta": {
"title": "SAM3 Video Output"
}
},
"75": {
"class_type": "MaskToImage",
"inputs": {
"mask": [
"67",
0
]
},
"_meta": {
"title": "Convert Mask to Image"
}
},
"76": {
"class_type": "CreateVideo",
"inputs": {
"bit_depth": 8,
"codec": "none",
"color_space": "sRGB",
"fps": [
"58",
2
],
"images": [
"75",
0
]
},
"_meta": {
"title": "Create Video"
}
},
"77": {
"class_type": "SaveVideo",
"inputs": {
"codec": "auto",
"filename_prefix": "cleanplate_matte",
"format": "auto",
"format.codec": "auto",
"video": [
"76",
0
]
},
"_meta": {
"title": "Save Matte (Nuke)"
}
},
"116": {
"class_type": "VHS_LoadVideo",
"inputs": {
"custom_height": 0,
"custom_width": 0,
"force_rate": 0,
"format": "LTXV",
"frame_load_cap": 0,
"select_every_nth": 1,
"skip_first_frames": 0,
"video": "UPLOADED_video_FILENAME"
},
"_meta": {
"title": "Load Video (Upload) 🎥🅥🅗🅢"
}
},
"117": {
"class_type": "CreateVideo",
"inputs": {
"audio": [
"116",
2
],
"bit_depth": 8,
"codec": "none",
"color_space": "sRGB",
"fps": [
"118",
0
],
"images": [
"116",
0
]
},
"_meta": {
"title": "Create Video"
}
},
"118": {
"class_type": "VHS_VideoInfo",
"inputs": {
"video_info": [
"116",
3
]
},
"_meta": {
"title": "Video Info 🎥🅥🅗🅢"
}
},
"130": {
"class_type": "PrimitiveString",
"inputs": {
"value": "cart"
},
"_meta": {
"title": "What do you want to remove?"
}
},
"133": {
"class_type": "PreviewAny",
"inputs": {
"source": [
"134",
0
]
},
"_meta": {
"title": "Final prompt"
}
},
"134": {
"class_type": "StringConcatenate",
"inputs": {
"delimiter": " ",
"string_a": [
"135",
0
],
"string_b": "removed"
},
"_meta": {
"title": "+ suffix"
}
},
"135": {
"class_type": "StringConcatenate",
"inputs": {
"delimiter": " ",
"string_a": "background plate, the scene with the",
"string_b": [
"130",
0
]
},
"_meta": {
"title": "prefix + object"
}
},
"54:1": {
"class_type": "VAELoaderKJ",
"inputs": {
"device": "main_device",
"vae_name": "LTX23_video_vae_bf16.safetensors",
"weight_dtype": "bf16"
},
"_meta": {
"title": "VAELoader KJ"
}
},
"54:10": {
"class_type": "EmptyLTXVLatentVideo",
"inputs": {
"batch_size": 1,
"height": [
"54:6",
1
],
"length": [
"54:45",
1
],
"width": [
"54:6",
0
]
},
"_meta": {
"title": "Empty LTXV Latent Video"
}
},
"54:11": {
"class_type": "LTXVConditioning",
"inputs": {
"frame_rate": [
"54:49",
0
],
"negative": [
"54:22",
0
],
"positive": [
"54:9",
0
]
},
"_meta": {
"title": "LTXVConditioning"
}
},
"54:12": {
"class_type": "LTXAddVideoICLoRAGuide",
"inputs": {
"crop": "disabled",
"frame_idx": 0,
"image": [
"54:41",
0
],
"latent": [
"54:10",
0
],
"latent_downscale_factor": 1,
"negative": [
"54:11",
1
],
"positive": [
"54:11",
0
],
"strength": 1,
"tile_frames": 97,
"tile_overlap": 64,
"tile_size": 256,
"use_streaming": False,
"use_tiled_encode": False,
"vae": [
"54:1",
0
]
},
"_meta": {
"title": "🅛🅣🅧 Add Video IC-LoRA Guide"
}
},
"54:126": {
"class_type": "ComfyNumberConvert",
"inputs": {
"value": [
"58",
2
]
},
"_meta": {
"title": "Convert Number"
}
},
"54:13": {
"class_type": "LTXVAudioVAEDecode",
"inputs": {
"audio_vae": [
"54:2",
0
],
"samples": [
"54:18",
1
]
},
"_meta": {
"title": "LTXV Audio VAE Decode"
}
},
"54:14": {
"class_type": "LoraLoaderModelOnly",
"inputs": {
"lora_name": "ltx-2.3-22b-distilled-lora-384-1.1.safetensors",
"model": [
"54:15",
0
],
"strength_model": 0.4
},
"_meta": {
"title": "Load LoRA"
}
},
"54:15": {
"class_type": "LoraLoaderModelOnly",
"inputs": {
"lora_name": "ltx-2.3-22b-ic-lora-in-outpainting-0.9.safetensors",
"model": [
"54:5",
0
],
"strength_model": 1
},
"_meta": {
"title": "Load LoRA"
}
},
"54:16": {
"class_type": "VAEDecode",
"inputs": {
"samples": [
"54:17",
2
],
"vae": [
"54:1",
0
]
},
"_meta": {
"title": "VAE Decode"
}
},
"54:17": {
"class_type": "LTXVCropGuides",
"inputs": {
"latent": [
"54:18",
0
],
"negative": [
"54:12",
1
],
"positive": [
"54:12",
0
]
},
"_meta": {
"title": "LTXVCropGuides"
}
},
"54:18": {
"class_type": "LTXVSeparateAVLatent",
"inputs": {
"av_latent": [
"54:19",
0
]
},
"_meta": {
"title": "Separate AV Latent"
}
},
"54:19": {
"class_type": "KSampler",
"inputs": {
"cfg": 1,
"denoise": 1,
"latent_image": [
"54:20",
0
],
"model": [
"54:14",
0
],
"negative": [
"54:12",
1
],
"positive": [
"54:12",
0
],
"sampler_name": "euler_ancestral_cfg_pp",
"scheduler": "linear_quadratic",
"seed": 511332212712579,
"steps": 8
},
"_meta": {
"title": "KSampler"
}
},
"54:2": {
"class_type": "VAELoaderKJ",
"inputs": {
"device": "main_device",
"vae_name": "LTX23_audio_vae_bf16.safetensors",
"weight_dtype": "bf16"
},
"_meta": {
"title": "VAELoader KJ"
}
},
"54:20": {
"class_type": "LTXVConcatAVLatent",
"inputs": {
"audio_latent": [
"54:21",
0
],
"video_latent": [
"54:12",
2
]
},
"_meta": {
"title": "Concat AV Latent"
}
},
"54:21": {
"class_type": "LTXVEmptyLatentAudio",
"inputs": {
"audio_vae": [
"54:2",
0
],
"batch_size": 1,
"frame_rate": [
"54:50",
0
],
"frames_number": [
"54:45",
1
]
},
"_meta": {
"title": "Empty LTXV Latent Audio"
}
},
"54:22": {
"class_type": "CLIPTextEncode",
"inputs": {
"clip": [
"54:4",
0
],
"text": "blurry, low resolution, ugly, garbled mess, compression artifacts, glitch, stop motion, still image, pixelated, robotic voice, oversaturated"
},
"_meta": {
"title": "CLIP Text Encode (Prompt)"
}
},
"54:25": {
"class_type": "ImageFromBatch",
"inputs": {
"batch_index": 0,
"image": [
"54:41",
0
],
"length": 1
},
"_meta": {
"title": "Get Image from Batch"
}
},
"54:26": {
"class_type": "ImageStitch",
"inputs": {
"direction": "down",
"image1": [
"54:41",
0
],
"image2": [
"54:16",
0
],
"match_image_size": True,
"spacing_color": "white",
"spacing_width": 0
},
"_meta": {
"title": "Stitch Images"
}
},
"54:3": {
"class_type": "VHS_GetImageCount",
"inputs": {
"images": [
"54:38",
0
]
},
"_meta": {
"title": "Get Image Count 🎥🅥🅗🅢"
}
},
"54:31": {
"class_type": "CreateVideo",
"inputs": {
"bit_depth": 8,
"codec": "none",
"color_space": "sRGB",
"fps": [
"54:49",
0
],
"images": [
"54:26",
0
]
},
"_meta": {
"title": "Create Video"
}
},
"54:36": {
"class_type": "CreateVideo",
"inputs": {
"audio": [
"54:38",
1
],
"bit_depth": 8,
"codec": "none",
"color_space": "sRGB",
"fps": [
"54:49",
0
],
"images": [
"54:16",
0
]
},
"_meta": {
"title": "Create Video"
}
},
"54:38": {
"class_type": "GetVideoComponents",
"inputs": {
"video": [
"69",
0
]
},
"_meta": {
"title": "Get Video Components"
}
},
"54:4": {
"class_type": "DualCLIPLoader",
"inputs": {
"clip_name1": "gemma_3_12B_it_fp4_mixed.safetensors",
"clip_name2": "ltx-2.3_text_projection_bf16.safetensors",
"device": "default",
"type": "ltxv"
},
"_meta": {
"title": "Load CLIP (Dual)"
}
},
"54:41": {
"class_type": "ResizeImageMaskNode",
"inputs": {
"input": [
"54:38",
0
],
"resize_type": "scale dimensions",
"resize_type.crop": "disabled",
"resize_type.height": [
"118",
4
],
"resize_type.width": [
"118",
3
],
"scale_method": "area"
},
"_meta": {
"title": "Resize Image/Mask (s1 size)"
}
},
"54:43": {
"class_type": "PreviewAny",
"inputs": {
"source": [
"54:45",
1
]
},
"_meta": {
"title": "Preview as Text"
}
},
"54:45": {
"class_type": "ComfyMathExpression",
"inputs": {
"expression": "(int((a - 1) / 8)) * 8 + 1",
"values.a": [
"54:3",
0
]
},
"_meta": {
"title": "Math Expression"
}
},
"54:49": {
"class_type": "ComfyNumberConvert",
"inputs": {
"value": [
"54:50",
0
]
},
"_meta": {
"title": "Convert Number"
}
},
"54:5": {
"class_type": "UNETLoader",
"inputs": {
"unet_name": "ltx-2.3-22b-dev_transformer_only_bf16.safetensors",
"weight_dtype": "default"
},
"_meta": {
"title": "Load Diffusion Model"
}
},
"54:50": {
"class_type": "PrimitiveInt",
"inputs": {
"value": [
"54:126",
1
]
},
"_meta": {
"title": "fps"
}
},
"54:6": {
"class_type": "GetImageSize",
"inputs": {
"image": [
"54:25",
0
]
},
"_meta": {
"title": "Get Image Size"
}
},
"54:9": {
"class_type": "CLIPTextEncode",
"inputs": {
"clip": [
"54:4",
0
],
"text": [
"133",
0
]
},
"_meta": {
"title": "CLIP Text Encode (Prompt)"
}
}
})
workflow.set_input("116", "video", client.assets.from_url("https://comfy.org/catalog-media/9c45ce1c-1805-4be7-ac67-11f7bb6d02fa/40969461-d6a9-41e2-9e20-eb8d27b27314"))
# 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("53"):
output.to_file(output.name)
for output in job.get_outputs("52"):
output.to_file(output.name)
for output in job.get_outputs("77"):
output.to_file(output.name)예시 사용해 보기
이 워크플로 정보
이 ComfyUI 워크플로는 SAM3 기반 마스크와 마스크 조건의 LTX-2.3 In‑Outpainting IC‑LoRA를 사용해 비디오에서 오브젝트를 제거하고, 깨끗한 배경 플레이트(clean plate)를 생성합니다. 파이프라인은 VHS_LoadVideo/VHS_VideoInfo로 클립을 로드하고, GetVideoComponents로 프레임을 추출한 뒤, LoadSAM3Model → SAM3VideoSegmentation으로 제거할 오브젝트의 마스크를 시드합니다. SAM3Propagate가 샷 전반에 마스크를 추적하고, SAM3VideoOutput이 프레임별 OBJECT_MASK를 제공합니다. 자연스러운 채움을 위해 LTXVDilateVideoMask로 마스크를 확장(예: s10/t1)하고 GrowMaskWithBlur로 가장자리를 페더링합니다.
마스킹 영역은 LTXVInpaintPreprocess에서 초록색으로 채워지고, CreateVideo가 전처리된 프레임을 다시 인코딩합니다. 그린 플레이트는 OBJECT_MASK 및 배경만 포함한 최소 프롬프트와 함께 LTX 2.3 In‑Outpainting IC‑LoRA(여기서는 서브그래프 노드로 패키징됨)에 입력되며, 이 노드는 마스크 조건으로 마스킹된 영역 내부만 생성하도록 명시적으로 설정되어 있습니다. VHS_GetImageCount, ComfyMathExpression, GetImageRangeFromBatch 같은 유틸리티 노드를 사용하면 전체 실행 전에 제한된 프레임 범위를 미리보기할 수 있습니다. 마지막으로 SaveVideo가 컴포지팅 후속 작업에 사용할 수 있는 cleanplate 결과를 기록합니다.
질문과 답변
비워두거나, 마스크 내부의 배경만 묘사하세요(예: “페인트 라인이 있는 아스팔트 도로, 부드러운 그림자”). 제거하는 오브젝트나 관련 없는 전경 요소를 언급하면 복제나 환각이 생길 수 있습니다.
LTXVDilateVideoMask 크기를 늘려 모션 블러를 덮고 오브젝트 바깥까지 확장한 뒤, GrowMaskWithBlur 페더 반경을 올려 전환을 부드럽게 하세요. 또한 더 명확한 프레임에서 SAM3를 다시 시드하고, 추적 마스크가 드리프트하면 다시 propagate 하세요.
네. VHS_GetImageCount로 전체 프레임 수를 확인하고, GetImageRangeFromBatch(필요 시 ComfyMathExpression과 함께)로 작은 프레임 구간을 선택해 빠르게 반복한 다음, 만족하면 전체 범위로 되돌리세요.
SaveVideo는 보통 무음 파일을 출력합니다. 오디오가 필요하면 NLE나 ffmpeg 같은 도구로 원본 트랙을 다시 리먹스하세요. 설정에 따라 GetVideoComponents로 오디오를 라우팅했다면 렌더 후 외부에서 패스스루 처리할 수도 있습니다.
관련 워크플로
- Seedance 2.5
Change a video’s background
- LTX-2.3
Remove an object from a video
- LTX-2.3
Expand a video’s frame
- SSCAIL-2
Replace a character in a video
- SSeedVR2
Upscale a video
- LTX-2.3
Restore archival footage
- 파트너 노드
AI on the Lot 2026_LTX-2.3_IC LoRA (Union Control)
- Wan2.2, Z-Image-Turbo
AIrt MAchIne
- 파파트너 노드
Beeble SwitchX: 비디오 편집
- BRIA
Bria: 비디오 배경 제거
- CCapybara
Capybara:비디오 편집
- 파파트너 노드
Comfy 광고용 B-롤 제작