CivArchive
    Enhance Your Prompts for Flux1 Kontext-Dev Using Ollama - Advanced v1.0
    NSFW
    Preview undefined
    Preview undefined
    Preview undefined
    Preview undefined
    Preview undefined
    Preview undefined
    Preview undefined
    Preview undefined
    Preview undefined

    In this workflow, I’ve built an intelligent ComfyUI setup that automatically improves user prompts to better suit the Flux1 Kontext-Dev editing system — a cutting-edge tool for image-to-image editing .

    📘 Reference: Flux1 Kontext-Dev Official Guide


    🎯 Goal

    Flux1 Kontext-Dev relies heavily on clear, rich, and well-structured prompts to guide the editing process. However, many users provide short or vague prompts, leading to poor results.

    This workflow solves that by integrating a local large language model (LLM) using Ollama, which rewrites simple prompts into descriptive, detailed prompts tailored for effective image editing.


    ⚙️ How the Workflow Works

    1. User Inputs:

      • An image for editing.

      • A simple or vague text prompt describing the desired change.

    2. Ollama Integration (LLM for Prompt Enhancement):

      • The prompt is passed to Gemma-3, a vision-enabled LLM running locally via Ollama.

      • The model rewrites the prompt into a more expressive and visually descriptive version.

    3. Enhanced Prompt → Flux1:

      • The improved prompt is fed into the Flux1 Kontext-Dev nodes along with the input image.

      • Flux1 then performs context-aware image editing based on this high-quality prompt.


    📦 Requirements

    To run this workflow, you need the following components:

    ✅ 1. Ollama

    A powerful local runtime for LLMs and vision models.

    🔗 Download and install Ollama:
    https://ollama.com/download

    ✅ 2. Vision Model: gemma3

    Use a multimodal (vision + language) version of Gemma 3 depending on your system’s VRAM:

    👉 Model Page:
    https://ollama.com/library/gemma3

    ollama run gemma3

    🔥Uncensored Model:
    https://ollama.com/huihui_ai/gemma3-abliterated

    ollama run huihui_ai/gemma3-abliterated

    ⚠️ Make sure you're using the multimodal (vision) variant of Gemma 3 to ensure it can process image-based prompts in ComfyUI.


    ✅ Key Benefits

    • Improved editing accuracy from even simple input prompts.

    • Local-first, privacy-safe setup using Ollama and ComfyUI.

    • Flexible model choices depending on your hardware.


    💡 Example

    Input prompt:

    "change the style to realistic"

    Enhanced prompt via Gemma-3:

    "Change the image to a photorealistic rendering, with accurate lighting, textures, and details, while preserving the subject’s facial features, pose, and the existing composition."


    🌍 Multilingual Prompt Support

    This workflow supports prompts in any language, including Arabic, and automatically translates them into expressive English prompts that Flux1 can interpret.

    💬 Example:

    Input (Arabic):

    "حول الستايل إلى حقيقي"

    Enhanced Output (English):

    "Change the image to a photorealistic rendering, with accurate lighting, textures, and details, while preserving the subject’s facial features, pose, and the existing composition."

    This makes the workflow highly accessible to non-English speakers while still benefiting from professional-grade prompt enhancement.

    🧩 Workflow Versions

    There are two versions of this workflow available:

    🔹 Basic Version

    • Designed for ease of use.

    • Supports 1–2 input images.

    🔸 Advanced Version

    Description

    4 images + Upscale

    FAQ

    Comments (18)

    lakdananJul 1, 2025· 2 reactions
    CivitAI

    Thanks, I don't use your workflow due to lack of vram to use the LLM but I took your instructions that I use with grok and it works well. Do you have instructions for flux dev?

    jorgmikel76648
    Author
    Jul 1, 2025

    You can run 4b on just 6GB of VRAM, which is enough to give you excellent results. GROK works well for uncensored images.

    For FLUX DEV, you can find them in my app:
    https://civitai.com/articles/15662/uncensored-free-app-to-convert-images-into-prompts-for-wan21-sdxl-flux1-and-more
    or directly from this link:
    https://github.com/rorsaeed/image-to-prompt/blob/main/data/system_prompts.json

    lakdananJul 1, 2025

    @jorgmikel76648 Thanks for your reply and the links, I'll try that with my meager 8GB. Yes, that's why I use Grok ;). Aside from generating prompts, have you tried Grok's unhinged voice mode? Very fun.

    gigsaJul 1, 2025
    CivitAI

    Does not work. Keeps erroring with this message:

    1 validation error for GenerateRequest model String should have at least 1 character [type=string_too_short, input_value='', input_type=str] For further information visit https://errors.pydantic.dev/2.11/v/string_too_short


    Because on OllamaGenerate, model is empty, and I have no downloaded model so it's undefined, and the workflow has no built-in mechanism to automatically download required model. Also on the model pages you linked in the guide, there's no download button anywhere.

    jorgmikel76648
    Author
    Jul 1, 2025

    You can download only via terminal. Execute this command via terminal:
    ollama run gemma3

    nymicalJul 2, 2025· 1 reaction
    CivitAI

    You're using a modified version of kontext in this workflow, right? "kontextNsfwFp8"?
    Where can we download this model?

    blobby99Jul 2, 2025

    I'd image Google is your friend. This very important checkpoint was on this site for a surprising period, and it is excellent at fixing that one issue Kontext has!

    nymicalJul 2, 2025

    @blobby99 and @lakdanan Thank you! I'll look into both options.

    nymicalJul 5, 2025

    @foneckeckem813 Haha.. that model got deleted. I was late. Thank you though. :)

    luisx123Jul 7, 2025

    @nymical Same here ugh, was hoping on snagging this model! Did a google search but nothing popped up

    nymicalJul 8, 2025· 1 reaction

    @luisx123 Check out this comment on a reddit thread.
    https://www.reddit.com/r/StableDiffusion/comments/1lros7q/comment/n1chj4k/
    My experience was not great, but ymmv.

    reopenedgatorade214Jul 9, 2025· 1 reaction

    @foneckeckem813 can you post a link to the file so that I can download it?

    luisx123Jul 15, 2025

    @nymical Much appreciated!

    alex456mint1Jul 11, 2025· 2 reactions
    CivitAI

    jorgmikel76648, I am interested in your work, thank you. There is NSFW on the examples. And in the workflow as well. Soft erotica is very beautiful and uplifting, although I'm not a fan of hard erotica.))

    kontextNsfwFp8 - what to replace it with? Or is there a reference?

    jorgmikel76648
    Author
    Jul 11, 2025

    thnak you,
    try this one:
    https://civitai.com/models/958009?modelVersionId=1849802
    but the original model give best result in most other cases

    Workflows
    Flux.1 Kontext

    Details

    Downloads
    533
    Platform
    CivitAI
    Platform Status
    Available
    Created
    7/1/2025
    Updated
    6/18/2026
    Deleted
    -

    Files

    enhanceYourPromptsFor_advancedV10.zip