Local Prompt-to-Image Pipeline: ComfyUI + LM Studio Gemma + Z-Image Turbo
Melvin Vivas · X post · 2026-05-20 · Open on X
Topics: AI Dev Tools & Productivity, Portfolio Projects, Prompt & Context Engineering · Level: intermediate
Summary
The creator built a ComfyUI custom node that uses Gemma E2B running in LM Studio to write an image prompt. The prompt then goes to Z-Image Turbo to generate the image, and the whole pipeline runs locally.
Key points
- Step 1: a custom ComfyUI node sends a request to a local LLM (Gemma E2B in LM Studio) to write or expand the prompt
- Step 2: the generated prompt goes to Z-Image Turbo for image generation
- The whole pipeline runs locally, with no cloud APIs
- Using an LLM to enhance prompts can improve image generation results
Resources mentioned
- ComfyUI · tool · x.com · free
The official X account for ComfyUI, the node-based tool for generative AI workflows, which announces things like ComfyUI Agent.
Also in: Grok as "Director": Making a Local Anime Clip with ComfyUI on an RTX 3090 (Melvin Vivas on X · notes), FLUX 3 Image Klein: Open-Weights Image Model Now Supported in ComfyUI (Melvin Vivas on X · notes), ComfyUI Templates: Chain Ready-Made Workflows Instead of Building From Scratch (Melvin Vivas on X · notes), Comfy Agent: An AI Agent That Builds ComfyUI Workflows in Comfy Cloud (Melvin Vivas on X · notes) and 32 more - LM Studio · tool · x.com · free
Desktop app for downloading and running LLMs locally, with a developer mode that serves models through an API.
Also in: Run Local LLMs on the Computer You Already Have: A Beginner's Path (Melvin Vivas on X · notes), Running LLMs Locally Without an Expensive Rig (Melvin Vivas on X · notes), Adding Vercel AI Gateway as a provider in AIBackends with Devin (Melvin Vivas on X · notes), LoRA Fine-Tune Qwen3.5-2B on Your Tweets with Unsloth Studio (Melvin Vivas on X · notes) and 32 more - Gemma 4 26B · tool · ai.google.dev · free
Mid-sized multimodal open model in Google's Gemma 4 family.
Also in: Free gpt-oss-20b and Gemma 4 26B on OpenRouter (Melvin Vivas on X · notes), Gemma 4 26B for OCR in LM Studio (Melvin Vivas on X · notes) - Z-Image-Turbo · tool · huggingface.co · free
An open image-generation model that can run on local hardware.
Also in: Free Local Image Generation: ComfyUI App Mode + LM Studio + Gemma (Melvin Vivas on X · notes), Free Local Portraits with Z-Image-Turbo in ComfyUI (Melvin Vivas on X · notes), Free Local Image Generation with Z-Image-Turbo and ComfyUI (Melvin Vivas on X · notes), Local Image Generation Pipeline Built with Claude Code (Melvin Vivas on X · notes)
Try this
- Build a local ComfyUI pipeline where an LLM node writes prompts and an image model renders them
More in AI Dev Tools & Productivity
- Codex app 26.519: Appshots, Goal mode, remote computer use
- Parallel Coding Agents with Git Worktrees and Playwright MCP
- Local Text-Only Workflows in ComfyUI with LM Studio and Gemma 4 E2B
- Google Antigravity 2.0: Multi-Agent Desktop App Walkthrough (Subagents, Scheduled Tasks)
- Composer 2.5 as the Default Coding Model in Cursor
- Composer 2.5: Cursor's Model for Long-Running Agentic Tasks