Instructions to use OpenMOSS-Team/MOSS-Image-SFT with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use OpenMOSS-Team/MOSS-Image-SFT with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("OpenMOSS-Team/MOSS-Image-SFT", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Draw Things
- DiffusionBee
Text rendering notes from 8 scenes / 131 images, plus a free visual editor for compile_prompt.py layout drafts
Hi MOSS team and everyone, thanks for releasing MOSS-Image. Its layout-aware text rendering is the main reason we've been testing it. Below are two things that might help other users get the text right: a small open-source layout editor, and notes from a hand-checked text test.
Disclosure: We're not affiliated with OpenMOSS. The editor is free, Apache-2.0, and has no tie to the site.
1. A visual editor for layout drafts
The repo already ships skills/moss-image-prompt-enhancer/scripts/compile_prompt.py, which turns a layout draft (top-left pixel boxes, xyxy) into the compact prompt JSON (abs_centralized, yxyx). There wasn't a visual way to build that draft, so we made one:
- Draw, move and resize
text/object/characterboxes on a canvas (width/height in multiples of 16) - Edit each item's caption and literal text (line breaks are kept), plus summary, meta, canvas type and palette
- Optional reference image layer under the boxes, e.g. a previous MOSS-Image output, so you can adjust boxes against it. It stays in the browser and is not part of the prompt.
- Export the draft JSON, or copy the compiled prompt
- The compiler is a TypeScript port of
compile_prompt.py, withtest_compile_prompt.pyported as tests. It was verified against commita211e398, and the output matches the official script exactly. - Static page: no generation, no uploads, no account. Paste the prompt into your own pipeline (diffusers, ComfyUI, SGLang, etc.). EN / 中文 UI.
Space: https://huggingface.co/spaces/ferry309/moss-image-layout-editor
Code: https://github.com/moss-image-community/moss-image-layout-editor
2. What we saw in a text and design test
Setup: 8 everyday scenes (bilingual menu, night-market poster, coffee packaging, book cover, social graphic, four-panel comic, anime scene, portrait). We ran each as a short prompt, with automatic prompt expansion, and with planned text and layout. That gave 131 saved original images in total. We ran it on a hosted MOSS-Image endpoint with default settings, and judged results by hand: no OCR scoring, no repeated seeds. It's a small sample, not an accuracy benchmark.
- Short prompts break on text-heavy layouts. The menu came out with a garbled extra title, the book cover got extra text resembling an author credit, the social graphic had large areas of garbled text, and the comic dialogue was garbled. With prompt expansion, all four were readable. The poster and packaging were fine even with short prompts. The anime and portrait scenes have no required text.
- Expansion can add text you didn't ask for, like the extra menu title. Check it even when it's readable.
- Quote every required string exactly (titles, names, prices, dates, dialogue). You don't need type specs: spelling out stroke contrast, counters and terminals did not reliably beat one sentence describing the title's overall shape.
- Give wide or long titles enough box width, or break them onto two lines. Narrow boxes squeezed wide letterforms.
- When you remove text, remove its description too, or the old words can come back.
- Adding a line after the fact is unreliable. Even with a text box and the line repeated in the prompt, some results left it out. It worked better when we also described how the new line relates to the image, e.g. "below the title, in the same thin gold type".
- A fixed seed keeps the layout, not the pixels. Changing a cover title from "The Quiet Harbour" to "The Silent Bay" (880 × 1184, seed 7) rendered the new title correctly but also changed the boat's outline. In the edit timing test (8 runs), regenerating with a fixed seed had a median wait of 14.9 s (range 13.5–23.9 s). Deleting text changed the base, water flow and bottle details.
- Dedicated edit models aren't side-effect-free either. One changed an untouched
$38to$883 times across 8 runs. After any edit, check the prices, names and background you didn't touch. - Generated lettering imitates a style. Naming a typeface doesn't load a font. For an exact wordmark, set the final type in a layout tool.
Full write-up with original-size images, tables and methods: https://mossimages.com/research/moss-image-text-accuracy/?utm_source=huggingface&utm_medium=referral&utm_campaign=moss_image_research
Feedback on the editor is very welcome, especially if any draft compiles differently from the official script. Open an issue on GitHub or reply here.
