Nodes/comfyui-cyberdelia-z-engineer/Cyberdelia Prompt Engineer — Conditioning
ComfyUI Node

Cyberdelia Prompt Engineer — Conditioning

Cyberdelia Z-Engineer, no API key required

By cyberdeliaAI·Created 4 months ago·Updated 4 days ago· 11
Cyberdelia Prompt Engineer — Conditioning
  • clip
  • image
  • positive
  • negative
  • prompt
modetrue
text
system_promptYou are a helpful assistant.
api_urlhttp://localhost:1234/v1
modelauto
seed0
temperature0.70
max_tokens600
timeout120
keep_terms
preserve_constraintsfalse
clean_outputtrue
error_modestop
retries1
use_visionfalse
vision_system_promptAnalyze the attached image and return only one detailed image-generation prompt in English.

Type "a rainy Tokyo street at night, neon reflections" and get back a 250-word prompt with film stock, lens and lighting notes - without leaving ComfyUI and without a single cloud API key. That's Cyberdelia Z-Engineer: it hands your rough idea to a local LLM running in LM Studio or Ollama, then CLIP-encodes whatever comes back directly into sampler-ready conditioning. No separate CLIP Text Encode node, no copy-pasting into a browser tab.

What it actually does

It's LLM-powered prompt engineering, wired into the graph. You give it a seed concept; it sends that plus a system prompt to an OpenAI-compatible chat-completions endpoint and returns the engineered result as conditioning. The name traces to BennyDaBall930's ComfyUI-Z-Engineer and his "engineer" fine-tunes like Qwen3-4b-Z-Image-Engineer (this pack is a rewritten fork); "engineer" is the job - turning a two-line idea into a full image prompt.

And it fits the moment. Z-Image, Anima, Flux 2 Klein and friends are LLM-encoded - your prompt is an instruction read by a language model, so having an LLM write it is translation between two things that speak the same language. It's why "prompt enhancer" chatter went from a few mentions in 2023 to 253 in the first half of 2026, and why it stopped being a browser tab and became a node.

How it works

The flow: text + system_prompt get POSTed to {api_url}/chat/completions (default http://localhost:1234/v1, LM Studio's port). The reply is cleaned - think blocks, ChatML tags, code fences, "positive prompt:" prefixes and negative-prompt sections get stripped - then tokenized and encoded with clip.encode_from_tokens_scheduled. Details worth knowing:

  • model set to auto queries LM Studio's native model API, marks loaded models [loaded] and vision-capable ones [vision], and only auto-selects when exactly one choice is unambiguous. Multiple loaded? It errors and names them instead of guessing. Conservative, and the right call.
  • URL forgiveness: it normalizes api_url and appends /v1 if you forgot it. This bites people constantly with the original Z-Engineer - "Unexpected endpoint or method. (POST /chat/completions)" - so having it handled here is a quiet win.
  • keep_terms is a comma-separated list of phrases (LoRA triggers, style names) that must survive. The node asks the LLM to keep them, then deterministically re-appends any it dropped, casing intact. This is the input I'd reach for - it stops an LLM from "improving" your m4rty style into something the LoRA doesn't trigger.
  • error_mode decides what happens when the call ultimately fails: fallback_input (continue with your raw seed, the default), stop, or empty. Retries are limited to connection errors, timeouts, 429s and 5xx; permanent errors fail fast.

The inputs and outputs that matter

You'll actually touch: text (your concept), mode (engineered/LLM vs passthrough/raw), system_prompt (instructions; pick a preset or edit), api_url, model, maybe temperature. The rest - seed, max_tokens, timeout, retries - have sane defaults.

Outputs:

  • positive (CONDITIONING) → your sampler's positive input. The star.
  • negative (CONDITIONING) → a CLIP-encoded empty string, so save nodes that expect a negative don't break.
  • prompt (STRING) → the exact text that was encoded. Wire it into your image saver's prompt field for guaranteed metadata capture.

There's also an image input: flip use_vision on and it resizes (max 1536px), base64-encodes, and sends it to a [vision] model for image-to-prompt. Needs a vision-capable model - auto won't find one on a text-only server.

Installing

ComfyUI Manager: search Cyberdelia and install. Or manually:

cd ComfyUI/custom_nodes
git clone https://github.com/cyberdeliaAI/comfyui-cyberdelia-z-engineer.git
pip install -r comfyui-cyberdelia-z-engineer/requirements.txt

Restart ComfyUI. Dependencies: one line, requests - among the cleanest installs in the ecosystem. The catch is on the server side: you need a running OpenAI-compatible endpoint with an LLM loaded - a small quantized model is plenty, e.g. a Q8 of a 4B "engineer" fine-tune (~4.3GB) next to your diffusion model on a 24GB card.

The things that'll trip you up

  • It needs a recent ComfyUI. The node uses clip.encode_from_tokens_scheduled; if it fails on import, update ComfyUI first.
  • auto won't guess. Loading several models at once in LM Studio means picking one manually. A feature that reads like a bug the first time.
  • VRAM contention. An LLM and a diffusion model on one GPU is a juggling act. The community pattern: load the diffusion model in ComfyUI first, then start the LM server - the reverse can eat all 24GB at once.
  • Watch the length. The bundled "Cyberdelia Detailed 200–250" preset is uncensored-flavored (switch to Custom if that's not your thing) and asks for a couple hundred words. That's generous for a CLIP encoder, and on LLM-encoded models there's a real attention cap around 75–100 effective tokens - short and precise usually wins. The node won't pad to hit the count, which I respect.
  • Passthrough is genuinely raw. Flip mode off and it returns your text untouched, no cleaning, no LLM call. Handy for A/B testing whether the LLM is actually helping.
CategoryCyberdelia/Prompt

Inputs (18)

NameTypeDefaultDescription
clipCLIP
modeBOOLEANtrue
textSTRING
system_promptSTRINGYou are a helpful assistant.
api_urlSTRINGhttp://localhost:1234/v1
modelSTRINGauto
seedINT00–18446744073709550000
temperatureFLOAT0.700–2
max_tokensINT60050–4096
timeoutINT12010–600
keep_termsoptSTRING
preserve_constraintsoptBOOLEANfalse
clean_outputoptBOOLEANtrue
error_modeoptCOMBOstop3 options: stop, fallback_input, empty
retriesoptINT10–3
use_visionoptBOOLEANfalse
vision_system_promptoptSTRINGAnalyze the attached image and return only one detailed image-generation prompt in English.
imageoptIMAGE

Outputs (3)

NameTypeDescription
positiveCONDITIONING
negativeCONDITIONING
promptSTRING