Nodes/Eric Qwen-Edit & Qwen-Image Nodes/Eric Qwen ControlNet Prompt Rewriter (Vision)
ComfyUI Node

Eric Qwen ControlNet Prompt Rewriter (Vision)

Let a vision LLM write your Qwen ControlNet prompt — structure comes from CN, everything else from the words

By EricRollei·Created 6 months ago·Updated 4 months ago· 20
Eric Qwen ControlNet Prompt Rewriter (Vision)
  • image
  • prompt
  • cn_type_index
creative_direction
cn_typeSoftline
api_urlhttp://localhost:1234/v1
modelqwen3-vl
languageEnglish
temperature0.7
max_tokens2048
custom_instructions
passthroughfalse
image_max_side1024

Here's the deal with ControlNet-guided generation: the ControlNet only gives you structure. Canny gives you edges, Depth gives you layout, Pose gives you a skeleton - but the model still needs a prompt that describes everything else, and a bare "cyberpunk warrior" is nowhere near enough detail to render a full scene. Eric Qwen ControlNet Prompt Rewriter closes that gap by sending your reference image and a one-line intent to a vision-language model, which writes the full descriptive prompt for you.

It's the ControlNet-specific sibling of the pack's Eric Qwen Prompt Rewriter, and the key difference is CN-awareness: the VLM is told which preprocessor is being used (soft contours vs skeleton vs depth map vs hard edges) so it knows what the structure already pins down and what it must describe in words. The docs' framing is exactly right: because the CN provides structure, not appearance, the prompt must describe everything the diffusion model needs to render.

How it works

The node talks to any OpenAI-compatible vision API - Ollama, LM Studio, DeepSeek, OpenAI - via a normal HTTP call. It sends the reference image (downscaled to image_max_side, default 1024) plus your creative_direction and cn_type, and the VLM returns a 200–400 word scene description. No model runs on your GPU; this is the API-wrapper pattern from the wider ComfyUI ecosystem.

Security note, straight from the KB: an API node that carries a credential and phones home is exactly the shape of the thing that got ComfyUI a malware scare once. This pack is on the up-and-up - keys come from environment variables or an api_keys.ini file that's git-ignored, never from the workflow JSON - but the pattern deserves your scrutiny on any node pack.

Inputs that matter

  • image - the reference the VLM analyzes.
  • creative_direction - your one-liner: "cyberpunk warrior in neon-lit alley", "same scene but underwater". The VLM expands it.
  • cn_type - Softline, DWPose, Depth, CannyEdge, or PyraCanny. This is what makes the rewrite CN-aware.
  • api_url / model - default http://localhost:1234/v1 (LM Studio) with qwen3-vl. Swap to Ollama's http://localhost:11434/v1 or OpenAI's endpoint; the model must accept images.
  • passthrough - skip the VLM and return creative_direction untouched, for A/B testing the rewriter's value.
  • temperature (0.7), max_tokens (2048), custom_instructions, language (English/Chinese), image_max_side - the quality and budget knobs.

Outputs: prompt (STRING) and cn_type_index (INT) - a 1–5 index (Softline=1 … PyraCanny=5) that can drive a downstream switch node to auto-select the matching preprocessor.

Wiring it

prompt goes into a generation node like UltraGen CN; cn_type_index can drive a node-switch that picks the preprocessor so the whole pipeline stays in sync.

Installing it

ComfyUI Manager → "Eric Qwen-Edit", or:

cd ComfyUI/custom_nodes
git clone https://github.com/EricRollei/Eric_Qwen_Edit_Experiments.git

Restart. The node itself needs no model - just a reachable vision API. For the full workflow you'll also want a Qwen-Image generation model (Qwen/Qwen-Image-2512) and optionally the InstantX ControlNet Union (~2.3 GB).

Troubleshooting

  • Empty prompt or error - check the API is reachable and the model name is right for your server. LM Studio uses localhost:1234, Ollama localhost:11434.
  • Model errors on the image - you picked a text-only model. The tooltip lists vision-capable ones (qwen3-vl, qwen2.5-vl:7b, llava, gpt-4o-mini).
  • Keys not picked up - env vars beat the ini: DEEPSEEK_API_KEY, OPENAI_API_KEY, or the fallback ERIC_QWEN_API_KEY. Remember this pack stores keys outside workflows on purpose.
CategoryEric Qwen-Image

Inputs (11)

NameTypeDefaultDescription
imageIMAGEReference image for the VLM to analyse.
creative_directionSTRINGDescribe how the new image should differ from the reference. Can be brief — the VLM will expand it into a full descriptive prompt. Example: 'cyberpunk warrior in neon-lit alley' Example: 'oil painting in Rembrandt style' Example: 'same scene but underwater'
cn_typeCOMBOSoftlineWhich ControlNet preprocessor will be used. Informs the VLM about what structural info is preserved vs what must be described: • Softline — soft contours (idx 1) • DWPose — body skeleton only (idx 2) • Depth — spatial depth layout (idx 3) • CannyEdge — hard edges/outlines (idx 4) • PyraCanny — multi-scale edges (idx 5)
api_urlSTRINGhttp://localhost:1234/v1OpenAI-compatible vision API URL. Ollama: http://localhost:11434/v1 LM Studio: http://localhost:1234/v1 OpenAI: https://api.openai.com/v1
modelSTRINGqwen3-vlVision model name. Must support image input. Ollama: qwen3-vl, qwen2.5-vl:7b, llava OpenAI: gpt-4o-mini, gpt-4o
languageoptCOMBOEnglishLanguage for the rewritten prompt.
temperatureoptFLOAT0.70–2VLM temperature. Lower = more faithful.
max_tokensoptINT2048256–8192Max tokens for the VLM response.
custom_instructionsoptSTRINGAdditional instructions for the VLM. Example: 'Use a cinematic photography style' Example: 'Emphasize dramatic lighting' Appended to the system prompt.
passthroughoptBOOLEANfalseSkip VLM rewriting. Passes creative_direction through as-is (for A/B testing).
image_max_sideoptINT1024256–2048Max pixel size (longest side) for the image sent to the VLM. Larger = more detail but slower and more tokens.

Outputs (2)

NameTypeDescription
promptSTRING
cn_type_indexINT