Image-to-Image Prompt Expander
Edit a photo with words, without losing the photo
- image
- positive_prompt
- negative_prompt
- image_description
- status
Image-to-image editing has a classic failure mode: you describe an edit in words, and the model cheerfully invents a completely different picture. The fix that actually works is to make the prompt describe the edited scene based on what's actually in the source image - and that's the job this node does. Feed it a starting image and a change request ("change dress to red, add sunset lighting"), and it writes a prompt for the transformed image in the dialect of your target platform, anchored to what the vision model could see.
It's one of the five nodes in Eric's Prompt Enhancers pack, and it slots into workflows where you want edits without fighting ControlNet. It's the natural companion to edit-capable models like Qwen Edit and Wan Edit, and it also works for plain SDXL or Flux img2img.
How it works
Two LLM passes, same as the pack's other image nodes. First, a vision model captions your image - describing the subject, setting, lighting, colors as they are. Then the expansion pass combines that caption with your change_request and writes a prompt for the edited result: the source stays recognizable, your requested change gets the emphasis. The second pass is formatted for your chosen target_platform, so you get a natural-language paragraph for Flux and a tag-style prompt for SDXL. Six platforms are available: flux, sd_xl, wan22, hunyuan_image, qwen_image, and qwen_image_edit.
The aesthetic dropdowns - art_style, lighting_type, composition, color_palette, mood, detail_level - all default to auto, which is right. They're there for when you want "photorealistic, golden hour, rule of thirds" enforced, but leaving them alone lets the vision caption drive the result.
The inputs that matter
- image - the source, required. What the vision model sees becomes the skeleton of the prompt.
- change_request - the actual instruction. This is the input you'll be tweaking every run, so be specific: "change dress to red, add sunset lighting" beats "make it nicer."
- target_platform - match it to the model downstream, or you'll get the right content in the wrong dialect.
- temperature - 0.6 default, lower if edits drift from the source.
Two backend pairs sit under these: vision_backend/vision_endpoint for the captioning pass and expansion_backend/expansion_endpoint for the writing pass. Both default to lm_studio at http://localhost:1234/v1, and you can keep them on the same server - but the vision model must actually support images (a plain text Llama 3 will not caption anything).
The outputs
- positive_prompt - wire this into your img2img conditioning.
- negative_prompt - auto-generated per platform.
- image_description - the raw source caption. Check this when results miss; if it's empty, the vision pass failed.
- status - the usual success/error report, plus the save path if you enable
save_to_file.
The gotcha: vision, again
This node's quality hinges on that first captioning pass, and it's the fragile part. If you keep use_vision_model on (default) but your LM Studio slot is holding a text-only model, you'll get an empty description and a prompt that's guessing about your image. Either load a vision-capable model, or switch vision_backend to qwen3_vl - the pack's self-contained option, which needs no API server but requires the optional dependencies and downloads Qwen3-VL on first run:
pip install transformers>=4.42.0 accelerate>=0.30.0 huggingface_hub>=0.23.0 bitsandbytes>=0.43.0
Install
Shared with the whole pack: ComfyUI Manager → search "Local LLM Prompt Enhancer", or clone https://github.com/EricRollei/Local_LLM_Prompt_Enhancer.git into ComfyUI/custom_nodes/, run pip install -r requirements.txt, restart. The core requirements are just requests - ComfyUI already ships the rest - and you still need an LLM backend running (LM Studio is the README's recommendation; Ollama works at http://localhost:11434). For the version where this node shines - editing a real image into something coherent - the vision model is not optional, so budget for it.
Inputs (19)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| change_request | STRING | change dress to red, add sunset lighting | — |
| target_platform | COMBO | flux | 6 options: flux, sd_xl, wan22, hunyuan_image, qwen_image, qwen_image_edit |
| use_vision_model | BOOLEAN | true | — |
| vision_backend | COMBO | lm_studio | lm_studio: Uses currently loaded model ollama: Uses currently loaded model qwen3_vl: Auto-detects local Qwen3-VL model |
| vision_endpoint | STRING | http://localhost:1234/v1 | API endpoint or custom model path (qwen3_vl) |
| expansion_backend | COMBO | lm_studio | lm_studio: Uses currently loaded model ollama: Uses currently loaded model qwen3_vl: Auto-detects local Qwen3-VL model |
| expansion_endpoint | STRING | http://localhost:1234/v1 | API endpoint or custom model path (qwen3_vl) |
| temperature | FLOAT | 0.60.1–2 | — |
| art_style | COMBO | auto | 11 options: auto, none, photorealistic, digital art, oil painting, watercolor, +5 |
| lighting_type | COMBO | auto | 10 options: auto, none, natural lighting, studio lighting, soft lighting, dramatic lighting, +4 |
| composition | COMBO | auto | 8 options: auto, none, rule of thirds, centered, symmetrical, golden ratio, +2 |
| color_palette | COMBO | auto | 9 options: auto, none, vibrant, muted, monochrome, warm, +3 |
| mood | COMBO | auto | 9 options: auto, none, serene, dramatic, mysterious, cheerful, +3 |
| detail_level | COMBO | auto | 6 options: auto, standard, highly detailed, intricate, simplified, minimalist |
| positive_keywords | STRING | — | |
| negative_keywords | STRING | — | |
| save_to_file | BOOLEAN | false | — |
| filename_base | STRING | img2img_prompt | — |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| positive_prompt | STRING | — |
| negative_prompt | STRING | — |
| image_description | STRING | — |
| status | STRING | — |