照片重打光
使用 Qwen-Image-Edit 和 LoRA 重新打光圖片。
下載工作流程在 Cloud 中試用 API 文件
工作流程內部
來源範本的唯讀預覽。請在 Cloud 中開啟,以探索節點並進行變更。
從您的程式碼呼叫此模型
以下請求使用與 Playground 相同的已準備節點圖和設定。每次提交都可能啟動付費執行;若提交結果不明,請勿自動重試提交。
1 取得 API 金鑰 ↗
What you need
- Runs on
- Comfy Cloud
- 金鑰
- COMFY_API_KEY
- 您的檔案
- 由程式碼透過其 URL 上傳
需要付費 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({
"11": {
"class_type": "LoadImage",
"inputs": {
"image": "UPLOADED_image_FILENAME"
},
"_meta": {
"title": "Load Image"
}
},
"12": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "ComfyUI",
"images": [
"10:8",
0
]
},
"_meta": {
"title": "Save Image"
}
},
"14": {
"class_type": "StringConcatenate",
"inputs": {
"delimiter": "",
"string_a": "重新照明,",
"string_b": [
"15",
0
]
},
"_meta": {
"title": "LoRA trigger word"
}
},
"15": {
"class_type": "PrimitiveStringMultiline",
"inputs": {
"value": "relight the image as a calm winter evening after sunset: the windows now show a deep blue dusk outside, and the room is lit from inside by warm low lamps placed beside the sofa and on the console table, with a soft amber glow pooling on the linen cushions, the travertine table and the oak floor. Keep warm candle-like highlights on the terracotta and ceramic pieces, gentle warm falloff across the plaster walls, cool blue light spilling faintly through the window panes, and long soft shadows stretching away from each lamp. Keep every object, material and the room layout exactly the same; only the lighting, colour temperature and shadows change, giving a cosy, intimate, lived-in mood."
},
"_meta": {
"title": "Prompt"
}
},
"10:110": {
"class_type": "TextEncodeQwenImageEditPlus",
"inputs": {
"clip": [
"10:38",
0
],
"image1": [
"10:117",
0
],
"prompt": "",
"vae": [
"10:39",
0
]
},
"_meta": {
"title": "Text Encode Qwen Image Edit Plus"
}
},
"10:111": {
"class_type": "TextEncodeQwenImageEditPlus",
"inputs": {
"clip": [
"10:38",
0
],
"image1": [
"10:117",
0
],
"prompt": [
"14",
0
],
"vae": [
"10:39",
0
]
},
"_meta": {
"title": "Text Encode Qwen Image Edit Plus"
}
},
"10:117": {
"class_type": "FluxKontextImageScale",
"inputs": {
"image": [
"11",
0
]
},
"_meta": {
"title": "FluxKontextImageScale"
}
},
"10:118": {
"class_type": "LoraLoaderModelOnly",
"inputs": {
"lora_name": "Qwen-Image-Edit-2509-Relight.safetensors",
"model": [
"10:89",
0
],
"strength_model": 1
},
"_meta": {
"title": "Load LoRA"
}
},
"10:3": {
"class_type": "KSampler",
"inputs": {
"cfg": 1,
"denoise": 1,
"latent_image": [
"10:88",
0
],
"model": [
"10:75",
0
],
"negative": [
"10:110",
0
],
"positive": [
"10:111",
0
],
"sampler_name": "euler",
"scheduler": "simple",
"seed": 1118877715456453,
"steps": 4
},
"_meta": {
"title": "KSampler"
}
},
"10:37": {
"class_type": "UNETLoader",
"inputs": {
"unet_name": "qwen_image_edit_2509_fp8_e4m3fn.safetensors",
"weight_dtype": "default"
},
"_meta": {
"title": "Load Diffusion Model"
}
},
"10:38": {
"class_type": "CLIPLoader",
"inputs": {
"clip_name": "qwen_2.5_vl_7b_fp8_scaled.safetensors",
"device": "default",
"type": "qwen_image"
},
"_meta": {
"title": "Load CLIP"
}
},
"10:39": {
"class_type": "VAELoader",
"inputs": {
"vae_name": "qwen_image_vae.safetensors"
},
"_meta": {
"title": "Load VAE"
}
},
"10:66": {
"class_type": "ModelSamplingAuraFlow",
"inputs": {
"model": [
"10:118",
0
],
"sampling": "flow",
"shift": 3
},
"_meta": {
"title": "ModelSamplingAuraFlow"
}
},
"10:75": {
"class_type": "CFGNorm",
"inputs": {
"model": [
"10:66",
0
],
"pre_cfg": False,
"strength": 1
},
"_meta": {
"title": "CFGNorm"
}
},
"10:8": {
"class_type": "VAEDecode",
"inputs": {
"samples": [
"10:3",
0
],
"vae": [
"10:39",
0
]
},
"_meta": {
"title": "VAE Decode"
}
},
"10:88": {
"class_type": "VAEEncode",
"inputs": {
"pixels": [
"10:117",
0
],
"vae": [
"10:39",
0
]
},
"_meta": {
"title": "VAE Encode"
}
},
"10:89": {
"class_type": "LoraLoaderModelOnly",
"inputs": {
"lora_name": "Qwen-Image-Edit-2509-Lightning-4steps-V1.0-bf16.safetensors",
"model": [
"10:37",
0
],
"strength_model": 1
},
"_meta": {
"title": "Load LoRA"
}
}
})
workflow.set_input("11", "image", client.assets.from_url("https://comfy.org/catalog-media/00a9f99c-a979-4359-b38e-fd61637c1023/42048864-3190-4865-8b71-19f186e98089"))
# 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("12"):
output.to_file(output.name)試試範例
關於此工作流程
圖像重光工作流程,運用先進 AI 技術強化與調整圖像光線。核心為 Qwen-Image-Edit 模型,擅長精細圖像編輯,並支援 LoRA(低秩適應)以針對特定任務微調表現。流程起始於 LoadImage 載入圖片,作為重光處理的輸入。Qwen-Image-Edit 模型處理圖像,調整光線達到預期效果,特別適合攝影師與數位藝術家用於增強氛圍或凸顯主體。最後 SaveImage 輸出重光後圖像,適用於各種應用。
技術上,流程允許用戶透過 MarkdownNote 與 StringConcatenate 節點輸入特定光線參數,介面友善,方便自訂重光效果。PrimitiveStringMultiline 節點可處理複雜文字輸入,讓流程能接受詳細指令與設定。此流程不僅功能強大,也高度彈性,適合各種圖像編輯需求。
問答
Qwen-Image-Edit 是專為進階圖像編輯設計的 AI 模型,支援 LoRA 微調。
可以,流程允許用 MarkdownNote 與 StringConcatenate 節點輸入自訂光線參數。
適合。流程設計友善,無論新手或進階用戶都能輕鬆上手。
支援 JPEG、PNG 等常見圖像格式。
相關工作流程
- 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
一鍵多角度角色