角色+服裝虛擬試穿棚拍
上傳角色照片與服裝平拍圖,生成 4 張角色穿著該服裝的時尚攝影照。可選擇其中一張進行放大與細節增強。
關於
This workflow builds a fast, reference-guided virtual try‑on pipeline for characters. You provide two images via LoadImage: a clear character image (face and body framing) and a flat‑lay of the clothing. A prompt entered with PrimitiveStringMultiline describes pose, studio lighting, background, and styling cues. OpenAIGPTImageNodeV2 then generates a batch of four fashion‑editorial variations and arranges them into a 2×2 contact sheet for quick review. PreviewImage shows the grid, and ImageCompare can be used to examine differences side‑by‑side.
Under the hood, the same references (character and clothing) drive both the initial batch and the upscale path to preserve facial identity and outfit details. A utility node (663da6e9-8b62-4291-a9d6-e4b8fd672197) in this graph is wired to handle the 2×2 grid output and crop it back into four 1K (approx. 1024×1024) tiles. You select one tile with ImageFromBatch by setting batch_index (0–3, starting at top‑left) and feed it into the Upscale Selected Image group. The upscale pass uses OpenAIGPTImageNodeV2 again at 2048×2048 while reusing your original references for consistency, then writes results with SaveImage.
MarkdownNote and Note nodes in the canvas provide inline reminders and tips.
您提供的內容
- 正在讀取工作流程
在 ComfyUI 中執行。 此工作流程無法在此頁面上執行。請在已載入所有內容的 Comfy Cloud 中開啟,或下載到您自己的 ComfyUI。
在 Cloud 中試用試試範例
工作流程內部
節點圖的唯讀預覽。請在 Comfy Cloud 中開啟,或下載後編輯節點。
Loading the graph
Open full-size workflow preview- 作者
- Rob
需要自訂節點
- 正在讀取工作流程
從程式碼使用此工作流程
可行時會根據工作流程圖和輸入內容產生;否則會顯示儲存的範例。執行可能產生費用的程式碼前,請檢查認證資訊和端點。
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({
"1": {
"class_type": "LoadImage",
"inputs": {
"image": "UPLOADED_image_FILENAME"
},
"_meta": {
"title": "Load Subject Image"
}
},
"5": {
"class_type": "PrimitiveStringMultiline",
"inputs": {
"value": "A 2x2 (2 rows, 2 cols) grid of high fashion photoshoot images of the model wearing the outfit from image 2, each grid image should show the a full body shot of the subject in slightly different poses. Ensure that all outfit clothes/accessories are present in each grid image.\n\nThe background setting is a studio environment with a white studio background. Ensure that each grid image has the same lighting conditions. \n\nDO NOT generate the grid with any visible borders or gutters.\n\nThe image is shot on fuji velvia film on a 55mm prime lens, the light is concentrated on the subject."
},
"_meta": {
"title": "Prompt"
}
},
"8": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "ComfyUI-image_stitched",
"images": [
"149",
0
]
},
"_meta": {
"title": "Save Stitched Image"
}
},
"12": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "ComfyUI-image_1",
"images": [
"146:57",
0
]
},
"_meta": {
"title": "Save Image"
}
},
"13": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "ComfyUI-image_2",
"images": [
"146:143",
0
]
},
"_meta": {
"title": "Save Image"
}
},
"14": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "ComfyUI-image_3",
"images": [
"146:140",
0
]
},
"_meta": {
"title": "Save Image"
}
},
"15": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "ComfyUI-image_4",
"images": [
"146:144",
0
]
},
"_meta": {
"title": "Save Image"
}
},
"23": {
"class_type": "ImageFromBatch",
"inputs": {
"batch_index": 0,
"image": [
"146:137",
0
],
"length": 1
},
"_meta": {
"title": "Select Image to Upscale"
}
},
"26": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "ComfyUI-image_upscaled",
"images": [
"150",
0
]
},
"_meta": {
"title": "Save Upscaled Image"
}
},
"27": {
"class_type": "PreviewImage",
"inputs": {
"images": [
"23",
0
]
},
"_meta": {
"title": "Preview Selected Image"
}
},
"35": {
"class_type": "LoadImage",
"inputs": {
"image": "UPLOADED_image_2_FILENAME"
},
"_meta": {
"title": "Load Outfit Image"
}
},
"149": {
"class_type": "OpenAIGPTImageNodeV2",
"inputs": {
"model": "gpt-image-2",
"model.background": "auto",
"model.custom_height": 1024,
"model.custom_width": 1024,
"model.images.image_1": [
"1",
0
],
"model.images.image_2": [
"35",
0
],
"model.quality": "low",
"model.size": "2048x2048",
"n": 1,
"prompt": [
"5",
0
],
"seed": 111
},
"_meta": {
"title": "OpenAI GPT Image 2.5"
}
},
"150": {
"class_type": "OpenAIGPTImageNodeV2",
"inputs": {
"model": "gpt-image-2",
"model.background": "auto",
"model.custom_height": 1024,
"model.custom_width": 1024,
"model.images.image_1": [
"23",
0
],
"model.images.image_2": [
"1",
0
],
"model.images.image_3": [
"35",
0
],
"model.quality": "high",
"model.size": "2048x2048",
"n": 1,
"prompt": "Generate a high resolution image. Upscale image 1 while maintaining pose, background and composition, add subtle details. Use the face from image 2 to add back facial consistency and ensure the outfit details match the clothes and accessories from image 3.",
"seed": 222
},
"_meta": {
"title": "OpenAI GPT Image 2.5"
}
},
"154": {
"class_type": "ImageCompare",
"inputs": {
"compare_view": None,
"image_a": [
"23",
0
],
"image_b": [
"150",
0
]
},
"_meta": {
"title": "Compare Before/After Upscale Images"
}
},
"146:137": {
"class_type": "BatchImagesNode",
"inputs": {
"images.image0": [
"146:57",
0
],
"images.image1": [
"146:143",
0
],
"images.image2": [
"146:140",
0
],
"images.image3": [
"146:144",
0
]
},
"_meta": {
"title": "Batch Images"
}
},
"146:138": {
"class_type": "ComfyMathExpression",
"inputs": {
"expression": "max(1, a - b)",
"values.a": [
"146:55",
0
],
"values.b": [
"146:54",
1
]
},
"_meta": {
"title": "Math Expression (Right Width)"
}
},
"146:139": {
"class_type": "ComfyMathExpression",
"inputs": {
"expression": "max(1, a - b)",
"values.a": [
"146:55",
1
],
"values.b": [
"146:59",
1
]
},
"_meta": {
"title": "Math Expression (Bottom Height)"
}
},
"146:140": {
"class_type": "ImageCropV2",
"inputs": {
"crop_region": [
"146:141",
0
],
"image": [
"149",
0
]
},
"_meta": {
"title": "Crop Image"
}
},
"146:141": {
"class_type": "PrimitiveBoundingBox",
"inputs": {
"height": [
"146:139",
1
],
"width": [
"146:54",
1
],
"x": 0,
"y": [
"146:59",
1
]
},
"_meta": {
"title": "Bounding Box"
}
},
"146:142": {
"class_type": "PrimitiveBoundingBox",
"inputs": {
"height": [
"146:59",
1
],
"width": [
"146:138",
1
],
"x": [
"146:54",
1
],
"y": 0
},
"_meta": {
"title": "Bounding Box"
}
},
"146:143": {
"class_type": "ImageCropV2",
"inputs": {
"crop_region": [
"146:142",
0
],
"image": [
"149",
0
]
},
"_meta": {
"title": "Crop Image"
}
},
"146:144": {
"class_type": "ImageCropV2",
"inputs": {
"crop_region": [
"146:145",
0
],
"image": [
"149",
0
]
},
"_meta": {
"title": "Crop Image"
}
},
"146:145": {
"class_type": "PrimitiveBoundingBox",
"inputs": {
"height": [
"146:139",
1
],
"width": [
"146:138",
1
],
"x": [
"146:54",
1
],
"y": [
"146:59",
1
]
},
"_meta": {
"title": "Bounding Box"
}
},
"146:54": {
"class_type": "ComfyMathExpression",
"inputs": {
"expression": "max(1, int(a/b))",
"values.a": [
"146:55",
0
],
"values.b": [
"146:56",
0
]
},
"_meta": {
"title": "Math Expression"
}
},
"146:55": {
"class_type": "GetImageSize",
"inputs": {
"image": [
"149",
0
]
},
"_meta": {
"title": "Get Image Size"
}
},
"146:56": {
"class_type": "PrimitiveInt",
"inputs": {
"value": 2
},
"_meta": {
"title": "Int"
}
},
"146:57": {
"class_type": "ImageCropV2",
"inputs": {
"crop_region": [
"146:58",
0
],
"image": [
"149",
0
]
},
"_meta": {
"title": "Crop Image"
}
},
"146:58": {
"class_type": "PrimitiveBoundingBox",
"inputs": {
"height": [
"146:59",
1
],
"width": [
"146:54",
1
],
"x": 0,
"y": 0
},
"_meta": {
"title": "Bounding Box"
}
},
"146:59": {
"class_type": "ComfyMathExpression",
"inputs": {
"expression": "max(1, int(a/b))",
"values.a": [
"146:55",
1
],
"values.b": [
"146:56",
0
]
},
"_meta": {
"title": "Math Expression"
}
}
})
# Replace each example.com URL with a public URL of your file.
workflow.set_input("1", "image", client.assets.from_url("https://example.com/replace-with-a-url/image"))
workflow.set_input("35", "image", client.assets.from_url("https://example.com/replace-with-a-url/image_2"))
# run() also passes api_key to the partner nodes in this workflow.
job = client.run(workflow, api_key=api_key)問答
兩個階段都在 OpenAIGPTImageNodeV2 使用相同的角色圖與服飾平鋪圖作為參考。放大階段重用同一組參考,因此會強化身分與服裝細節,而不是從零重新生成。
角色圖:清晰、光線均勻、臉部不遮擋、背景雜訊少。服飾圖:在純色背景上的平鋪正面,完整可見、不要折疊,且避免嚴重遮擋或背景花紋太亂。
使用 ImageFromBatch 節點,將 batch_index 設為你要的格子(0=左上、1=右上、2=左下、3=右下)。作者註記也提醒索引從 0 開始。
可以。直接修改 PrimitiveStringMultiline 的提示詞,指定姿勢方向(例如 3/4 角、行走步伐)、焦段或取景(全身、半身)、打光(柔光箱、輪廓光)與背景(無縫紙、彩色紙)。重新執行 2×2 Grid Generation 群組即可預覽新的變化。
相關工作流程
- Nano Banana Pro, Gemini3 Pro Image Preview, Google
Create a character turnaround
- Qwen-Image-Edit
Change a material
- Qwen-Image-Edit
See your subject from a new angle
- Flux.2 Dev, Flux
Create a product mockup
- Nano Banana Pro
Try an outfit on a character
- Seedream
Put your product in a new scene
- SSeedVR2
Upscale and restore detail
- Nano Banana Pro
Sharpen a product photo
- Topaz
Upscale an illustration
- HHitPaw
Restore portrait detail
- FLUX.1 Fill
Edit a selected region
- FLUX.1 Fill
Extend an image’s borders