返回资讯中心
外部精选
软件工程
#开发者实时流

Moss-Image: Text-to-Image Generation with Native Layout Control

MOSS-Image is a text-to-image model family from OpenMOSS, comprising a base model and a curated-data fine-tuned model. In addition to natural-language prompts, MOSS-Image supports native text-driven layout generation: o…

Hacker News 最新b0ner_t0ner2026/10/17 · 20 天前14 分钟阅读

以下正文同步自 Hacker News 最新,版权归原站所有,已转换为易读排版。

MOSS-Image is a text-to-image model family from OpenMOSS, comprising a base model and a curated-data fine-tuned model. In addition to natural-language prompts, MOSS-Image supports native text-driven layout generation: objects, rendered text, and their spatial positions can be specified in a JSON prompt. The family combines a compact 5B backbone, prompts of up to 4K tokens, strong text rendering, and versatile anime and photorealistic styles. Python and Gradio interfaces use a shared Diffusers pipeline.

Code MOSS-Image-Base MOSS-Image-SFT ModelScope · Base ModelScope · SFT User Guide Follow OpenMOSS ↗ QQ Group · 755535143 ↗ Feishu · MOSS-Builders ↗ Technical Report ↗

News

October 16, 2026 — Introducing MOSS-Image-Base, with code and model weights available.

Layout control, strong text rendering, prompts of up to 4K tokens, anime and photorealistic styles, and a 5B backbone designed for efficient generation and fine-tuning. Training uses heterogeneous GPU platforms.

Text-to-Image Generation

Generate images from natural-language descriptions with MOSS-Image-Base or MOSS-Image-SFT, using a shared inference interface.

Native Layout Control

Specify a scene, its objects, and text with a structured JSON prompt. Bounding boxes describe the position and size of individual elements.

Compact, Adaptable Backbone

A 5B backbone supports prompts of up to 4K tokens and fine-tuning for custom tasks and domains. Model weights are licensed under Apache-2.0.

Text, illustration, photography and visual design, composed as in the project showcase. Open either image to explore it at full resolution.

Layouts also support controlled editing and user-friendly layout tools. Edit text, element descriptions and bounding boxes to adjust image content and composition in a structured way.

MOSS-Image accepts layout specifications through the same prompt interface used for text-to-image generation. The generated result below illustrates layout control; the JSON example that follows describes a travel poster with a title and a mountain illustration.

Bounding-box visualization · input specification only

{ "summary": { "meta": ["poster"], "canvas": "single", "caption": "A minimalist travel poster with a cream background, a blue mountain illustration, and the title EXPLORE at the top." }, "items": [ { "label": "text", "caption": "Large dark-blue uppercase title centered at the top.", "text": "EXPLORE", "bbox": [-416, -384, -288, 384] }, { "label": "object", "caption": "A flat blue mountain illustration in the lower center.", "bbox": [-192, -288, 384, 288] } ], "bbox_coord_space": "abs_centralized", "bbox_format": "yxyx" }

Coordinates follow [y_min, x_min, y_max, x_max] and are measured in pixels relative to the canvas center. The diagram visualizes the input layout, not a model-generated result.

Run this layout examplePaste the JSON above into Gradio’s Prompt field and set width and height to 1024. With the Python pipeline below, load the JSON and pass it as the prompt:

import json from pathlib import Path

layout = json.loads(Path("layout.json").read_text()) image = pipe( json.dumps(layout, ensure_ascii=False), height=1024, width=1024, num_inference_steps=50, guidance_scale=3.0, uncond_skip_layers=[22], generator=torch.Generator("cpu").manual_seed(42), ).images[0] image.save("layout.png")

Models

The two checkpoints share the same architecture and sampling interface.

Weights: Apache-2.0. The pipeline code and third-party components retain their respective licenses.

In this example, SFT produces clearer text grouping and a more organized whiteboard layout.

Use Python 3.10+ and an NVIDIA GPU. In a dedicated Python environment, install a PyTorch build compatible with your CUDA environment, then run:

git clone https://github.com/OpenMOSS/MOSS-Image.git cd MOSS-Image python -m venv .venv source .venv/bin/activate

pip install -r requirements.txt

Python · DiffusersCopy Python

import torch from diffusers import DiffusionPipeline

pipe = DiffusionPipeline.from_pretrained( "OpenMOSS-Team/MOSS-Image-Base", custom_pipeline="pipeline_moss_image", trust_remote_code=True, torch_dtype={"default": torch.bfloat16, "vae": torch.float32}, ) pipe.scheduler = type(pipe.scheduler).from_config(pipe.scheduler.config) pipe.to("cuda") image = pipe( "A wide view of a refrigerator beside a kitchen counter with a fruit bowl. A small sticky note on the refrigerator door is handwritten in Chinese:“\n记得买牛奶和鸡蛋!\n牛奶两盒,鸡蛋一打。\n顺便带一袋面包。”", height=1456, width=1456, num_inference_steps=50, guidance_scale=3.0, uncond_skip_layers=[22], generator=torch.Generator("cpu").manual_seed(42), ).images[0] image.save("refrigerator_note.png")

For prompts, layout inputs and LoRA training guidance, see the English user guide or 中文用户指南.

pip install -e '.[ui]' python gradio_app.py --model OpenMOSS-Team/MOSS-Image-Base

Advanced settings offer GPU resident, Component, and Sequential memory modes. If memory is insufficient, select Sequential or reduce image size. Compile DiT is disabled by default and unavailable in Sequential mode.

Install the native plugin by searching for MOSS-Image in ComfyUI Manager. Integration into the official ComfyUI repository is in progress.

Installation and usage ↗ · Example workflow ↗

Turn image ideas into detailed captions or spatial Layout prompts with the MOSS-Image Prompt Enhancer skill, designed for GPT-6-family agents with local file and Python tools.

The bundled script converts pixel-coordinate drafts into compact JSON with integer centered coordinates. It prepares prompts without calling an image-generation service.

If you use MOSS-Image in your research, please cite the project repository.

正文由 探How 从来源站点 RSS 同步,内容未经改写;遇到排版缺失或需要图片、视频时请以原文为准。

打开原文
去社区讨论 →