Nodes/Eric's Prompt Enhancers for ComfyUI/Image-to-Image Prompt Expander
ComfyUI Node

Image-to-Image Prompt Expander

Edit a photo with words, without losing the photo

By EricRollei·Created 11 months ago·Updated 9 months ago· 45
Image-to-Image Prompt Expander
  • image
  • positive_prompt
  • negative_prompt
  • image_description
  • status
change_requestchange dress to red, add sunset lighting
target_platformflux
use_vision_modeltrue
vision_backendlm_studio
vision_endpointhttp://localhost:1234/v1
expansion_backendlm_studio
expansion_endpointhttp://localhost:1234/v1
temperature0.6
art_styleauto
lighting_typeauto
compositionauto
color_paletteauto
moodauto
detail_levelauto
positive_keywords
negative_keywords
save_to_filefalse
filename_baseimg2img_prompt

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.

CategoryEric Prompt Enhancers

Inputs (19)

NameTypeDefaultDescription
imageIMAGE
change_requestSTRINGchange dress to red, add sunset lighting
target_platformCOMBOflux6 options: flux, sd_xl, wan22, hunyuan_image, qwen_image, qwen_image_edit
use_vision_modelBOOLEANtrue
vision_backendCOMBOlm_studiolm_studio: Uses currently loaded model ollama: Uses currently loaded model qwen3_vl: Auto-detects local Qwen3-VL model
vision_endpointSTRINGhttp://localhost:1234/v1API endpoint or custom model path (qwen3_vl)
expansion_backendCOMBOlm_studiolm_studio: Uses currently loaded model ollama: Uses currently loaded model qwen3_vl: Auto-detects local Qwen3-VL model
expansion_endpointSTRINGhttp://localhost:1234/v1API endpoint or custom model path (qwen3_vl)
temperatureFLOAT0.60.1–2
art_styleCOMBOauto11 options: auto, none, photorealistic, digital art, oil painting, watercolor, +5
lighting_typeCOMBOauto10 options: auto, none, natural lighting, studio lighting, soft lighting, dramatic lighting, +4
compositionCOMBOauto8 options: auto, none, rule of thirds, centered, symmetrical, golden ratio, +2
color_paletteCOMBOauto9 options: auto, none, vibrant, muted, monochrome, warm, +3
moodCOMBOauto9 options: auto, none, serene, dramatic, mysterious, cheerful, +3
detail_levelCOMBOauto6 options: auto, standard, highly detailed, intricate, simplified, minimalist
positive_keywordsSTRING
negative_keywordsSTRING
save_to_fileBOOLEANfalse
filename_baseSTRINGimg2img_prompt

Outputs (4)

NameTypeDescription
positive_promptSTRING
negative_promptSTRING
image_descriptionSTRING
statusSTRING