Instructions to use Lakonik/AsymFLUX.2-klein-9B-collection with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use Lakonik/AsymFLUX.2-klein-9B-collection with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("Lakonik/AsymFLUX.2-klein-9B-collection", 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
Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
base_model:
|
| 3 |
+
- black-forest-labs/FLUX.2-klein-base-9B
|
| 4 |
+
library_name: diffusers
|
| 5 |
+
license: other
|
| 6 |
+
license_name: flux-non-commercial-license
|
| 7 |
+
license_link: LICENSE.md
|
| 8 |
+
pipeline_tag: text-to-image
|
| 9 |
+
tags:
|
| 10 |
+
- flow-matching
|
| 11 |
+
- pixel-diffusion
|
| 12 |
+
- pixel-generation
|
| 13 |
+
- flux2
|
| 14 |
+
---
|
| 15 |
+
|
| 16 |
+
# Asymmetric Flow Models
|
| 17 |
+
|
| 18 |
+
Pixel-space text-to-image model AsymFLUX.2-klein finetuned from [black-forest-labs/FLUX.2-klein-base-9B](https://huggingface.co/black-forest-labs/FLUX.2-klein-base-9B), using the AsymFlow method proposed in the paper:
|
| 19 |
+
|
| 20 |
+
**Asymmetric Flow Models**
|
| 21 |
+
<br>
|
| 22 |
+
arXiv 2026
|
| 23 |
+
<br>
|
| 24 |
+
[Hansheng Chen](https://lakonik.github.io/),
|
| 25 |
+
[Jan Ackermann](https://janackermann.info/),
|
| 26 |
+
[Minseo Kim](https://soniaminseokim.github.io/),
|
| 27 |
+
[Gordon Wetzstein](http://web.stanford.edu/~gordonwz/),
|
| 28 |
+
[Leonidas Guibas](https://geometry.stanford.edu/?member=guibas)<br>
|
| 29 |
+
Stanford University
|
| 30 |
+
<br>
|
| 31 |
+
[Project Page](https://hanshengchen.com/asymflow) | [arXiv](https://arxiv.org/abs/2605.12964) | [Code](https://github.com/Lakonik/LakonLab/blob/main/docs/AsymFlow.md) | [AsymFLUX.2 klein Demo🤗](https://huggingface.co/spaces/Lakonik/AsymFLUX.2-klein)
|
| 32 |
+
|
| 33 |
+

|
| 34 |
+
|
| 35 |
+
## Usage
|
| 36 |
+
|
| 37 |
+
Please first install the [LakonLab v0.2](https://github.com/Lakonik/LakonLab).
|
| 38 |
+
|
| 39 |
+
We provide a Diffusers-style pipeline for AsymFLUX.2 klein. The example below loads the FLUX.2 klein Base 9B model, attaches the AsymFlow adapter, and generates an image directly in pixel space.
|
| 40 |
+
|
| 41 |
+
```python
|
| 42 |
+
import math
|
| 43 |
+
import torch
|
| 44 |
+
from lakonlab.models.architectures import OklabColorEncoder
|
| 45 |
+
from lakonlab.models.diffusions.schedulers import FlowAdapterScheduler
|
| 46 |
+
from lakonlab.pipelines.pipeline_pixelflux2_klein import PixelFlux2KleinPipeline
|
| 47 |
+
|
| 48 |
+
pipe = PixelFlux2KleinPipeline.from_pretrained(
|
| 49 |
+
'black-forest-labs/FLUX.2-klein-base-9B',
|
| 50 |
+
vae=OklabColorEncoder(
|
| 51 |
+
use_affine_norm=True,
|
| 52 |
+
mean=(0.56, 0.0, 0.01),
|
| 53 |
+
std=0.16),
|
| 54 |
+
scheduler=FlowAdapterScheduler(
|
| 55 |
+
shift=17.0,
|
| 56 |
+
use_dynamic_shifting=True,
|
| 57 |
+
base_seq_len=1024 ** 2,
|
| 58 |
+
max_seq_len=2048 ** 2,
|
| 59 |
+
base_logshift=math.log(17.0),
|
| 60 |
+
max_logshift=math.log(34.0),
|
| 61 |
+
dynamic_shifting_type='sqrt',
|
| 62 |
+
base_scheduler='UniPCMultistep'),
|
| 63 |
+
torch_dtype=torch.bfloat16)
|
| 64 |
+
adapter_name = pipe.load_lakonlab_adapter( # you may later call `pipe.set_adapters([adapter_name, ...])` to combine other adapters (e.g., style LoRAs)
|
| 65 |
+
'Lakonik/AsymFLUX.2-klein-9B-collection',
|
| 66 |
+
subfolder='asymflux2_klein_9b_sft_zimage_turbo',
|
| 67 |
+
target_module_name='transformer')
|
| 68 |
+
pipe = pipe.to('cuda')
|
| 69 |
+
|
| 70 |
+
# Text-to-image generation example
|
| 71 |
+
prompt = 'Restored color photo from the 1900s. A middle-aged man with cybernetic metal hands is sitting on an old wooden chair and reading the newspaper. The newspaper has the prominent headline "AsymFLOW RELEASED" in large bold font. Close-up shot focusing on the newspaper.'
|
| 72 |
+
neg_prompt = 'Low quality, worst quality, blurry, deformed, bad anatomy, unclear text'
|
| 73 |
+
out = pipe(
|
| 74 |
+
prompt=prompt,
|
| 75 |
+
negative_prompt=neg_prompt,
|
| 76 |
+
width=960,
|
| 77 |
+
height=1280,
|
| 78 |
+
num_inference_steps=38,
|
| 79 |
+
guidance_scale=4.0,
|
| 80 |
+
generator=torch.Generator().manual_seed(42),
|
| 81 |
+
).images[0]
|
| 82 |
+
out.save('asymflux2_klein.png')
|
| 83 |
+
```
|
| 84 |
+
|
| 85 |
+
## Citation
|
| 86 |
+
```
|
| 87 |
+
@article{chen2026asymmetric,
|
| 88 |
+
title={Asymmetric Flow Models},
|
| 89 |
+
author={Hansheng Chen and Jan Ackermann and Minseo Kim and Gordon Wetzstein and Leonidas Guibas},
|
| 90 |
+
journal={arXiv preprint arXiv:2605.12964},
|
| 91 |
+
url={https://arxiv.org/abs/2605.12964},
|
| 92 |
+
year={2026},
|
| 93 |
+
}
|
| 94 |
+
```
|