Text-to-Image
Diffusers
Safetensors
English
Flux2KleinPipeline
scientific-diagrams
methodology-figures
flux
Instructions to use LoYuXrqw/SciForma-Base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use LoYuXrqw/SciForma-Base with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("LoYuXrqw/SciForma-Base", 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
File size: 2,699 Bytes
267aaee c19617c 267aaee | 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 | ---
license: other
license_name: flux-non-commercial-license-v2.1
license_link: https://huggingface.co/black-forest-labs/FLUX.2-klein-base-9B/blob/main/LICENSE.md
language:
- en
base_model:
- black-forest-labs/FLUX.2-klein-base-9B
tags:
- text-to-image
- scientific-diagrams
- methodology-figures
- flux
- diffusers
pipeline_tag: text-to-image
---
# SciForma-Base
**SciForma-Base** is the Stage 1+2 SFT checkpoint of [SciForma: Structure-Faithful Generation of Scientific Diagrams](https://github.com/microsoft/SciForma), fine-tuned from [FLUX.2-klein-base-9B](https://huggingface.co/black-forest-labs/FLUX.2-klein-base-9B).
| Model | Overall ↑ | Comp. ↑ | Arrow ↑ | Text ↑ |
|-------|-----------|---------|---------|--------|
| SciForma-9B | 69.51 | 74.49 | 66.46 | 67.00 |
| **SciForma-Base** | **67.59** | 73.52 | 64.64 | 63.84 |
| FLUX.2-klein-base-9B (no fine-tuning) | 33.87 | 42.80 | 25.20 | 23.60 |
Scores on SciFormaBench-2K (GPT-5.4 judge, split_dims=True).
## Usage
This repository contains only the fine-tuned **transformer** weights. The text encoder, tokenizer, VAE, and scheduler are inherited from the base model.
```python
import torch
from diffusers import Flux2KleinPipeline, Flux2Transformer2DModel
# Load fine-tuned transformer
transformer = Flux2Transformer2DModel.from_pretrained(
"microsoft/SciForma-Base",
subfolder="transformer",
torch_dtype=torch.bfloat16,
)
# Load full pipeline with base model components
pipe = Flux2KleinPipeline.from_pretrained(
"black-forest-labs/FLUX.2-klein-base-9B",
transformer=transformer,
torch_dtype=torch.bfloat16,
)
pipe.enable_model_cpu_offload()
# Generate
prompt = "The figure illustrates a transformer architecture with encoder and decoder..."
image = pipe(
prompt,
height=576,
width=1008,
num_inference_steps=28,
guidance_scale=4.0,
).images[0]
image.save("output.png")
```
## Training Details
- **Base model**: FLUX.2-klein-base-9B (9.08B parameters)
- **Stage 1**: Full fine-tuning on 661K arXiv methodology diagrams at 768px (200K steps, 8× B200)
- **Stage 2**: Joint generation + editing fine-tuning on 244K high-quality 1024px diagrams + 70K editing triplets (120K steps, 8× B200)
- **Training data**: [microsoft/SciFormaData-700K](https://huggingface.co/datasets/microsoft/SciFormaData-700K)
## License
Released under the [FLUX Non-Commercial License v2.1](https://huggingface.co/black-forest-labs/FLUX.2-klein-base-9B/blob/main/LICENSE.md). Non-commercial research use only.
> This FLUX Model is licensed by Black Forest Labs Inc. under the FLUX Non-Commercial License. Copyright Black Forest Labs Inc. This model has been modified by Microsoft Research Asia.
|