Lakonik commited on
Commit
04be923
·
verified ·
1 Parent(s): d7bb6e9

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +93 -0
README.md ADDED
@@ -0,0 +1,93 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ ![asymflow_teaser](https://cdn-uploads.huggingface.co/production/uploads/638067fcb334960c987fbeda/UCU9seMTK_iBccdFNErns.jpeg)
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',
66
+ target_module_name='transformer')
67
+ pipe = pipe.to('cuda')
68
+
69
+ # Text-to-image generation example
70
+ 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.'
71
+ neg_prompt = 'Low quality, worst quality, blurry, deformed, bad anatomy, unclear text'
72
+ out = pipe(
73
+ prompt=prompt,
74
+ negative_prompt=neg_prompt,
75
+ width=960,
76
+ height=1280,
77
+ num_inference_steps=38,
78
+ guidance_scale=4.0,
79
+ generator=torch.Generator().manual_seed(42),
80
+ ).images[0]
81
+ out.save('asymflux2_klein.png')
82
+ ```
83
+
84
+ ## Citation
85
+ ```
86
+ @article{chen2026asymmetric,
87
+ title={Asymmetric Flow Models},
88
+ author={Hansheng Chen and Jan Ackermann and Minseo Kim and Gordon Wetzstein and Leonidas Guibas},
89
+ journal={arXiv preprint arXiv:2605.12964},
90
+ url={https://arxiv.org/abs/2605.12964},
91
+ year={2026},
92
+ }
93
+ ```