The 'Portrait Relight' workflow in ComfyUI is designed to enhance your images by altering their lighting based on a reference image. This workflow utilizes the Qwen-Image-Edit model to intelligently adjust the lighting of a target image, making it appear as if it was lit under the conditions of the reference image. The process involves several key nodes, including the LoadImage node for importing images, and the SaveImage node for exporting the final result. The workflow is particularly useful for photographers and digital artists looking to achieve consistent lighting across different images or to experiment with creative lighting effects without the need for physical lighting equipment.
API
Use this workflow from code
Every Comfy workflow is a JSON graph. The payload below is this workflow, exactly as ComfyUI runs it — fetch it from the URL, keep it in version control, or load it in ComfyUI and run it node by node.
GET https://comfy.org/workflows/download/9e033fb4e06a.jsonFetching workflow JSON…
Run it from Python or TypeScript with the Comfy SDK. The same code targets Comfy Cloud or a ComfyUI you host yourself — only the base URL changes.
# Install (beta)
pip install comfy-sdk # Python
npm i @comfyorg/sdk # TypeScript
# Run "Portrait Relight" (Python)
from comfy_sdk import Comfy
client = Comfy(api_key="comfyui-...")
# This workflow, exported in API format (see note below)
wf = client.workflows.from_file("templates_rob_portrait_light_migration.app_api.json")
asset = client.assets.from_file("input.png")
wf.set_input("6", "image", asset) # LoadImage
job = client.run(wf)
for output in job.get_outputs("5"): # SaveImage
output.to_file(output.name)The SDK takes a workflow in API format: open this workflow in ComfyUI and use File → Export Workflow (API). API access requires a Comfy Cloud plan with an API key. SDK docs · Get an API key
FAQ
















