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.

template_character_portrait_relighting.json
Fetching workflow JSON…

Run it from TypeScript or Python with the Comfy SDK. The same code targets Comfy Cloud or a ComfyUI you host yourself — only the base URL changes.

// Install (beta)
npm i @comfyorg/sdk

// Run "Character Portrait Relighting" (TypeScript)
import { Comfy } from "@comfyorg/sdk";

const client = new Comfy({ apiKey: "comfyui-..." });

// This workflow, exported in API format (see note below)
const wf = await client.workflows.fromFile("template_character_portrait_relighting_api.json");

const asset = client.assets.fromFile("input.png");
wf.setInput("124", "image", asset); // LoadImage

const job = await client.run(wf);
await job.getOutputs("138")[0].toFile("output.png"); // SaveImage

The SDK takes a workflow in API format: open this workflow in ComfyUI and use File → Export Workflow (API).

Comfy Cloud API access requires a plan with an API key.

FAQ

Frequently Asked Questions

View all workflows
Showing 30 of 30 templates