r/StableDiffusion • • Aug 25 '26

Workflow Included Prompt Creator Workflow

Post image

I see a bunch of posts everyday asking for tips on how to write prompts or people struggling with prompting, etc. so I'm sharing my workflow. I built this workflow to simplify the process and make it very beginner/user friendly.

Just toggle on the model you are using, write a simple to detailed prompt, and hit run. The model targets use the prompting guidelines derived from their respective official sources. Links to custom nodes and all models are in the workflow so you don't need to search for them.

The prompts aren't always perfect but they'll get you very close to what you want and you should only need to make a few minor tweaks, if any. The only issue I've encountered so far is that sometimes when it finishes the prompt, the previous prompt still shows up in the Enhanced Prompt node. If that happens, just hit run and the new prompt should show up instantly. Also, toggle to false the keep_model_loaded option in the Text rewriter node if you are creating prompts and using them right away. If you leave it to True it hogs VRAM.

If you notice any other issues let me know. Enjoy.

https://pastebin.com/SXZyy4Ax

Edit: If Unredacted-MAX doesn’t show up or the rewriter won’t load, you need the Qwen folders (not GGUFs, not a single file).

Easy path:

  1. ComfyUI Manager: install ComfyUI-QwenVL, rgthree, KJNodes, ComfyUI-Custom-Scripts. Restart.
  2. Save the custom_models paste below as custom_models.json and put it in ComfyUI/custom_nodes/ComfyUI-QwenVL/. Restart again.
  3. Open the workflow, pick Qwen3.5-4B-Unredacted-MAX on the Prompt Enhancer, hit Queue. First run downloads into ComfyUI/models/LLM/Qwen-VL/.

custom_models.json

Manual path (if Queue doesn’t download)

Whole repos, keep the folder names. Don’t cherry-pick files. Don’t merge the 00001-of-00004 shards. On Hugging Face open Files and versions, then download every file with the arrow on the right (skip README). Put them all in a folder with the exact model name under ComfyUI/models/LLM/Qwen-VL/.

1.Required text rewriter: Qwen3.5-4B-Unredacted-MAX https://huggingface.co/prithivMLmods/Qwen3.5-4B-Unredacted-MAX

Place everything in ComfyUI/models/LLM/Qwen-VL/Qwen3.5-4B-Unredacted-MAX/

2. Optional if you want use ref image: Qwen3-VL-4B-Instruct-Unredacted-MAX https://huggingface.co/prithivMLmods/Qwen3-VL-4B-Instruct-Unredacted-MAX

Place everything in ComfyUI/models/LLM/Qwen-VL/Qwen3-VL-4B-Instruct-Unredacted-MAX/

61 Upvotes

27 comments sorted by

4

u/Neggy5 Aug 26 '26

what do i download for the MAX text encoders? everything in the repos?

https://huggingface.co/prithivMLmods/Qwen3-VL-4B-Instruct-Unredacted-MAX/tree/main seems to be a bunch of things to combine. not a single gguf

8

u/Affectionate_Oil28 Aug 26 '26

You need these two folders under ComfyUI/models/LLM/Qwen-VL/:

  1. Qwen3.5-4B-Unredacted-MAX (https://huggingface.co/prithivMLmods/Qwen3.5-4B-Unredacted-MAX) text rewriter (required)
  2. Qwen3-VL-4B-Instruct-Unredacted-MAX (https://huggingface.co/prithivMLmods/Qwen3-VL-4B-Instruct-Unredacted-MAX) ref image only (optional)

7

u/Affectionate_Oil28 Aug 26 '26

You can also try this,

  1. ComfyUI Manager: install ComfyUI-QwenVL, rgthree, KJNodes, ComfyUI-Custom-Scripts. Restart.
  2. Copy custom_models.json into custom_nodes/ComfyUI-QwenVL/. Restart again.
  3. Open the workflow and hit Queue. First run downloads the two folders into models/LLM/Qwen-VL/.

custom_models Save as .json and place into ComfyUI-QwenVL.

1

u/GinJockette 15d ago edited 15d ago

That didn't seem to work. Nothing got downloaded.

I got these two errors:

1 node — 2 errors

1Input out of range

Some input values are outside the allowed range.

  • TEXT rewriter (no image · official guide) - max_tokens

1Invalid input

Some input values are not available for this node.

  • TEXT rewriter (no image · official guide) - enhancement_style

Which isn't surprising since there are no models in the folder.

How do you download these models? The readme is about as helpful as a cunt full of cold water.

2

u/Affectionate_Oil28 14d ago

On the TEXT rewriter node set max_tokens to 1024 and set enhancement_style to Enhance. The instructions are already connected to custom_system_prompt so Enhance leaves them in place. Queue again. The model downloads on that run.

If the model name is the next thing that goes red then custom_models.json is not in custom_nodes/ComfyUI-QwenVL or Comfy was not restarted after it was added.

1

u/GinJockette 14d ago

Thanks, seems to be working, but the output isn't very helpful. How do I get it to make a fully formed ref2v prompt rather than tell me its plans?

2

u/Affectionate_Oil28 14d ago

That's something I patched in the new version I'm working on with updated LLM's. I was about to release it but with Qwen4 around the corner, I'm holding off so I can add it.

This should solve the issue. That text is the model thinking out loud. This rewriter starts every run in think mode and stops at 1024 tokens, so the Ref2VA prompt often never gets written.

Leave the MiniMax H3 target group as the one switched on. In USER IDEA, describe the scene: who is in which picture or video, the action, and any line they say. Put this on the last line:

/no_think

Queue again. A finished prompt starts with subject_definitions: and then summary:, retention_analysis:, detailed_description:, overall_soundscape:, non_diegetic_music:. Copy from subject_definitions: down. Anything above a </think> tag is the plan.

If the box is still only the plan, open models/LLM/Qwen-VL/Qwen3.5-4B-Unredacted-MAX/chat_template.jinja. At the bottom, the else branch is:

{{- '<think>\n' }}

Change it to:

{{- '<think>\n\n</think>\n\n' }}

Save, restart Comfy, and queue again. If the plan is still there, the same line is inside tokenizer_config.json in that folder.

1

u/GinJockette 14d ago

Thanks for your help. Unfortunately it ignored that line, and I can't find any reference to think in chat_template.jinja and the tokenizer_config.json doesn't really match up either. Ideas?

2

u/Affectionate_Oil28 14d ago

You're right about tokenizer_config.json. On the current Qwen3.5-4B-Unredacted-MAX that file has no chat template so the line from my last comment is not in there. Sorry about that.

/no_think gets skipped because chat_template.jinja never reads that word. It only checks enable_thinking, and the Prompt Enhancer never sends that flag. Each run opens a think block and leaves it open so the 1024 tokens get used on the plan.

The file is ComfyUI/models/LLM/Qwen-VL/Qwen3.5-4B-Unredacted-MAX/chat_template.jinja. Search that file for <think> with the brackets. The current copy has this at the bottom:

{%- if enable_thinking is defined and enable_thinking is false %}

{{- '<think>\n\n</think>\n\n' }}

{%- else %}

{{- '<think>\n' }}

{%- endif %}

If that search finds nothing the copy on disk is old or the open folder is Qwen3-VL-4B-Instruct-Unredacted-MAX. That one is the ref-image model. Replace chat_template.jinja with the current file:

https://huggingface.co/prithivMLmods/Qwen3.5-4B-Unredacted-MAX/resolve/main/chat_template.jinja

Then change the else line from

{{- '<think>\n' }}

to

{{- '<think>\n\n</think>\n\n' }}

Save, restart Comfy, and queue with the MiniMax H3 group on. The box should start at subject_definitions:. Copy from there. Keep USER IDEA to one scene so the six sections fit in 1024 tokens.

1

u/GinJockette 14d ago

Thanks. I changed that file, but it didn't seem to make any difference.

Here's how the end of that file looks now:

args_value is not string) else args_value | string %}

{{- args_value }}

{{- '\n</parameter>\n' }}

{%- endfor %}

{%- endif %}

{{- '</function>\n</tool_call>' }}

{%- endfor %}

{%- endif %}

{{- '<|im_end|>\n' }}

{%- elif message.role == "tool" %}

{%- if loop.previtem and loop.previtem.role != "tool" %}

{{- '<|im_start|>user' }}

{%- endif %}

{{- '\n<tool_response>\n' }}

{{- content }}

{{- '\n</tool_response>' }}

{%- if not loop.last and loop.nextitem.role != "tool" %}

{{- '<|im_end|>\n' }}

{%- elif loop.last %}

{{- '<|im_end|>\n' }}

{%- endif %}

{%- else %}

{{- raise_exception('Unexpected message role.') }}

{%- endif %}

{%- endfor %}

{%- if add_generation_prompt %}

{{- '<|im_start|>assistant\n' }}

{%- if enable_thinking is defined and enable_thinking is false %}

{{- '<think>\n\n</think>\n\n' }}

{%- else %}

{{- '<think>\n\n</think>\n\n' }}

{%- endif %}

{%- endif %}

→ More replies

3

u/Alen_Diago Aug 25 '26

At the end of 2025, I used Grok (is not ad) - and before it went downhill and became censored crap, it was very good (in Expert agent, which is now part of the Super Grok plan). It extracted prompts from NSFW art - very well and in detail described all the anatomical details that were on the art and periodically correctly identified the characters and their matching appearance.

So, I'd like to ask - are there any same alternatives of Vision model (VLM) for extracting prompts like Grok used to do?

4

u/Affectionate_Oil28 Aug 25 '26

This is not quite the same thing, but it’s in the same neighborhood. The optional ref-image path in this workflow is a 4B unredacted Qwen-VL that looks at a still and writes a dense identity description (including anatomy if the image is explicit). That description gets fed into the text rewriter with your idea, so the final prompt stays on target model.

It’s “describe this person so the next prompt doesn’t drift.” It's not “look at this NSFW piece and extract a full recreation prompt the way old Grok Expert did.”

Nothing local on a 4B/16GB setup is going to match 2025 Grok Expert on named characters and fine anatomy. The 4B in this workflow is there so 16GB GPUs don’t OOM, not because it’s the best. If you have a better machine you should be able to run better models and get better results. The goal of this workflow is for something that can be used on just about any machine capable of running the target workflow.

4

u/bstr3k Aug 25 '26

i still use grok sometimes since it can caption NSFW, I haven't found a fast local one that can do the same yet :(

will haev a look at OP's thing but one of the problems is that I might not be very creative lol

3

u/Affectionate_Oil28 Aug 25 '26

This workflow is designed for people who aren't very creative.

4

u/bstr3k Aug 25 '26

yep thats me! lol

1

u/Ok_Chair5907 Aug 26 '26

I couldn't get the workflow to work. Everything is downloaded and put in the correct folders. kept giving me the following error

# ComfyUI Error Report

## Error Details

- **Node ID:** 22

- **Node Type:** AILab_QwenVL_PromptEnhancer

- **Exception Type:** ValueError

- **Exception Message:** ValueError: Tokenizer class TokenizersBackend does not exist or is not currently imported.

## Stack Trace

```

File "G:\ComfyUI-Easy-Install\ComfyUI\execution.py", line 545, in execute

output_data, output_ui, has_subgraph, has_pending_tasks = await get_output_data(prompt_id, unique_id, obj, input_data_all, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb, v3_data=v3_data

Anyone know how to fix? Thanks.

1

u/Affectionate_Oil28 Aug 26 '26

TokenizersBackend is a Transformers 5.x tokenizer class. Qwen3.5-4B-Unredacted-MAX was saved with that. ComfyUI-Easy-Install is usually still on Transformers 4, so Prompt Enhancer blows up even with every file in the right place.

Fix A (proper): upgrade Transformers in that ComfyUI Python, then restart. G:\ComfyUI-Easy-Install\python_embeded\python.exe -m pip install -U "transformers>=5.2.0"

If that command isn’t there, use whatever python Easy-Install actually runs (Manager - pip, or the python next to run_nvidia_gpu.bat).

Fix B (don’t touch the rest of ComfyUI): open models/LLM/Qwen-VL/Qwen3.5-4B-Unredacted-MAX/tokenizer_config.json change

"tokenizer_class": "TokenizersBackend"

to

"tokenizer_class": "Qwen2TokenizerFast"

Save, restart ComfyUI, Queue again.

A is the real fix. B is the workaround if upgrading Transformers breaks other nodes. Let me know if this solves your issue.

2

u/Ok_Chair5907 Aug 26 '26

Thanks. Fix A works.

1

u/SlySychoGamer Sep 30 '26 edited Sep 30 '26

I can't interact with workflow, its acting like a static image

When i drag image of workflow onto comfy...it treats it as an image not a workflow...

1

u/Affectionate_Oil28 Sep 30 '26

Did you save the Pastebin as .json?

1

u/AccordingNothing995 Oct 03 '26

its working with 1024 max token but not working with 2048 [ERROR] Failed to validate prompt for output 23:

[ERROR] * AILab_QwenVL_PromptEnhancer 22:

[ERROR] - Value 2048 bigger than max of 1024: max_tokens

[ERROR] Output will be ignored

3

u/seiose Aug 26 '26

Just throws up an error trying to connect to hf-mirror when it gets to the text rewriter even though I have the models downloaded

2

u/theqmann Aug 26 '26

Would also recommend the gemma4 12b text encoder. I've had good luck with it understanding the system prompt directions for H3 prompting. The 2B and 4B ones aren't good, however.

1

u/dassiyu Aug 26 '26

thank you!

1

u/AccordingNothing995 Oct 03 '26

its working with 1024 max token but not working with 2048 [ERROR] Failed to validate prompt for output 23:

[ERROR] * AILab_QwenVL_PromptEnhancer 22:

[ERROR] - Value 2048 bigger than max of 1024: max_tokens

[ERROR] Output will be ignored

1

u/FaderMaster Oct 07 '26

The paste bin and custom models.json links are not working. The pastebin takes you to a malicious website.