Nodes/kontext-super-prompt/TextGen WebUI FLUX Kontext Enhancer
ComfyUI Node

TextGen WebUI FLUX Kontext Enhancer

Your oobabooga model as a prompt engineer for Flux Kontext

By aiaiaikkk·Created about a year ago·Updated 12 months ago· 175
TextGen WebUI FLUX Kontext Enhancer
  • image
  • flux_edit_instructions
  • system_prompt
layer_info
edit_description
modeltextgen-webui-model-not-found
auto_unload_modelfalse
editing_intentgeneral_editing
processing_styleauto_smart
urlhttp://127.0.0.1:5000
temperature0.7
seed42
enable_visual_analysisfalse
load_saved_guidancenone
save_guidancefalse
guidance_nameMy Guidance
custom_guidance

TextGenWebUIFluxKontextEnhancer ("TextGen WebUI FLUX Kontext Enhancer") is this pack's bridge to oobabooga's Text Generation WebUI. If you already run a local LLM through TextGen WebUI - the de facto launcher for running GGUF/GGML models with a chat interface - this node routes your canvas annotations and edit description through that model and gets back structured editing instructions formatted for Flux Kontext. It's the "use my existing big model instead of a tiny Ollama one" option, and for serious editing chains it's usually the best output of the three generators in this pack, because you can feed it a model that actually understands complex instructions.

Same family as the other generators, different backend: instead of talking to Ollama at 11434, it talks to TextGen WebUI (default http://127.0.0.1:5000) and formats the result specifically for Flux Kontext, which consumes instruction-style prompts - "change the shirt to red" - better than tag soup.

How it works

It connects to TextGen WebUI using dual API support: it tries the OpenAI-compatible endpoint (/v1/models) first, falls back to the native API (/api/v1/model), and populates the model dropdown from whatever the service reports - so the model list is real-time, not hardcoded. Your layer_info (annotation JSON from Super Canvas) and edit_description are combined with a built-in guidance system: a library of commercial-scenario prompt templates plus your chosen editing_intent (product showcase, portrait enhancement, creative design, and more) and processing_style (auto_smart picks automatically; others force a specific approach). Results are cached to avoid hammering the service with duplicate requests.

The model stays loaded between runs unless you check auto_unload_model, which frees VRAM after each generation at the cost of slower subsequent calls. If your model is multimodal, enable_visual_analysis sends the image input along for vision-based prompting.

Inputs and outputs that matter

  • layer_info - annotation JSON from Super Canvas. The tooltip is honest: can be left empty if you're only using edit_description.
  • edit_description - what you want done, in words. Combined with the annotations to build the instruction.
  • model - selected from the live-fetched list; shows textgen-webui-model-not-found until the service is reachable.
  • editing_intent and processing_style - the two enums that shape the guidance.
  • auto_unload_model - off by default (keep model loaded); on to free memory after each run.
  • Optional: url (service address), temperature, seed, enable_visual_analysis, custom_guidance (only used with processing_style = custom_guidance), plus save_guidance/guidance_name/load_saved_guidance for persisting custom guidance templates.

Outputs: flux_edit_instructions (STRING) - wire this into your Flux Kontext text input - and system_prompt (STRING), the guidance system prompt that produced it, useful for debugging or reuse.

Installing it

Install the pack (ComfyUI Manager → "Kontext Super Prompt" or git clone https://github.com/aiaiaikkk/super-prompt-canvas), restart, then make sure TextGen WebUI is running with its API enabled:

# from the oobabooga install
python server.py --api

The node's README framing is that it "auto-detects" the service - practically, start TextGen WebUI first, then add the node so the model list populates.

Where people get burned

The obvious one: nothing works until TextGen WebUI is up with --api. The textgen-webui-model-not-found placeholder model is your cue the service isn't reachable - check the port, check the URL (some setups run on 5000, others behind a proxy). enable_visual_analysis does nothing on text-only models, so don't be confused by the checkbox doing nothing for you. And unchecking auto_unload_model to keep the LLM resident is great for speed but eats VRAM that your Flux Kontext edit pass wants - on a 12 GB card you'll want it on. Small models here give the same shallow results as the Ollama path; this node only pays off with a model big enough to follow multi-part instructions.

Categorykontext_super_prompt/ai_enhanced

Inputs (15)

NameTypeDefaultDescription
layer_infoSTRINGAnnotation JSON data from Super Canvas. Can be left empty if only using Edit Description.
edit_descriptionSTRINGDescribe the editing operations to perform. This will be combined with annotation data to generate precise instructions.
modelCOMBOtextgen-webui-model-not-foundSelect a TextGen WebUI model. The list is fetched in real-time from the TextGen WebUI service.
auto_unload_modelBOOLEANfalseAutomatically unload the model after generation to free up memory. Keep unchecked to maintain the model loaded throughout the session.
editing_intentCOMBOgeneral_editingSelect your editing intent: What type of result do you want to achieve? The AI will automatically choose the best technical approach based on your intent.
processing_styleCOMBOauto_smartSelect the AI processing style: auto_smart will intelligently choose the best approach, others provide specific processing styles.
imageoptIMAGEOptional: Image for visual analysis (only for multimodal models).
urloptSTRINGhttp://127.0.0.1:5000TextGen WebUI service address.
temperatureoptFLOAT0.70.1–1Controls creativity. Higher values mean more creative responses.
seedoptINT420–4294967295Seed for controlling randomness. Use the same seed for reproducible results.
enable_visual_analysisoptBOOLEANfalseEnable visual analysis (only effective for multimodal models that support vision).
load_saved_guidanceoptCOMBOnoneLoad previously saved custom guidance (used when processing_style is 'custom_guidance').
save_guidanceoptBOOLEANfalseEnable to save the current custom guidance text to a file.
guidance_nameoptSTRINGMy GuidanceThe name of the file to save the guidance to.
custom_guidanceoptSTRINGEnter custom AI guidance instructions (used when processing_style is 'custom_guidance').

Outputs (2)

NameTypeDescription
flux_edit_instructionsSTRING
system_promptSTRING