角色肖像光線遷移
上傳角色肖像和參考光線圖像。產生應用參考光線並保持角色一致性的圖像。
下載工作流程在 Cloud 中試用 API 文件
關於
「角色肖像光線遷移」工作流程,能將參考光線風格無縫整合至角色肖像,同時維持角色原有特徵。流程運用 Qwen-Image-Edit 模型,讓使用者上傳角色肖像與展示目標光線的參考圖,經處理後產生套用新光線的角色圖像,確保一致性與真實感。流程包含『LoadImage』匯入圖像、『SaveImage』匯出結果,以及專用節點進行光線轉換。
技術上,流程運用 Qwen 模型的圖像編輯與轉換能力。先用『LoadImage』載入角色肖像與參考光線圖,Qwen-Image-Edit 模型分析參考圖的光線條件並套用至角色肖像,確保光線自然且與角色特徵協調。最後用『SaveImage』儲存新生成圖像。此技術特別適合藝術家與設計師,在不改變角色本質下,模擬不同光線情境。
您提供的內容
- 正在讀取工作流程
在 ComfyUI 中執行。 此工作流程無法在此頁面上執行。請在已載入所有內容的 Comfy Cloud 中開啟,或下載到您自己的 ComfyUI。
在 Cloud 中試用範例
工作流程內部
節點圖的唯讀預覽。請在 Comfy Cloud 中開啟,或下載後編輯節點。
從程式碼使用此工作流程
可行時會根據工作流程圖和輸入內容產生;否則會顯示儲存的範例。執行可能產生費用的程式碼前,請檢查認證資訊和端點。
1 取得 API 金鑰 ↗
What you need
- Runs on
- Comfy Cloud
- 金鑰
- COMFY_API_KEY
需要付費 Cloud 方案與點數。
下載 API JSONAPI 文件 ↗
# 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": [
"1:8",
0
]
},
"_meta": {
"title": "Save Image"
}
},
"6": {
"class_type": "LoadImage",
"inputs": {
"image": "woman_with_sunbeam.jpg"
},
"_meta": {
"title": "Load Lighting Image"
}
},
"7": {
"class_type": "LoadImage",
"inputs": {
"image": "women_with_blue_orb.jpg"
},
"_meta": {
"title": "Load Subject Image"
}
},
"1:101": {
"class_type": "LoraLoaderModelOnly",
"inputs": {
"lora_name": "Qwen-Image-Edit-2509-Light-Migration.safetensors",
"model": [
"1:89",
0
],
"strength_model": 1
},
"_meta": {
"title": "Load LoRA"
}
},
"1:102": {
"class_type": "TextEncodeQwenImageEditPlus",
"inputs": {
"clip": [
"1:38",
0
],
"image1": [
"1:104",
0
],
"image2": [
"1:105",
0
],
"prompt": "参考色调,移除图1原有的光照并参考图2的光照和色调对图1重新照明, maintain canny edge of interior glass orb.",
"vae": [
"1:39",
0
]
},
"_meta": {
"title": "Text Encode Qwen Image Edit Plus"
}
},
"1:103": {
"class_type": "TextEncodeQwenImageEditPlus",
"inputs": {
"clip": [
"1:38",
0
],
"image1": [
"1:104",
0
],
"image2": [
"1:105",
0
],
"prompt": "",
"vae": [
"1:39",
0
]
},
"_meta": {
"title": "Text Encode Qwen Image Edit Plus"
}
},
"1:104": {
"class_type": "ImageScaleToTotalPixels",
"inputs": {
"image": [
"7",
0
],
"megapixels": 1,
"resolution_steps": 1,
"upscale_method": "lanczos"
},
"_meta": {
"title": "Scale Image to Total Pixels"
}
},
"1:105": {
"class_type": "ImageScaleToTotalPixels",
"inputs": {
"image": [
"6",
0
],
"megapixels": 1,
"resolution_steps": 1,
"upscale_method": "nearest-exact"
},
"_meta": {
"title": "Scale Image to Total Pixels"
}
},
"1:108": {
"class_type": "RepeatLatentBatch",
"inputs": {
"amount": 1,
"samples": [
"1:88",
0
]
},
"_meta": {
"title": "Repeat Latent Batch"
}
},
"1:3": {
"class_type": "KSampler",
"inputs": {
"cfg": 1,
"denoise": 1,
"latent_image": [
"1:108",
0
],
"model": [
"1:75",
0
],
"negative": [
"1:103",
0
],
"positive": [
"1:102",
0
],
"sampler_name": "euler",
"scheduler": "simple",
"seed": 1047952688565236,
"steps": 8
},
"_meta": {
"title": "KSampler"
}
},
"1:37": {
"class_type": "UNETLoader",
"inputs": {
"unet_name": "qwen_image_edit_2509_fp8_e4m3fn.safetensors",
"weight_dtype": "default"
},
"_meta": {
"title": "Load Diffusion Model"
}
},
"1:38": {
"class_type": "CLIPLoader",
"inputs": {
"clip_name": "qwen_2.5_vl_7b_fp8_scaled.safetensors",
"device": "default",
"type": "qwen_image"
},
"_meta": {
"title": "Load CLIP"
}
},
"1:39": {
"class_type": "VAELoader",
"inputs": {
"vae_name": "qwen_image_vae.safetensors"
},
"_meta": {
"title": "Load VAE"
}
},
"1:66": {
"class_type": "ModelSamplingAuraFlow",
"inputs": {
"model": [
"1:101",
0
],
"sampling": "flow",
"shift": 3
},
"_meta": {
"title": "ModelSamplingAuraFlow"
}
},
"1:75": {
"class_type": "CFGNorm",
"inputs": {
"model": [
"1:66",
0
],
"pre_cfg": False,
"strength": 1
},
"_meta": {
"title": "CFGNorm"
}
},
"1:8": {
"class_type": "VAEDecode",
"inputs": {
"samples": [
"1:3",
0
],
"vae": [
"1:39",
0
]
},
"_meta": {
"title": "VAE Decode"
}
},
"1:88": {
"class_type": "VAEEncode",
"inputs": {
"pixels": [
"1:104",
0
],
"vae": [
"1:39",
0
]
},
"_meta": {
"title": "VAE Encode"
}
},
"1:89": {
"class_type": "LoraLoaderModelOnly",
"inputs": {
"lora_name": "Qwen-Image-Edit-2509-Lightning-8steps-V1.0-bf16.safetensors",
"model": [
"1:37",
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)問答
可以,只要圖像能清楚展現目標光線條件,模型就能分析並套用至角色肖像。
不會。流程設計會保留角色原有特徵,只改變光線,確保一致性與真實感。
『LoadImage』節點支援 JPEG、PNG、BMP 等常見格式。
目前流程會直接套用參考圖的光線。如需自訂強度,建議後續再進行編輯。
相關工作流程
- Qwen, Qwen-Image
Qwen Image 2512
- 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