File size: 11,941 Bytes
3c27d1d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b36366a
3c27d1d
b36366a
3c27d1d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b36366a
3c27d1d
 
 
b36366a
 
 
 
3c27d1d
 
b36366a
 
 
 
3c27d1d
 
b36366a
 
 
 
3c27d1d
 
 
 
 
 
 
 
 
 
 
 
b36366a
 
3c27d1d
 
 
 
 
b36366a
 
3c27d1d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b36366a
3c27d1d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b36366a
3c27d1d
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
---
license: other
license_name: mg-by-nc-2.0
license_link: https://ids.nus.edu.sg/docs/modelgo/v2/MG-BY-NC/LICENSE
library_name: prismflow
pipeline_tag: text-to-image
tags:
  - text-to-image
  - flow-matching
  - pytorch
  - comfyui
base_model:
  - google/t5gemma-2-1b-1b
---

# prismflow_2b research preview

<!-- CURRENT RELEASE: begin. Rewrite this warning for each release; keep it a
     WARNING block while the model is a preview. Older releases are described
     in the "Training history" table below, not here. -->

> [!WARNING]
> **Research preview, version 0.06. This is not a user-ready model.**
>
> These weights are an early training checkpoint: about two passes over the
> training images, trained at low resolution only (256 px, with 10% of
> batches at 384 px). The model has never seen an image larger than the
> 384-px buckets (about 0.15 megapixel).
>
> It is published to show the architecture and how it trains. For a more
> mature model from the same project, see
> [dflow_2b](https://huggingface.co/data-archetype/dflow_2b).

<!-- CURRENT RELEASE: end -->

prismflow_2b is an indie text-to-image model, trained from scratch on a single
GPU. It is like its sibling
[dflow_2b](https://huggingface.co/data-archetype/dflow_2b) (same autoencoder,
training objective and most of the recipe) but with a different 2-billion-parameter
architecture: shared-parameter cross-attention to the prompt, 16 register
tokens, and time-modulated
[Block Attention Residuals](https://arxiv.org/abs/2603.15031) (Block AttnRes):
at each of 7 block boundaries, a learned, timestep-dependent softmax over the
input embedding and the earlier blocks' outputs replaces the plain residual sum.

It takes ordinary captions and JSON layout captions. The layout format is close
to [MOSS-Image](https://github.com/OpenMOSS/MOSS-Image)'s, and MOSS-Image
layouts are converted internally.

The package contains the weights, the `prismflow` inference code and ComfyUI
nodes.

[Example gallery](GALLERY.md) · [Manual](MANUAL.md) ·
[Technical report](TECHNICAL_REPORT.md) · [Release notes](RELEASES.md)

**Samples after two low-resolution epochs, single shot (no seed picking), reusing [dflow_2b](https://huggingface.co/data-archetype/dflow_2b)'s gallery prompts.**

<table>
  <tr>
    <td><a href="https://huggingface.co/data-archetype/prismflow_2b_research_preview/blob/main/GALLERY.md#boardwalk"><img src="assets/gallery/0.06/boardwalk.png" width="220" alt="Boardwalk to a rugged coast"></a></td>
    <td><a href="https://huggingface.co/data-archetype/prismflow_2b_research_preview/blob/main/GALLERY.md#cat_grass"><img src="assets/gallery/0.06/cat_grass.png" width="220" alt="Tortoiseshell cat in tall grass"></a></td>
    <td><a href="https://huggingface.co/data-archetype/prismflow_2b_research_preview/blob/main/GALLERY.md#rooster"><img src="assets/gallery/0.06/rooster.png" width="220" alt="Rooster among tropical plants"></a></td>
    <td><a href="https://huggingface.co/data-archetype/prismflow_2b_research_preview/blob/main/GALLERY.md#man"><img src="assets/gallery/0.06/man.png" width="220" alt="Studio portrait of a man"></a></td>
  </tr>
  <tr>
    <td><a href="https://huggingface.co/data-archetype/prismflow_2b_research_preview/blob/main/GALLERY.md#street"><img src="assets/gallery/0.06/street.png" width="220" alt="Narrow street of wooden houses"></a></td>
    <td><a href="https://huggingface.co/data-archetype/prismflow_2b_research_preview/blob/main/GALLERY.md#constable"><img src="assets/gallery/0.06/constable.png" width="220" alt="Landscape oil painting"></a></td>
    <td><a href="https://huggingface.co/data-archetype/prismflow_2b_research_preview/blob/main/GALLERY.md#poster_jazz"><img src="assets/gallery/0.06/poster_jazz.png" width="220" alt="Jazz festival poster from a JSON layout"></a></td>
    <td><a href="https://huggingface.co/data-archetype/prismflow_2b_research_preview/blob/main/GALLERY.md#red_perfume"><img src="assets/gallery/0.06/red_perfume.png" width="220" alt="Woman holding a red perfume bottle"></a></td>
  </tr>
  <tr>
    <td><a href="https://huggingface.co/data-archetype/prismflow_2b_research_preview/blob/main/GALLERY.md#red_carpet"><img src="assets/gallery/0.06/red_carpet.png" width="220" alt="A man in a tuxedo and a woman in a green dress on a red carpet"></a></td>
    <td><a href="https://huggingface.co/data-archetype/prismflow_2b_research_preview/blob/main/GALLERY.md#resort_night"><img src="assets/gallery/0.06/resort_night.png" width="220" alt="A modern resort building with lit verandas at night"></a></td>
    <td><a href="https://huggingface.co/data-archetype/prismflow_2b_research_preview/blob/main/GALLERY.md#loft_dog"><img src="assets/gallery/0.06/loft_dog.png" width="220" alt="A dog on a shag rug in a loft with an arched window"></a></td>
    <td><a href="https://huggingface.co/data-archetype/prismflow_2b_research_preview/blob/main/GALLERY.md#boots_clouds"><img src="assets/gallery/0.06/boots_clouds.png" width="220" alt="Hiking boots on a mountain slope above a sea of clouds"></a></td>
  </tr>
</table>

## Training history

<!-- RELEASE HISTORY: add each new release as a new row ABOVE the older ones
     and move "(current)" to it. Keep older rows; edit them only to fix errors,
     or to point a release's gallery link at its archived page
     (GALLERY_<version>.md) once a newer gallery replaces GALLERY.md. -->

| Checkpoint | Hub tag | Training step | Resolution stage | Epochs | Training compute | Gallery | Technical report |
| --- | --- | ---: | --- | ---: | ---: | --- | --- |
| **0.06** (current) | [`v0.06`](https://huggingface.co/data-archetype/prismflow_2b_research_preview/tree/v0.06) | 378,000 | 256 px, with 10% of batches at 384 px | about 2 | about 146 GH200 GPU hours | [0.06 gallery](GALLERY.md) | [Step 378k measurements](TECHNICAL_REPORT.md#routing-and-activation-probes-at-step-378k) |
| 0.05 | [`v0.05`](https://huggingface.co/data-archetype/prismflow_2b_research_preview/tree/v0.05) | 190,000 | 256 px, with 10% of batches at 384 px | about 1 | about 72 GH200 GPU hours | [0.05 gallery](GALLERY_0.05.md) | [Step 190k measurements](https://huggingface.co/data-archetype/prismflow_2b_research_preview/blob/v0.05/TECHNICAL_REPORT.md#routing-and-activation-probes-at-step-190k) |

[Loading a given tagged version](MANUAL.md#updating-and-older-versions)

<!-- CURRENT RELEASE: begin -->

**Current weights: 0.06**, the exponential moving average (EMA) of the model at
training step 378,000.

<!-- CURRENT RELEASE: end -->

[Release notes](RELEASES.md) describe each release in full.

## What's included

- `model.safetensors`: the 2B denoiser.
- `text_encoder/`: the first 18 encoder layers of
  [T5Gemma 2 1B-1B](https://huggingface.co/google/t5gemma-2-1b-1b), the part
  the model uses, under the Gemma Terms of Use.
- `prismflow/`: the Python inference package.
- `comfyui/`: ComfyUI nodes and example workflows.

The autoencoder, [dinac3_96](https://huggingface.co/data-archetype/dinac3_96)
version 1.51, is our own and downloads automatically on first use, at a pinned
commit. The [technical report](TECHNICAL_REPORT.md) covers the architecture,
the guidance and the training.

## Requirements

Python 3.12 or later, PyTorch 2.13 with CUDA, and an NVIDIA GPU with bfloat16
support and about 7 GB of free VRAM.

Generation is compiled with `torch.compile`. The first image takes about 17
seconds while the graphs are built; after that, a 384×384 image takes about 2
seconds on an RTX 4090 (50 steps, each with a conditional and an unconditional
pass).

## ComfyUI

The repository is a ComfyUI custom-node folder. Download it into
`custom_nodes` and install its requirements:

```bash
cd ComfyUI/custom_nodes
hf download data-archetype/prismflow_2b_research_preview --local-dir prismflow_2b_research_preview
pip install -r prismflow_2b_research_preview/requirements.txt
```

To update later, run the same `hf download` command again. The manual explains
how to [install an older release](MANUAL.md#updating-and-older-versions).

Load `prismflow_2b_research_preview/comfyui/workflows/prismflow_default.json`, or drag any image from the
[gallery](GALLERY.md) onto the canvas to get the workflow that made it. Start
ComfyUI with `--preview-method auto` for live previews.

## Python

```bash
hf download data-archetype/prismflow_2b_research_preview --local-dir prismflow_2b_research_preview
pip install -e prismflow_2b_research_preview
```

```python
from prismflow.inference import GenerationSettings
from prismflow.pipeline import PrismFlowPipeline

pipe = PrismFlowPipeline.from_pretrained("prismflow_2b_research_preview")
image = pipe("A lighthouse on a cliff at dusk.", GenerationSettings(seed=7)).images[0]
image.save("lighthouse.png", pnginfo=pipe.png_info(image))
```

`from_pretrained` also takes the Hub id
`data-archetype/prismflow_2b_research_preview`, in which case the files go to
the Hugging Face cache. If you have diffusers installed, a thin diffusers-style
wrapper is available as
`prismflow.diffusers_pipeline.PrismFlowDiffusersPipeline`.

The defaults are 384×384, Euler ancestral on 50 steps, and classifier-free
guidance at scale 2.8 whose unconditional pass is weakened through the
model's depth routing ([split-merge guidance](MANUAL.md#guidance)).

## Prompts

Write captions the way you would describe a photo or a painting: the subject,
the setting, the light and the medium. Long prompts are fine, up to 6,144
tokens; longer ones raise an error rather than being cut.

Put text you want in the image in double quotes, as in
`A shop sign that reads "OPEN LATE"`. The model reads quoted text character by
character, which helps with spelling.

Prompts are read exactly as written. Unlike dflow_2b, there is no
`(phrase:1.2)` emphasis markup: parentheses and colons are ordinary text.

A layout describes the picture as a whole and then lists its elements, each
with a label, a caption and a box `[y0, x0, y1, x1]` on a 0–1000 scale. Text
elements carry the exact string to render:

```json
{"summary": {"canvas": "single",
             "caption": "A travel poster of a mountain above a lake."},
 "frame": {"caption": "The peak sits in the upper middle.",
           "palette": ["#F3E6C8", "#2F5D62"]},
 "items": [
   {"label": "object", "caption": "A snow-capped mountain.",
    "box_2d": [250, 180, 620, 820]},
   {"label": "text", "caption": "The title in tall serif capitals.",
    "text": "SILVER LAKE", "box_2d": [120, 110, 220, 890]}]}
```

Use it as the prompt in Python, or paste it into the PrismFlow Layout Encode
node. MOSS-Image layout prompts and editable drafts go in the same places. The [manual](MANUAL.md#json-layouts) covers every field
and works through a full poster.

## Limitations

<!-- CURRENT RELEASE: begin -->

It is an early research preview: not many images come out quite right yet.

<!-- CURRENT RELEASE: end -->

You are responsible for how you use the model and its outputs.

## Licence

- The weights, the `prismflow` package, the documentation and the gallery
  images: ModelGo Attribution-NonCommercial 2.0 (`MG-BY-NC-2.0`). See
  [`LICENSE`](LICENSE) and [`NOTICE`](NOTICE).
- `comfyui/` and the root `__init__.py`: GPL-3.0. See
  [`comfyui/LICENSE`](comfyui/LICENSE).
- `text_encoder/`: Gemma is provided under and subject to the Gemma Terms of Use
  found at [gemma.ai/resources/terms](https://gemma.ai/resources/terms). A copy
  is in [`text_encoder/LICENSE-GEMMA.md`](text_encoder/LICENSE-GEMMA.md).
- dinac3_96 has its own licence, in
  [its repository](https://huggingface.co/data-archetype/dinac3_96).

Third-party material is listed in [`ATTRIBUTION.md`](ATTRIBUTION.md).

## Citation

<!-- CURRENT RELEASE: update the version in `note` -->

```bibtex
@misc{prismflow_2b,
  title  = {prismflow\_2b},
  author = {{Data Archetype}},
  year   = {2026},
  url    = {https://huggingface.co/data-archetype/prismflow_2b_research_preview},
  note   = {Research preview, version 0.06}
}
```