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: ComfyUI Agent: early access announcement (Melvin Vivas on X · notes), Comfy Router: One API for Image, Video, 3D and Audio Model Providers (Melvin Vivas on X · notes), Generating AI Video Locally with MiniMax H3 in ComfyUI on an RTX 3090 (Melvin Vivas on X · notes), Running MiniMax M3 Locally in ComfyUI on an RTX 3090 (Melvin Vivas on X · notes) and 23 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: 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), AIBackends: An API Layer Between Your App and AI Models (Now with Jev) (Melvin Vivas on X · notes) and 31 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