Nodes/Louis Use/📝 Ideogram4 Text Encode
ComfyUI Node

📝 Ideogram4 Text Encode

Feed Ideogram 4 its structured JSON prompt — with or without a local LLM doing the thinking

By LouisLU1997·Created 4 months ago·Updated 2 months ago· 0
📝 Ideogram4 Text Encode
  • clip
  • ref_image
  • conditioning
  • json_text
  • text
  • aspect_ratio
text
aspect_ratio16:9
modeQwen(语义分析)
max_tokens1200
quantization4-bit (VRAM-friendly)

Ideogram 4.0's whole thing is that it's trained on a structured JSON prompt - a high-level description plus separate fields for style, lighting, and compositional breakdown, rather than one flat sentence. The community-standard way to get that structure is Kijai's prompt-builder node, and it became a whole genre. This node is the Louis Use take on it, and it has one genuinely different feature: the JSON can be filled in either by a pure template (no model, instant) or by a local Qwen3-VL running semantic analysis - including reading the dominant colors out of a reference image.

The name is a bit of a lie, by the way - it doesn't call Ideogram's API and needs no key. It just produces the JSON format Ideogram 4's encoder wants, and can hand you a conditioning for sampling directly.

The two modes

mode is the first decision:

  • Template (直接包装) - your text goes straight into the high_level_description field and the rest of the JSON structure is produced mechanically. Zero model, zero downloads, works offline, effectively instant. You get the shape of an Ideogram 4 prompt with your words inside it. If you're already writing structured prompts yourself, this is all you need.
  • Qwen (语义分析) - runs a local Qwen3-VL to actually analyze your description and fill every field, splitting style, lighting, composition, and background into their own JSON keys. This is the "LLM as prompt engineer" pattern, done locally - no cloud, free per call. It's also where the reference image comes in: wire ref_image and Qwen pulls the real dominant colors from the image (via a small k-means extractor in the node) to override text-guessed colors.

Qwen mode needs the separate ComfyUI-QwenVL custom node and a QwenVL checkpoint, and it's the heavier path - see install below.

The inputs that matter

  • text - your prompt. Everything else is built around this.
  • aspect_ratio - one of 18 presets ("16:9 横屏", "1:1 正方形", "9:16 竖屏", …). It's emitted as a string on the aspect_ratio output, which is designed to feed this pack's Resolution Selector's override input so the whole graph agrees on resolution.
  • max_tokens (400–2000, default 1200) - Qwen mode only; the tooltip warns that under ~1200 the model can truncate and drop fields. Leave it.
  • quantization - 4-bit (default, VRAM-friendly), 8-bit, or None (FP16). The tooltip is honest: FP16 is the most accurate but "Windows 下容易崩溃" - crashes Windows more easily.

Wire clip if you want a conditioning output for sampling; leave it and just take the json_text to save as a sidecar or feed into another tool. The text output is the original input passed through.

Installing it

The base pack:

cd ComfyUI/custom_nodes
git clone https://github.com/LouisLU1997/ComfyUI-louis-use Louis_use

Template mode needs nothing else. For Qwen mode you additionally need ComfyUI-QwenVL installed separately (its own repo), plus the QwenVL checkpoint - the node degrades gracefully if QwenVL isn't present, but the Qwen path simply won't run. Start with the 4-bit option to keep VRAM sane.

The take

If you just want your prompt packaged into Ideogram 4's JSON shape, Template mode is a nice zero-dependency convenience. If you want a local LLM to build a rich structured prompt and lift colors from a reference image, this is one of the few nodes doing that fully locally. Just don't expect Qwen-mode output to be magic - it's a 4B model writing your prompt, so read it before you sample, the same way you'd sanity-check any local LLM output.

CategoryLouis_use/ideogram4

Inputs (7)

NameTypeDefaultDescription
textSTRING直接输入提示词,或从外部节点连线输入
aspect_ratioCOMBO16:9宽高比,输出到 Resolution Selector 统一控制分辨率
modeCOMBOQwen(语义分析)Template:文本直接放入 JSON,无需模型;Qwen:本地 LLM 分析填充所有字段
clipoptCLIP接 Ideogram 4 CLIP 编码器,输出 conditioning 用于采样
ref_imageoptIMAGE颜色参考图(可选)。接入后 Qwen 将从图像中提取真实主色调,覆盖纯文字推断的颜色
max_tokensoptINT1200400–2000Qwen 最大输出 token 数,建议 1200 以上确保所有字段都能生成完整(Template 模式忽略)
quantizationoptCOMBO4-bit (VRAM-friendly)Qwen 模型量化精度。int4 显存最省,FP16 精度最高但 Windows 下容易崩溃

Outputs (4)

NameTypeDescription
conditioningCONDITIONING
json_textSTRING
textSTRING
aspect_ratioSTRING