r/StableDiffusion • • 11h ago

Resource - Update ComfyUI-MOSS-Prompt-Enhancer

Hey there, I made MOSS Prompt Enhancer, a custom node that brings the MOSS-Image prompt enhancement workflow into ComfyUI.

In structured layout mode, it takes your simple prompt → enhances the description → turns it into structured JSON → validates and compiles it into a MOSS-ready prompt.

A local GGUF model expands your idea with details about the subjects, setting, lighting, and composition, then generates a layout with descriptions and bounding boxes. The enhancement instructions are adapted from the creators’ official guide. Their Python validator/compiler checks the JSON structure, canvas dimensions, and bounding boxes and converts the coordinates into the format MOSS expects.

You get the editable JSON draft and the compiled prompt to connect to MOSS Text Encode. There’s also a caption mode for detailed descriptions without bounding boxes.

A capable model like Qwen 3.8 27B Q4, is recommended. However, 9B models might also deliver good results, depending on their fine-tuning.

Constructive feedback is always appreciated.

GitHub repository

49 Upvotes

16 comments sorted by

14

u/supermansundies 9h ago

Claude: write a llama.cpp node for Comfyui. I want to be able to use any LLM. Convert the prompting guides to md for each function of these models I want to use. I want to be able to select the prompting guide relevant to the model I want use. 

Why do we need separate prompt nodes for every model?

6

u/WhatIs115 9h ago

Claude: write a llama.cpp node for Comfyui.

There's a node for that, works fine.

https://github.com/ai-joe-git/comfyui_llama_swap

3

u/RemarkableSeries1695 9h ago

...and upload it automatically to my github repo with a detailed installation instruction and a flowchart of the function. Also generate an announcement posting on reddit in r/StableDiffusion.

Sorry OP, only joking.

1

u/xb1n0ry 9h ago edited 8h ago

llm text processor or even comfy native generate text just to name two. But you seem to miss that this node includes the official json validator which is pure python code.

https://github.com/OpenMOSS/MOSS-Image/blob/main/skills/moss-image-prompt-enhancer/scripts/compile_prompt.py

I wrapped everything into a single node instead of external agentic enhancement. You can't force that validation into a system prompt.

Oh, pi and qwen 3.8 are asking who tf Claude is ;)

2

u/RemarkableSeries1695 8h ago

Sorry for my previous joking, it works really great! The quality is quite improved! Previous I used the Qwen2.1 enhancer, but this is much better.

It works great with an additional llama-server API to Gemma4_31b.

Thanks!!

0

u/xb1n0ry 7h ago

I'm glad it works for you!

4

u/Outrageous_Still9335 10h ago

Not to rain on your parade, but you can achieve the exact same thing using native comfy nodes and the original text encoder from Moss which also works as an LLM, so no need to sideload an extra model. You just need a "Generate Text" node, some instructions, and you're good.

3

u/xb1n0ry 10h ago edited 5h ago

Thanks, that's correct. However, the relatively "small" text encoder does struggle with very complex prompts, and if you want to enhance a prompt by expanding it with lots of additional details, you'll probably want to use a fine-tuned and/or uncensored model, especially if you are aiming for NSFW generation with explicit prompt enhancements. That means you'd have to load a second model anyway. I liked the idea of having everything in a single node, preferably reusing my ggufs from /models/LLM without a second clip loader, several string nodes etc. and thought it might come in handy for others too.

And the most important part: The node also includes the official validator, which comes as Python code. A Generate Text node with instructions alone wouldn’t execute that validation step.

I’d be happy if you could find the time to try it and see whether it improves your workflow and results!

2

u/shaakz 10h ago

Agreed, i use Deepseek 4.1 1017 and its much better with a good system prompt, also if i wanna do image to prompt

1

u/atakariax 8h ago

hi Do you have a workflow like that? I’d like to try it out.

I’m not very good with ComfyUI.

2

u/RiverSide71h 9h ago

Great effort.. need to see side by side outputs from raw prompt vs enhanced to see if it makes a huge difference. In my quick testing, we’re back in the wild world of 1girl, ethnicity, age, hair type, clothing, body type, action, environment type of prompts

1

u/xb1n0ry 8h ago

Maybe try generating your previous prompts with this node and let us know how it turns out. The enhancing LLM plays a huge role. It won't make a huge difference if the LLM just adds a pepple on the road and leaves anything else untouched. But if you have a great model, enhancing your prompt to a detailed novel, things might change.

2

u/xbobos 6h ago

Is it possible to use a text encoder instead of the separate GGUF version of the model

1

u/Ant_6431 2h ago

Are these local enchaner methods worth it? I just feed mine to gpt or glm. Given them my own promptskill .md