Cyberdelia Prompt Engineer — Conditioning
Cyberdelia Z-Engineer, no API key required
- clip
- image
- positive
- negative
- prompt
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:
modelset toautoqueries 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_urland appends/v1if 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_termsis 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" yourm4rty styleinto something the LoRA doesn't trigger.error_modedecides what happens when the call ultimately fails:fallback_input(continue with your raw seed, the default),stop, orempty. 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. autowon'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
Customif 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
modeoff and it returns yourtextuntouched, no cleaning, no LLM call. Handy for A/B testing whether the LLM is actually helping.
Inputs (18)
| Name | Type | Default | Description |
|---|---|---|---|
| clip | CLIP | — | |
| mode | BOOLEAN | true | — |
| text | STRING | — | |
| system_prompt | STRING | You are a helpful assistant. | — |
| api_url | STRING | http://localhost:1234/v1 | — |
| model | STRING | auto | — |
| seed | INT | 00–18446744073709550000 | — |
| temperature | FLOAT | 0.700–2 | — |
| max_tokens | INT | 60050–4096 | — |
| timeout | INT | 12010–600 | — |
| keep_termsopt | STRING | — | |
| preserve_constraintsopt | BOOLEAN | false | — |
| clean_outputopt | BOOLEAN | true | — |
| error_modeopt | COMBO | stop | 3 options: stop, fallback_input, empty |
| retriesopt | INT | 10–3 | — |
| use_visionopt | BOOLEAN | false | — |
| vision_system_promptopt | STRING | Analyze the attached image and return only one detailed image-generation prompt in English. | — |
| imageopt | IMAGE | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| positive | CONDITIONING | — |
| negative | CONDITIONING | — |
| prompt | STRING | — |