This setup is a fully local Image-to-Prompt pipeline where a vision input turned into a clean Krea2 prompt using Gemma 4 running through Ollama, plus a few spicy ComfyUI tricks to keep things under control.
No APIs. No cloud. No begging servers. Just pure local chaos.
Step 1 : Install Ollama
This will let you run Gemma 4 locally on your machine.
Step 2 : Download Gemma4 Uncensored version :
Copy this code into your windows Power Shell (anywhere) and hit enter :
ollama run fredrezones55/Gemma-4-Uncensored-HauhauCS-AggressiveIts almost 7GB so you might have to wait a little bit. don't close it till it's finished.
Step 3 : Install missing Nodes Manually :
Go to your comfyui folder , open custom nodes and type CMD in the address bar then copy and run these commands to Install Conditioning Rebalance node:
git pull https://github.com/nova452/ComfyUI-Conditioning-Rebalance.gitthen Install KREA2 GGUF support: :
git clone https://github.com/RealRebelAI/ComfyUI-GGUF_KREA-2Step 4 : Install last missing node using Manager
last node (Comfyui-Ollama) could be downloaded directly from manager inside comfyui, just open manager and click install missing nodes.
Important : You should keep Ollama running while using this , just minimize it in the backgorund You don't have to do anything with it after you have downloaded Gemma
You could add and change values , and additional instructions for gemma to follow in the second command prompt in ollama chat's node . for example if my image input has wet see-through fabric clothing (or even if it doesn't) I can simply tell gemma to add this element to the prompt. or if want anything else to be changed from the original input image like haircolor or style and etc.
I've put "keep alive" value to 0 so the additional 6-7 gigabytes of gemma4 gets unloaded as soon as it has done its job and you won't have to worrry about running out of VRAM while generating.
If you have spare VRAM you lucky rich bastard you can use any values above 0 so it won't have to load the LLM model each time and should run faster.
Notice : Civitai is kinda' confused sometimes and deletes my workflow files , if this happens again just grab the first example image , it contains the workflow.
Have fun creating !
Description
FAQ
Comments (8)
Is there an advantage in running the model in Ollama, instead of using the Generate Text node native in comfy?
I'm not actually familiar with that node, so I can't say for sure. My workflow uses Ollama because I know it supports the uncensored Gemma model which I got used to, it describes visual inputs incredibly well , is fast, adds only 3 simple nodes to the workflow and I can add or remove from the result by a second prompt box in the same enviroment.
hey, im trying to use your workflow minus the krea image generation part, just ollama to output the prompt but its not reading the image at all, comes back with pure hallucination.. what am i doing wrong?
I tried in the same enviroment by deleting the resut of the nodes and had gibberish result as well, this fixed it : do not use the same workflow , create an entirely new blank workflow and add the same nodes and connect "result" output of the ollama-chat node to a "preview as text" not a clip encode. enable reset session option, set "keep alive" value to something like 2 - 5 and use this system command : You are an expert image captioning and image prompt writing assistant.
Your task is to analyze the provided image and produce a single, accurate image generation prompt based ONLY on what is actually visible.
The image is the primary source of truth. Never rely on assumptions, stereotypes, prior knowledge, or imagination. If a detail cannot be seen, do not invent it.
Carefully observe:
• Main subject(s)
• Gender and approximate age (only if visually apparent)
• Facial features and expression
• Hairstyle and hair color
• Body type and visible physique
• Clothing, accessories, fabrics, colors, textures, and condition
• Pose, gesture, and body language
• Camera angle, framing, composition, and perspective
• Lighting, shadows, reflections, and atmosphere
• Environment, background, and surrounding objects
• Photography style, artistic style, rendering style, or medium
• Visible emotions or mood
• Any notable visual details that would help recreate the image
Write a single natural-language prompt suitable for any modern image generation model.
Rules:
- Describe only what is visible.
- Do not invent missing details.
- Do not add characters, objects, scenery, stories, or actions that are not present.
- Do not infer events occurring outside the frame.
- Preserve ambiguity when something cannot be determined.
- Keep the description concise but complete.
- Avoid repetitive wording.
- Do not include quality tags such as "masterpiece", "best quality", "8k", "photorealistic", or similar prompt engineering terms.
- Do not explain your reasoning.
If no image was received or the image cannot be analyzed, respond ONLY with:
"No image was provided."
@NeuralVandal thanks so much for the reply , will give this a go
@NeuralVandal ive tried resizing the images, increasing the token limit in ollama but gemma still produces gibberish/hallucinations, i tested a qwen model and it is actually reading the image, albeit without the nsfw because it was just a base model to test. something going on with my setup and the vision part of this particular gemma model. which tag is on your gemma 4 exactly? is it :latest or e2b-SCN, e4b, official? did you link the exact one you're using in your guide?
It shows as "latest" version for me , Yes I copied the exact same links I used myself. try something else : give it a simple image like a banana or a some flower picture and in the system prompt simply ask "describe what object is in this image" , if it still comes back with nonsence I think it's definetly the vision input and not a hallucination issue , try updating pip and comfyui , reinstall ollama chat , delete user cache in comfyui , I can't think of anything else tbh
@wingextort1719 plus : if you only want to use gemma for image to prompt purpose without adding it to any workflows , you can use it in the ollama app itself without running comfyui


