CivArchive
    Moss Prompt Enhancer node for ComfyUI - v2.0
    NSFW
    Preview 148219889

    ver. 2.0

    MOSS-Image is a model that performs best when its prompts are properly optimized using an LLM. I previously released "ver. 1.0," which featured a ComfyUI node based on my "Prompt Enhancer" tool; for this version, I have added an "additional editing" mode to make it even easier to use. While this is not an image-based "edit" function in the traditional sense, it allows for a more informal, prompt-driven adjustment of the output. For instance, simply adding a phrase like "from side" to an existing prompt often fails to produce the desired change?usually because the model needs to consider the entire prompt to understand the context. This new process rewrites the full prompt based on your instructions, ensuring the final output accurately reflects your intent. (Qwen3.5-9B is quite capable in this regard.) Please note that because this approach relies on prompts, you should not expect the original image to be strictly preserved.

    You can also chain multiple operations together by feeding the raw_response into subsequent steps.

    Additionally, I have created a node that allows you to process existing prompts in bulk using the Prompt Enhancer. A command-line tool, batch_enhance.py, is also included.

    Basic Usage

    There are two modes: "caption" and "layout." Use "caption" mode for general tasks, and "layout" mode if you wish to change the arrangement of elements within the image.

    Once connected properly, enter your prompt text and execute the process; the prompt will be refined and saved as an "idea" (displayed in the second text box from the bottom). All subsequent instructions are based on this refined "idea."

    The area above the "idea" section is where you enter your instructions. You may use any language that Qwen3.5 understands. While the model can generally handle various languages ??for image generation prompts, using English will yield higher accuracy. You can specify the Output_Language, though in most cases, the default setting is sufficient. There is generally no need to adjust any of the other parameters. repeat_attempts specifies the number of retries to perform if a process fails; you may occasionally need to adjust this value.

    While such rare exceptions exist, generally speaking, the only setting you need to concern yourself with is mode?specifically, choosing between caption and layout.

    The typical workflow involves starting with an initial prompt, then refining it by providing further instructions based on the results. Once an "idea" (internal representation) has been generated, the original prompt is no longer referenced?unless the "idea" field is left blank or the input prompt is modified. Subsequent processing is based on this "idea."

    You can provide instructions as many times as you like. Once you have finalized an instruction, be sure to click the "Update Internal Idea" button. If you skip this step, any new instructions will be applied as if the previous changes never occurred. It is best to proceed one step at a time; for instance, it is generally better to complete any caption-related changes before moving on to layout adjustments. You will see why once you try it: running the layout mode significantly alters the "idea" (and the output prompt).

    Here is an example: I took a photo of a Eurofighter found online, generated a caption using Florence-2, and then used MOSS-Image to create an image. For some reason, the canopy ended up open, and the jet?despite being a jet?appeared with four propellers.

    By entering the instruction "shut the cockpit door," the canopy was closed.

    Next, I entered:

    "delete the propellers"

    The propellers disappeared, but the canopy opened again?this happened because I hadn't updated the "idea." By clicking the "Update Internal Idea" button, I could then continue editing from the state where the propellers were gone and the canopy was open.

    I then entered:

    "shut the cockpit door"

    ...to close the door once more, completing the process.

    Next, let's try moving the aircraft to the right side.

    Remember to update the "idea," switch to layout mode, and enter the instruction:

    "place the jet on the right side"

    It successfully moved to the right. Since it also became a bit smaller, I provided another instruction (after updating the "idea" again). "Move the jet a bit more toward the center, and make it quite large".

    With this, I have obtained an image that more or less matches what I envisioned.

    Unlike the operations performed with so-called "edit-based" models, the images generated can vary significantly from one attempt to the next. Nevertheless, I believe this approach is useful, as it allows you to eventually arrive at a prompt that produces the desired result?though a major drawback is that the processing is extremely slow. You can retrieve the prompt from the text box at the very bottom, or via the raw_response socket.

    Note:

    Since control is handled through prompts, the outcome depends entirely on the specific model being used. While MOSS-Image responds relatively well to these types of instructions, it does not follow every single command, and other models will not necessarily behave in the same way. This is also the reason why I have kept the model training for MOSS-Image as lightweight as possible.

    ver.1.0

    This is a custom node for ComfyUI that functions as a "prompt enhancer"—a tool officially provided as a "skill"—by running the Qwen3.5-9B text encoder as a local LLM. While similar nodes already exist, this implementation allows for the kind of connection shown in the sample; you can simply bypass the node to revert to standard processing.

    For testing, I used the workflow found here (https://civarchive.com/models/3005854/simple-workflow-for-moss-image?modelVersionId=3416316) as a base—though since I’m not using "Node 2.0," that choice didn't really matter. Perhaps it’s time I finally made the switch?

    The package also includes a "compile" node that converts JSON-saved prompts back into plain text, though this is rarely needed for typical use. It’s primarily useful if you need to manually edit the output coordinates—for instance, when working in "layout mode." The draft_json output uses an XY coordinate system with the origin at the top-left, whereas the data actually passed to the model uses a YX coordinate system with the origin at the center. Since the Y-coordinate coming first might be confusing, it’s best to use the dedicated "editing JSON" if you need to make manual adjustments. And, just in case you were wondering: no, using coordinate values ​​won't actually guarantee precise placement—that’s just an illusion!

    Incidentally, while I built this for ComfyUI, it doesn't offer much improvement for standard captioning; the model generally handles simple tag-based prompts just fine on its own. Its main utility lies in layout-based tasks, though I’ve confirmed that it can produce solid results even without the prompt enhancer. Since it’s an official tool, it may be intended for other use cases—such as providing instructions in a conversational tone. It might not be particularly relevant for those who write their own prompts from scratch, but consider it another option to have in your toolkit.

    Tips

    - Please refer to the README file included in the zip archive for installation instructions and other details.

    - You may use any language for your input, but please ensure the output language is set to English.

    - There are many parameters; if you are unsure what they do, please leave them as they are—I don’t know what they do either!

    - When using the "Compile" node, you will need to reroute the connections from the two "Reroute" nodes located before the "Positive Prompts." You can do this without opening the nodes by clicking and dragging from the small dot (●) that appears on the side of each "Reroute" node, then connecting it to the area just below the "P" in "Positive."


    Example output of draft_json

    {
      "width": 1536,
      "height": 1024,
      "bbox_coord_space": "abs",
      "bbox_format": "xyxy",
      "summary": {
        "caption": "A minimalist horizontal advertisement poster for matcha latte in a Japanese-style cafe setting, featuring warm ivory background and deep green typography with ample white space for an elegant mood."
      },
      "items": [
        {
          "label": "object",
          "caption": "A large white ceramic cup filled with matcha latte, positioned slightly to the left of center in the lower-left quadrant, captured from a high angled view showing the surface and latte art, illuminated by soft natural light with subtle shadows.",
          "bbox": [
            128,
            384,
            768,
            896
          ]
        },
        {
          "label": "text",
          "caption": "Large deep green heading text reading 抹茶の時間 located in the upper-right area against the ivory background.",
          "bbox": [
            896,
            128,
            1408,
            320
          ],
          "text": "抹茶の時間"
        },
        {
          "label": "text",
          "caption": "Small deep green explanatory text in two lines reading 香りを楽しむ on the first line and ひと休み。on the second line, positioned directly below the heading.",
          "bbox": [
            896,
            352,
            1408,
            544
          ],
          "text": "香りを楽しむ\nひと休み。"
        },
        {
          "label": "text",
          "caption": "Medium-sized deep green price text reading 650円 located in the bottom-right corner.",
          "bbox": [
            896,
            832,
            1408,
            960
          ],
          "text": "650円"
        }
      ]
    }

    Description

    FAQ

    Other
    MOSS Image

    Details

    Downloads
    37
    Platform
    CivitAI
    Platform Status
    Available
    Created
    11/7/2026
    Updated
    11/8/2026
    Deleted
    -

    Files

    ComfyUI-MOSS-Prompt-Enhancer.zip

    Mirrors