---
title: MOSS-Image
canonical_url: "https://www.modelscope.cn/studios/nativexi/MOSS-Image"
md_url: "https://www.modelscope.cn/studios/nativexi/MOSS-Image.md"
repository: nativexi/MOSS-Image
last_updated: 2026-10-22
sdk_type: gradio
sdk_version: 6.29.1
downloads: 0
stars: 0
---

# MOSS-Image

> MOSS-Image - nativexi 在 ModelScope 创建的在线 Demo。&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;

nativexi/MOSS-Image 是 ModelScope 魔搭社区上的在线可交互 Demo（创空间），基于 gradio 6.29.1 构建。

- **Repository**: nativexi/MOSS-Image
- **SDK**: gradio
- **SDK version**: 6.29.1
- **Downloads**: 0
- **Stars**: 0
- **Last updated**: 2026-10-22

Source: https://www.modelscope.cn/studios/nativexi/MOSS-Image

---

[![Built with ML Intern](https://huggingface.co/datasets/huggingface/badges/resolve/main/built-with-ml-intern-sm.svg)](https://hf.co/chat?mode=ml-intern)

# MOSS-Image Workflow

<p align="center">
  <a href="https://huggingface.co/OpenMOSS-Team/MOSS-Image-Base"><img alt="Hugging Face · MOSS-Image-Base" src="https://img.shields.io/badge/🤗%20Hugging%20Face-MOSS--Image--Base-ffc107?style=flat-square"></a>
  &nbsp;
  <a href="https://huggingface.co/OpenMOSS-Team/MOSS-Image-SFT"><img alt="Hugging Face · MOSS-Image-SFT" src="https://img.shields.io/badge/🤗%20Hugging%20Face-MOSS--Image--SFT-ffc107?style=flat-square"></a>
  &nbsp;
  <a href="https://modelscope.cn/models/openmoss/MOSS-Image-Base"><img alt="ModelScope · MOSS-Image-Base" src="assets/modelscope-base-badge.svg"></a>
  &nbsp;
  <a href="https://modelscope.cn/models/openmoss/MOSS-Image-SFT"><img alt="ModelScope · MOSS-Image-SFT" src="assets/modelscope-sft-badge.svg"></a>
  &nbsp;
  <a href="https://github.com/OpenMOSS/MOSS-Image"><img alt="GitHub" src="https://img.shields.io/badge/GitHub-Code-181717?style=flat-square&amp;logo=github&amp;logoColor=white"></a>
  &nbsp;
  <a href="https://openmoss.github.io/MOSS-Image/"><img alt="Homepage" src="https://img.shields.io/badge/🌐%20Project-Homepage-2563eb?style=flat-square"></a>
  &nbsp;
  <a href="https://github.com/OpenMOSS/MOSS-Image/blob/main/paper/MOSS_Image_Technical_Report.pdf"><img alt="Technical Report" src="https://img.shields.io/badge/📄%20Paper-Technical_Report-b31b1b?style=flat-square"></a>
  &nbsp;
  <a href="https://x.com/Open_MOSS"><img alt="Follow OpenMOSS on X" src="https://img.shields.io/badge/Follow-OpenMOSS-000000?style=flat-square&amp;logo=x&amp;logoColor=white"></a>
  &nbsp;
  <a href="https://qm.qq.com/q/hphM7VhaDu"><img alt="MOSS-Image QQ 交流群：755535143" src="https://img.shields.io/badge/QQ-755535143-12B7F5?style=flat-square&amp;logo=qq&amp;logoColor=white"></a>
  &nbsp;
  <a href="https://applink.feishu.cn/client/chat/chatter/add_by_link?link_token=7a3m2007-815f-409b-9c3d-a4129f5c058e"><img alt="MOSS-Builders Feishu Community" src="assets/feishu-builders-badge.svg"></a>
  &nbsp;
  <a href="https://discord.gg/nXFWEyvbb"><img alt="MOSS-Image Discord Community" src="https://img.shields.io/badge/Discord-Community-5865F2?style=flat-square&amp;logo=discord&amp;logoColor=white"></a>
</p>

A [Gradio Workflow](https://www.gradio.app/guides/workflows) (node-canvas) version of the official
[OpenMOSS-Team/MOSS-Image](https://huggingface.co/spaces/OpenMOSS-Team/MOSS-Image) demo, built on
`gr.Workflow` in gradio 6.30.0, with the App view styled after the MOSS-Image landing page.

## Feature parity with the official demo

Every sampling control of the original Space is a reference node wired into the
`MOSS-Image Generate` function node:

| Original demo | Here |
|---|---|
| Model dropdown (Base / SFT) | **Model** reference (`base` or `sft`); both checkpoints loaded at startup |
| Prompt / Negative Prompt | **Prompt** / **Negative Prompt** references (same default text) |
| Width × Height (presets) | **Width** / **Height** references (multiples of 16) |
| Steps / CFG / Shift / Seed | **Steps** / **CFG** / **Shift** / **Seed** references (`-1` = random) |
| Images per prompt | **Images** reference → gallery output |
| Max text length | **Max Text Length** reference (1–4096) |
| Skip-layer modes (Off / Negative-branch skipping / Standard SLG) | **Skip Layers** (`22` = negative-branch skipping, empty = off), **SLG Layers**, **SLG Scale**, **Skip Start**, **Skip Stop** references |
| Example gallery with one-click restore | **Examples strip** under the hero: the original Space's 20 showcase images, hot-linked; clicking one fetches its `parameters.json` and restores prompt, model, size, sampling and SLG settings into the form |

Not ported: showcase add/delete with live refresh (the Workflow App view is
generated from the graph and has no upload-to-gallery mechanism), and ZeroGPU AOT
compilation (this app runs the eager backend — set it up like the original if you
need the extra speed).

## Design

The App view is auto-generated by `gr.Workflow`, so the landing-page look is applied
through `launch(theme=…, css=…, head=…)`: Inter type, a light gradient canvas, the
official MOSS-Image lockup (light/dark aware) above the
"Text-to-Image Generation with Native Layout Control" headline, a top nav with
model/code links, and a Soft blue theme. The canvas view is untouched.

## Running it

Generation runs on GPU via `@spaces.GPU(duration=80)` per node call, so this Space needs
**ZeroGPU hardware** (Settings → Hardware). `hf_oauth: true` is enabled so the owner can edit the
canvas and signed-in visitors spend their own ZeroGPU quota; anonymous visitors fall back to the
small shared allowance.

Local development:

```bash
pip install -r requirements.txt
python app.py                           # full run, needs a CUDA GPU
MOSS_WORKFLOW_PREVIEW=1 python app.py   # canvas + styling only, no model download
```

The bundled `pipeline_moss_image.py` is copied verbatim from the
[original Space](https://huggingface.co/spaces/OpenMOSS-Team/MOSS-Image) (BSD 3-Clause); model
weights are Apache-2.0. The lockup artwork is hot-linked from the original Space's assets.
The form is prefilled with showcase example 007 (the photorealistic Kazusa at
a Tokyo crosswalk: 1184×1776, 50 steps, CFG 3, shift 5, skip layer 22, seed
3537712559) so visitors can just hit **Run** and reproduce it exactly. Other
defaults match the official demo: Euler sampling and negative-branch skipping.

## API example

```python
from gradio_client import Client

client = Client("akhaliq/moss-image-workflow")
client.view_api()  # exact parameters of /generated_images
```
