--- 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 > [!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). 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.**
Boardwalk to a rugged coast Tortoiseshell cat in tall grass Rooster among tropical plants Studio portrait of a man
Narrow street of wooden houses Landscape oil painting Jazz festival poster from a JSON layout Woman holding a red perfume bottle
A man in a tuxedo and a woman in a green dress on a red carpet A modern resort building with lit verandas at night A dog on a shag rug in a loft with an arched window Hiking boots on a mountain slope above a sea of clouds
## Training history | 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 weights: 0.06**, the exponential moving average (EMA) of the model at training step 378,000. [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 It is an early research preview: not many images come out quite right yet. 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 ```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} } ```