重新打光與環境合成
結合插畫 LoRA 與打光 LoRA,讓插畫角色在關鍵影格中正確打光。
關於
此工作流程會替插畫角色重新打光,使其與新的背景底片匹配,並合併為一致的關鍵影格。主要處理封裝在 Subgraph 節點中(type ID: 9e3c3756-d15f-4361-8e99-c35673036e68),因此你只需要操作少量清楚的輸入與控制。你透過 LoadImage 節點提供角色圖片與環境圖片,用提示詞文字來驅動外觀(參考圖內 Note/MarkdownNote),並用 SaveImage 匯出結果。
技術上,Subgraph 會疊加插畫 LoRA 以維持風格一致性,並搭配 relight LoRA 讓陰影與顏色貼近環境。子圖會處理條件設定、打光引導以及前景/背景合成,並提供簡單的強度滑桿與合併選項,讓你在不碰內部細節的情況下平衡「風格」與「光線」。圖內的說明包含中文提示詞——請保留那些字元不變,並在其後追加你的編輯指令,以微調光線方向、氛圍、色溫或輪廓光。對本地使用者而言,請確認任何被引用的文字編碼器檔案(例如 qwen_2.5_vl_7b_fp8_scaled.safetensors)已備妥,讓子圖能如預期編碼提示詞。
您提供的內容
- 正在讀取工作流程
在 ComfyUI 中執行。 此工作流程無法在此頁面上執行。請在已載入所有內容的 Comfy Cloud 中開啟,或下載到您自己的 ComfyUI。
在 Cloud 中試用工作流程內部
節點圖的唯讀預覽。請在 Comfy Cloud 中開啟,或下載後編輯節點。
從程式碼使用此工作流程
可行時會根據工作流程圖和輸入內容產生;否則會顯示儲存的範例。執行可能產生費用的程式碼前,請檢查認證資訊和端點。
What you need
- Runs on
- Comfy Cloud
- 金鑰
- COMFY_API_KEY
需要付費 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({
"5": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "ComfyUI-light_migration",
"images": [
"471:118",
0
]
},
"_meta": {
"title": "Save Image"
}
},
"6": {
"class_type": "LoadImage",
"inputs": {
"image": "a7e2d3406be6190f8099c606d3936d61bdc06010c14f634c236cebb7809fd28c.png"
},
"_meta": {
"title": "Load Lighting Image"
}
},
"7": {
"class_type": "LoadImage",
"inputs": {
"image": "b4ca9aac7cc22d41886f3257b3efe2394ff31af127ba22173d0615a845b91e88.PNG"
},
"_meta": {
"title": "Load Subject Image"
}
},
"471:110": {
"class_type": "CFGNorm",
"inputs": {
"model": [
"471:115",
0
],
"pre_cfg": False,
"strength": 1
},
"_meta": {
"title": "CFGNorm"
}
},
"471:111": {
"class_type": "VAELoader",
"inputs": {
"vae_name": "qwen_image_vae.safetensors"
},
"_meta": {
"title": "Load VAE"
}
},
"471:112": {
"class_type": "CLIPLoader",
"inputs": {
"clip_name": "qwen_2.5_vl_7b_fp8_scaled.safetensors",
"device": "default",
"type": "qwen_image"
},
"_meta": {
"title": "Load CLIP"
}
},
"471:113": {
"class_type": "UNETLoader",
"inputs": {
"unet_name": "qwen_image_edit_2509_fp8_e4m3fn.safetensors",
"weight_dtype": "default"
},
"_meta": {
"title": "Load Diffusion Model"
}
},
"471:114": {
"class_type": "TextEncodeQwenImageEditPlus",
"inputs": {
"clip": [
"471:112",
0
],
"image1": [
"471:120",
0
],
"image3": [
"6",
0
],
"prompt": "",
"vae": [
"471:111",
0
]
},
"_meta": {
"title": "Text Encode Qwen Image Edit Plus"
}
},
"471:115": {
"class_type": "ModelSamplingAuraFlow",
"inputs": {
"model": [
"471:440",
0
],
"sampling": "flow",
"shift": 3.1
},
"_meta": {
"title": "ModelSamplingAuraFlow"
}
},
"471:116": {
"class_type": "TextEncodeQwenImageEditPlus",
"inputs": {
"clip": [
"471:112",
0
],
"image1": [
"471:120",
0
],
"image3": [
"6",
0
],
"prompt": "参考色调,移除图1原有的光照并参考图2的光照和色调对图1重新照明, maintain canny edge of interior glass orb.",
"vae": [
"471:111",
0
]
},
"_meta": {
"title": "Text Encode Qwen Image Edit Plus"
}
},
"471:117": {
"class_type": "VAEEncode",
"inputs": {
"pixels": [
"471:120",
0
],
"vae": [
"471:111",
0
]
},
"_meta": {
"title": "VAE Encode"
}
},
"471:118": {
"class_type": "VAEDecode",
"inputs": {
"samples": [
"471:121",
0
],
"vae": [
"471:111",
0
]
},
"_meta": {
"title": "VAE Decode"
}
},
"471:119": {
"class_type": "LoraLoaderModelOnly",
"inputs": {
"lora_name": "Qwen-Image-Edit-2509-Lightning-4steps-V1.0-bf16.safetensors",
"model": [
"471:472",
0
],
"strength_model": 1
},
"_meta": {
"title": "Load LoRA"
}
},
"471:120": {
"class_type": "FluxKontextImageScale",
"inputs": {
"image": [
"7",
0
]
},
"_meta": {
"title": "FluxKontextImageScale"
}
},
"471:121": {
"class_type": "KSampler",
"inputs": {
"cfg": [
"471:442",
0
],
"denoise": 1,
"latent_image": [
"471:117",
0
],
"model": [
"471:110",
0
],
"negative": [
"471:114",
0
],
"positive": [
"471:116",
0
],
"sampler_name": "euler",
"scheduler": "simple",
"seed": 1066483521452192,
"steps": [
"471:441",
0
]
},
"_meta": {
"title": "KSampler"
}
},
"471:436": {
"class_type": "PrimitiveInt",
"inputs": {
"value": 4
},
"_meta": {
"title": "Stpes"
}
},
"471:437": {
"class_type": "PrimitiveFloat",
"inputs": {
"value": 1
},
"_meta": {
"title": "CFG"
}
},
"471:438": {
"class_type": "PrimitiveInt",
"inputs": {
"value": 20
},
"_meta": {
"title": "Steps"
}
},
"471:439": {
"class_type": "PrimitiveFloat",
"inputs": {
"value": 4
},
"_meta": {
"title": "CFG"
}
},
"471:440": {
"class_type": "ComfySwitchNode",
"inputs": {
"on_false": [
"471:473",
0
],
"on_true": [
"471:119",
0
],
"switch": [
"471:443",
0
]
},
"_meta": {
"title": "Switch (Model)"
}
},
"471:441": {
"class_type": "ComfySwitchNode",
"inputs": {
"on_false": [
"471:438",
0
],
"on_true": [
"471:436",
0
],
"switch": [
"471:443",
0
]
},
"_meta": {
"title": "Switch (Steps)"
}
},
"471:442": {
"class_type": "ComfySwitchNode",
"inputs": {
"on_false": [
"471:439",
0
],
"on_true": [
"471:437",
0
],
"switch": [
"471:443",
0
]
},
"_meta": {
"title": "Switch (CFG)"
}
},
"471:443": {
"class_type": "PrimitiveBoolean",
"inputs": {
"value": False
},
"_meta": {
"title": "Enable Lightning LoRA"
}
},
"471:472": {
"class_type": "LoraLoaderModelOnly",
"inputs": {
"lora_name": "Qwen-Image-Edit-2509-Light-Migration.safetensors",
"model": [
"471:113",
0
],
"strength_model": 1
},
"_meta": {
"title": "Load LoRA"
}
},
"471:473": {
"class_type": "LoraLoaderModelOnly",
"inputs": {
"lora_name": "ltx-2.3-22b-ic-lora-refocus.safetensors",
"model": [
"471:472",
0
],
"strength_model": 1
},
"_meta": {
"title": "Load LoRA"
}
}
})
# run() also passes api_key to the partner nodes in this workflow.
job = client.run(workflow, api_key=api_key)問答
要。請完整保留 Note/MarkdownNote 中提供的中文字符,並把額外的影像編輯指令接在它們後面。移除或修改可能會改變條件設定,導致結果不穩定。
此工作流程以插畫角色為主(使用 illustration LoRA)。你可以嘗試照片,但建議降低 illustration LoRA 強度,並更依賴 relight 強度來避免過度風格化。
降低 relight LoRA 強度,並精修你追加的提示詞指令(例如更柔和的主光、較中性的色溫),同時確認環境底圖沒有過度飽和或高光剪裁。通常少量文字調整與平衡 LoRA 權重就能改善。
帶透明通道的 PNG(乾淨的輪廓)合成效果最好。若來源沒有 alpha,建議先把角色遮罩處理好再匯入,避免邊緣光暈或背景滲色。
相關工作流程
- Qwen-Image-Edit
Change a material
- Qwen-Image-Edit
See your subject from a new angle
- Qwen-Image-Edit
Match lighting from a reference
- Qwen-Image-Edit, Wan2.2
1個圖像輸入分割堆疊 - Qwen多角度 + Wan 2.2
- Flux.2 Dev, Flux.2 Klein, GPT-Image-1.5, Grok, Nano Banana Pro, Qwen-Image-Edit, Seedream
1個輸入與多個編輯模型對比
- Qwen-Image-Edit
Image Editing (New)
- Qwen-Image-Edit
Qwen Image Edit 2511 - 材質替換
- Qwen-Image-Edit
Qwen Image Edit 插畫版 v 1.0
- Qwen-Image-Edit
Qwen圖像編輯
- Qwen-Image-Edit
SYSTMS ACTION:QWEN IMAGE EDIT 2511
- Qwen-Image-Edit
一鍵多角度場景
- Qwen-Image-Edit
一鍵多角度角色