> ## Documentation Index
> Fetch the complete documentation index at: https://docs.comfy.org/llms.txt
> Use this file to discover all available pages before exploring further.

# MOSS-Image in ComfyUI: Text-to-Image and Layout Workflows

> Run MOSS-Image locally in ComfyUI: a 5B open-weights text-to-image model with a prompt enhancer and layout-guided generation from drawn bounding boxes.

## About MOSS-Image

MOSS-Image is OpenMOSS's open-weights text-to-image model: a 5B single-stream DiT that turns a full scene caption into one finished image. It is strongest where text and placement matter, because it renders English and Chinese typography, accepts prompts of up to about 4K tokens, and can read a JSON layout that says where each object and each line of text belongs. Weights ship under Apache 2.0, so you download once and run on your own GPU with no API key and no per-image credits.

The family has two checkpoints. The instruction-tuned **SFT** checkpoint is the one the templates load: it groups text and lays out scenes more cleanly. The **Base** checkpoint has no post-training or CFG distillation, which makes it the starting point for community LoRAs. Both run in the same graph, so switching checkpoints is a single loader change.

In ComfyUI the model runs from single-file checkpoints in int8 and bf16, with a Qwen3.5 9B text encoder loaded as type `moss_image` and the FLUX.2 small VAE. The text to image templates also ship a prompt enhancer that rewrites a short request into a full caption before sampling, using the same text encoder the model already needs.

**Model highlights:**

* 5B single-stream DiT with bilingual English and Chinese text rendering
* Native layout guidance: draw boxes, give each box a caption, and text boxes render their own text
* Prompt enhancer built into the text to image templates, so a one-line idea is enough
* Two checkpoints: SFT for cleaner layouts, Base for fine-tuning and LoRA work
* Long prompts of roughly 4K tokens, and any aspect ratio in multiples of 16

**License**: [Apache 2.0](https://github.com/OpenMOSS/MOSS-Image)

**Related links:**

* [GitHub](https://github.com/OpenMOSS/MOSS-Image)
* [Model guide (USERGUIDE)](https://github.com/OpenMOSS/MOSS-Image/blob/main/USERGUIDE.md)
* [Hugging Face (Comfy-Org)](https://huggingface.co/Comfy-Org/MOSS-Image)

**Version requirement**: MOSS-Image templates need ComfyUI 0.42.0 or later.

> [!TIP]
>
> **Local users**
>
> Make sure your ComfyUI is updated.
>
> * [Download ComfyUI](https://www.comfy.org/download)
> * [Update Guide](https://docs.comfy.org/installation/update_comfyui.md)
>
> Workflows in this guide can be found in the [Workflow Templates](https://docs.comfy.org/interface/features/template.md).
> If you can't find them in the template, your ComfyUI may be outdated.
>
> If nodes are missing when loading a workflow, possible reasons:
>
> 1. You are not using the latest ComfyUI version (Nightly version)
> 2. Some nodes failed to import at startup
>
> **Cloud users**
>
> * [Cloud](https://cloud.comfy.org) will update after ComfyUI stable release.
>
> So, if you find any core node missing in this document, it might be because the new core nodes have not yet been released in the latest stable version. Please wait for the next stable release.

## MOSS-Image workflows

All four templates run the same subgraph. Open it to reach the loaders, the sampler, and the canvas size.

> **[Learn about Subgraph](https://docs.comfy.org/interface/features/subgraph.md)**
>
> This workflow uses Subgraph nodes for modular processing. Check out the Subgraph documentation to learn how to customize and extend the workflow.

### MOSS-Image: Text to Image

Generate an image from a prompt alone, with no input files. The prompt enhancer is on, so a short description is expanded into a full caption before it reaches the model. The caption actually used is shown in `Preview Any`.

![MOSS-Image text to image workflow preview](https://raw.githubusercontent.com/Comfy-Org/workflow_templates/main/templates/image_moss_image_t2i-1.webp)

> **[Download Workflow](https://github.com/Comfy-Org/workflow_templates/blob/main/templates/image_moss_image_t2i.json)**
>
> Download JSON or search "MOSS-Image: Text to Image" in Template Library

#### Get started

1. Update ComfyUI to 0.42.0 or later
2. Go to **Template** and search for **MOSS-Image**
3. Select **MOSS-Image: Text to Image**
4. Download the models listed in [model downloads](#moss-image-model-downloads)
5. Enter your idea in the positive prompt and click **Queue**

### MOSS-Image Base: Text to Image

The same graph with the Base checkpoint loaded. Use it to compare raw output against the SFT checkpoint, or as the starting point for LoRA training.

![MOSS-Image Base text to image workflow preview](https://raw.githubusercontent.com/Comfy-Org/workflow_templates/main/templates/image_moss_image_base_t2i-1.webp)

> **[Download Workflow](https://github.com/Comfy-Org/workflow_templates/blob/main/templates/image_moss_image_base_t2i.json)**
>
> Download JSON or search "MOSS-Image Base: Text to Image" in Template Library

**Example output**

![MOSS-Image Base text to image example output](https://raw.githubusercontent.com/Comfy-Org/workflow_templates/main/output/image_moss_image_t2i_base.png)

#### Get started

1. Update ComfyUI to 0.42.0 or later
2. Go to **Template** and search for **MOSS-Image Base**
3. Select **MOSS-Image Base: Text to Image**
4. Download the models listed in [model downloads](#moss-image-model-downloads), including `moss_image_base_int8_convrot.safetensors`
5. Enter your idea in the positive prompt and click **Queue**

### MOSS-Image: Layout-Guided Text to Image

Generate an image from a prompt plus a layout you draw. Open `Create Bounding Boxes` and drag a box for each element; each box carries its own caption, and boxes marked as text render that text inside them. `MOSS-Image Layout Prompt` turns the boxes into the layout prompt the model reads, so the caption in the box and your scene prompt are both used.

Draw the background box first and the foreground elements last: boxes are emitted in the order you draw them. Each box is labelled `text` if you mark it as text, otherwise `object`. To label a box that holds a person as a character, list its number from the `Create Bounding Boxes` preview in `character_boxes` on `MOSS-Image Layout Prompt`, for example `1, 3`. Numbers that point at a text box have no effect. Both layout templates ship this field filled in (`2` in SFT, `1` in Base), so check it against your own boxes before queueing.

With at least one box connected, `MOSS-Image Layout Prompt` outputs a JSON prompt: a scene caption plus one item per box. The layout templates ship `enable_prompt_enhancer` off, so that JSON reaches the model unchanged. Turning it on lets the prompt enhancer rewrite the text, which can drop the boxes.

![MOSS-Image layout-guided text to image workflow preview](https://raw.githubusercontent.com/Comfy-Org/workflow_templates/main/templates/image_moss_image_t2i_bboxes-1.webp)

> **[Download Workflow](https://github.com/Comfy-Org/workflow_templates/blob/main/templates/image_moss_image_t2i_bboxes.json)**
>
> Download JSON or search "MOSS-Image: Layout-Guided Text to Image" in Template Library

**Example output**

![MOSS-Image layout-guided text to image example output](https://raw.githubusercontent.com/Comfy-Org/workflow_templates/main/output/image_moss_image_t2i_bboxes.png)

#### Get started

1. Update ComfyUI to 0.42.0 or later
2. Go to **Template** and search for **MOSS-Image** and pick the layout variant
3. Download the models listed in [model downloads](#moss-image-model-downloads)
4. Draw one box per element in `Create Bounding Boxes`, then type a caption for each box. For a text box, type the text you want rendered
5. Write the overall scene in the prompt and click **Queue**

### MOSS-Image Base: Layout-Guided Text to Image

The layout workflow with the Base checkpoint. Useful when you want to compare how the two checkpoints follow the same box layout.

![MOSS-Image Base layout-guided text to image workflow preview](https://raw.githubusercontent.com/Comfy-Org/workflow_templates/main/templates/image_moss_image_base_t2i_bboxes-1.webp)

> **[Download Workflow](https://github.com/Comfy-Org/workflow_templates/blob/main/templates/image_moss_image_base_t2i_bboxes.json)**
>
> Download JSON or search "MOSS-Image Base: Layout-Guided Text to Image" in Template Library

**Example output**

![MOSS-Image Base layout-guided text to image example output](https://raw.githubusercontent.com/Comfy-Org/workflow_templates/main/output/image_moss_image_t2i_bboxes_base.png)

#### Get started

1. Update ComfyUI to 0.42.0 or later
2. Go to **Template** and search for **MOSS-Image Base** and pick the layout variant
3. Download the models listed in [model downloads](#moss-image-model-downloads), including `moss_image_base_int8_convrot.safetensors`
4. Draw the boxes, caption each one, and write the scene prompt
5. Click **Queue**

## MOSS-Image model downloads

All files are in [Comfy-Org/MOSS-Image](https://huggingface.co/Comfy-Org/MOSS-Image) on Hugging Face. The templates load the int8 checkpoints; bf16 builds of both checkpoints are in the same repository for more VRAM.

> **[moss\_image\_sft\_int8\_convrot.safetensors](https://huggingface.co/Comfy-Org/MOSS-Image/resolve/main/diffusion_models/moss_image_sft_int8_convrot.safetensors)**
>
> Diffusion model, instruction-tuned checkpoint. Loaded by both SFT templates.

> **[moss\_image\_base\_int8\_convrot.safetensors](https://huggingface.co/Comfy-Org/MOSS-Image/resolve/main/diffusion_models/moss_image_base_int8_convrot.safetensors)**
>
> Diffusion model, Base checkpoint. Loaded by both Base templates.

> **[qwen3.5\_9b\_w4a8\_gptq.safetensors](https://huggingface.co/Comfy-Org/MOSS-Image/resolve/main/text_encoders/qwen3.5_9b_w4a8_gptq.safetensors)**
>
> Text encoder for every template. Load it with `CLIPLoader` type `moss_image`.

> **[flux2-vae\_small.safetensors](https://huggingface.co/Comfy-Org/MOSS-Image/resolve/main/vae/flux2-vae_small.safetensors)**
>
> VAE for MOSS-Image.

**Model storage location**

```
📂 ComfyUI/
├── 📂 models/
│   ├── 📂 diffusion_models/
│   │      ├── moss_image_sft_int8_convrot.safetensors
│   │      └── moss_image_base_int8_convrot.safetensors
│   ├── 📂 text_encoders/
│   │      └── qwen3.5_9b_w4a8_gptq.safetensors
│   └── 📂 vae/
│          └── flux2-vae_small.safetensors
```

> [!NOTE]
>
> The bf16 builds `moss_image_sft_bf16.safetensors` and `moss_image_base_bf16.safetensors` are in the same repository. Swap the checkpoint in `UNET Loader` if you have the VRAM for them.

## Prompting tips

* **Describe the finished image, not the request.** The model was trained on captions, so write what the picture looks like rather than an instruction like "make me a poster". The prompt enhancer follows the same rule, which is why a short prompt still works.
* **Base reads tag sequences.** With the prompt enhancer off, MOSS-Image-Base accepts comma-separated tags as well as captions, in the documented order: quality, score, meta, year, character, series, artist, then general tags, for example `best quality, highres, hatsune miku, vocaloid, @foo bar, 1girl, blue hair`.
* **Turn the prompt enhancer off to control the wording.** Set `enable_prompt_enhancer` to `false` on the subgraph node and your prompt goes to the model unchanged. With the prompt enhancer on, `prompt_enhancer_seed` changes how the prompt is rewritten. Both settings show the result in `Preview Any`, so you can compare.
* **Control line breaks yourself.** Automatic breaks may not land where you want them. Put real newlines or `\n` in the text you want rendered when the position of a break matters.
* **Use the layout workflow when placement matters.** Boxes give the model an explicit position for each element and each block of text, which is more reliable than describing positions in prose.
* **Keep the canvas in the recommended range.** `ResolutionSelector` picks the aspect ratio and the megapixel count (1 MP by default). 1 MP to 2 MP is the recommended output range and the model extrapolates from about 0.25 MP to 4 MP; width and height must be multiples of 16.
* **Start from the template settings, then go slower for the official look.** The templates run 25 steps at CFG 2.5 with the `er_sde` sampler. The official Base settings are 50 steps at CFG 3 with the `euler` sampler, so try those if a result is undercooked.
* **Raise CFG for short prompts on Base.** The official CFG range for MOSS-Image-Base is 3.0 to 6.0, above the 2.5 the templates ship. Turn the prompt enhancer off for a short prompt to reach the model, keep 3.0 for a long one, and raise it as needed.
* **Keep the negative prompt short.** The templates ship `nsfw, worst quality, bad anatomy, watermark, jpeg artifact`.
* **Skip layer guidance runs at layer 22.** The subgraph node carries an `SLG` toggle, and 22 is the official layer. Turning it off can look more realistic but may collapse detail; other layers are only reachable inside the subgraph.
* **Base is for fine-tuning.** When you train a LoRA on MOSS-Image, freeze the text encoder.

## Going above 2 MP

The recommended output range is 1 MP to 2 MP, and the model extrapolates to about 4 MP. Anything larger is outside that range, so build large images from successive passes instead of one big canvas.

The templates feed a fixed `Empty Flux 2 Latent` to the sampler, so this needs an edit inside the subgraph:

1. Render the first pass at 1 MP or 2 MP.
2. Decode the result, resize it in pixel space with `Upscale Image`, then encode it again with `VAE Encode`. Upscaling the latent resamples it directly and loses detail the second pass cannot recover.
3. Feed the encoded latent to the sampler in place of `Empty Flux 2 Latent` and set `denoise` to about 0.6 for a 1.5x step. Lower keeps the first pass intact, higher reworks the composition.

Repeat the resize and re-render instead of jumping to the final size. A single jump from 2 MP to 8K tends to repeat detail rather than add it, and an 8K canvas needs `VAE Decode (Tiled)`.

## Reference images and the prompt enhancer

The subgraph node has an optional `ref_image (for llm)` input. It reaches the prompt enhancer, not the diffusion model: MOSS-Image has no image input, so it cannot copy a reference. With the prompt enhancer on, the image shapes the caption it writes; with the prompt enhancer off, the image is ignored.

The prompt enhancer runs on the Qwen3.5 text encoder the model already loads, through `Generate Text`, with a system prompt written from the official MOSS-Image prompt enhancer skill. Its output length is `max_length`, 4096 tokens in the templates. In the `MOSS-Image: Text to Image` and `MOSS-Image Base: Text to Image` templates, `prompt_enhancer_seed` reproduces a caption, and `Preview Any` shows the text that actually reaches the sampler.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.