Character Portrait Relighting

Character Portrait Relighting is a compact ComfyUI workflow that takes a single portrait and renders it under different, cinematic lighting conditions while keeping the character’s identity consistent. It uses three nodes end-to-end: LoadImage to ingest your source portrait, GeminiImage2Node to perform image-to-image relighting through an external API, and SaveImage to write the results. The workflow is configured to run the Nano Banana Pro model inside GeminiImage2Node, which is well-suited for photoreal portrait work.

Technically, the relighting happens by conditioning the generation on your uploaded image plus a text prompt that describes the lighting setup you want (for example: "soft key light from camera-left, warm rim light, low-fill, filmic contrast"). GeminiImage2Node sends the image and prompt to the API, returning a relit image that preserves pose and facial structure based on the input. You can keep identity tight by favoring higher image-to-image preservation (often exposed as a strength or guidance setting). To produce multiple looks from the same portrait, duplicate GeminiImage2Node (each with a different lighting prompt) and route them all from the same LoadImage, then save each result with its own label via SaveImage.

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/a9241caf70ac.json
Fetching 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 "Character Portrait Relighting" (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("template_character_portrait_relighting_api.json")

asset = client.assets.from_file("input.png")
wf.set_input("124", "image", asset)  # LoadImage

job = client.run(wf)
for output in job.get_outputs("138"):  # 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

Frequently Asked Questions

View all workflows
Character
Cinematic
Image to Video
Lip Sync
Multiple Angles
Portrait
Style Reference
Style Transfer
Text to Video
Video Generation
Video
Showing 30 of 30 templates