{"id":50510412,"url":"https://github.com/Lakonik/LakonLab","last_synced_at":"2026-06-19T14:00:37.393Z","repository":{"id":319196268,"uuid":"1077560986","full_name":"Lakonik/LakonLab","owner":"Lakonik","description":"Official implementation of AsymFlow, pi-Flow, GMFlow","archived":false,"fork":false,"pushed_at":"2026-05-29T21:22:40.000Z","size":20841,"stargazers_count":417,"open_issues_count":8,"forks_count":25,"subscribers_count":5,"default_branch":"main","last_synced_at":"2026-05-29T23:11:15.775Z","etag":null,"topics":["diffusion-models","distillation","flow-matching","generative-ai","generative-model","image-generation","pixel","pytorch","text-to-image"],"latest_commit_sha":null,"homepage":"https://hanshengchen.com/research#pub_diffuion","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Lakonik.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-16T12:23:11.000Z","updated_at":"2026-05-29T21:22:44.000Z","dependencies_parsed_at":"2025-12-30T23:08:20.726Z","dependency_job_id":null,"html_url":"https://github.com/Lakonik/LakonLab","commit_stats":null,"previous_names":["lakonik/piflow","lakonik/lakonlab"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/Lakonik/LakonLab","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lakonik%2FLakonLab","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lakonik%2FLakonLab/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lakonik%2FLakonLab/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lakonik%2FLakonLab/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Lakonik","download_url":"https://codeload.github.com/Lakonik/LakonLab/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lakonik%2FLakonLab/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34534278,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-19T02:00:06.005Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["diffusion-models","distillation","flow-matching","generative-ai","generative-model","image-generation","pixel","pytorch","text-to-image"],"created_at":"2026-06-02T20:00:26.252Z","updated_at":"2026-06-19T14:00:37.388Z","avatar_url":"https://github.com/Lakonik.png","language":"Python","funding_links":[],"categories":["🖼️ Multimodal OPD (VLM, Video, Audio, Image)"],"sub_categories":["🔁 Iterative Self-Bootstrapping"],"readme":"# LakonLab: Official Codebase for AsymFlow, pi-Flow, and GMFlow\n\nOfficial PyTorch implementation of the papers:\n\n- **Asymmetric Flow Models [[README](docs/AsymFlow.md)]**\n    \u003cbr\u003e\n    arXiv 2026\n    \u003cbr\u003e\n    [Hansheng Chen](https://lakonik.github.io/),\n    [Jan Ackermann](https://janackermann.info/),\n    [Minseo Kim](https://soniaminseokim.github.io/),\n    [Gordon Wetzstein](http://web.stanford.edu/~gordonwz/), \n    [Leonidas Guibas](https://geometry.stanford.edu/?member=guibas)\u003cbr\u003e\n    Stanford University\n    \u003cbr\u003e\n    [Project Page](https://hanshengchen.com/asymflow) | [arXiv](https://arxiv.org/abs/2605.12964) | [ComfyUI](https://github.com/Lakonik/ComfyUI-piFlow) | [AsymFLUX.2 klein Demo🤗](https://huggingface.co/spaces/Lakonik/AsymFLUX.2-klein)\n  \n    \u003cimg src=\"docs/assets/asymflow/asymflow_teaser.jpg\" width=\"250\" alt=\"\"/\u003e    \n\n- **pi-Flow: Policy-Based Few-Step Generation via Imitation Distillation [[README](docs/piFlow.md)]**\n    \u003cbr\u003e\n    In ICLR 2026\n    \u003cbr\u003e\n    [Hansheng Chen](https://lakonik.github.io/)\u003csup\u003e1\u003c/sup\u003e, \n    [Kai Zhang](https://kai-46.github.io/website/)\u003csup\u003e2\u003c/sup\u003e,\n    [Hao Tan](https://research.adobe.com/person/hao-tan/)\u003csup\u003e2\u003c/sup\u003e,\n    [Leonidas Guibas](https://geometry.stanford.edu/?member=guibas)\u003csup\u003e1\u003c/sup\u003e,\n    [Gordon Wetzstein](http://web.stanford.edu/~gordonwz/)\u003csup\u003e1\u003c/sup\u003e, \n    [Sai Bi](https://sai-bi.github.io/)\u003csup\u003e2\u003c/sup\u003e\u003cbr\u003e\n    \u003csup\u003e1\u003c/sup\u003eStanford University, \u003csup\u003e2\u003c/sup\u003eAdobe Research\n    \u003cbr\u003e\n    [arXiv](https://arxiv.org/abs/2510.14974) | [ComfyUI](https://github.com/Lakonik/ComfyUI-piFlow) | [pi-Qwen Demo🤗](https://huggingface.co/spaces/Lakonik/pi-Qwen) | [pi-FLUX Demo🤗](https://huggingface.co/spaces/Lakonik/pi-FLUX.1) | [pi-FLUX.2 Demo🤗](https://huggingface.co/spaces/Lakonik/pi-FLUX.2)\n\n    \u003cimg src=\"docs/assets/piflow/piflow_teaser.jpg\" width=\"250\" alt=\"\"/\u003e\n\n- **Gaussian Mixture Flow Matching Models [[README](docs/GMFlow.md)]**\n    \u003cbr\u003e\n    In ICML 2025\n    \u003cbr\u003e\n    [Hansheng Chen](https://lakonik.github.io/)\u003csup\u003e1\u003c/sup\u003e, \n    [Kai Zhang](https://kai-46.github.io/website/)\u003csup\u003e2\u003c/sup\u003e,\n    [Hao Tan](https://research.adobe.com/person/hao-tan/)\u003csup\u003e2\u003c/sup\u003e,\n    [Zexiang Xu](https://zexiangxu.github.io/)\u003csup\u003e3\u003c/sup\u003e, \n    [Fujun Luan](https://research.adobe.com/person/fujun/)\u003csup\u003e2\u003c/sup\u003e,\n    [Leonidas Guibas](https://geometry.stanford.edu/?member=guibas)\u003csup\u003e1\u003c/sup\u003e,\n    [Gordon Wetzstein](http://web.stanford.edu/~gordonwz/)\u003csup\u003e1\u003c/sup\u003e, \n    [Sai Bi](https://sai-bi.github.io/)\u003csup\u003e2\u003c/sup\u003e\u003cbr\u003e\n    \u003csup\u003e1\u003c/sup\u003eStanford University, \u003csup\u003e2\u003c/sup\u003eAdobe Research, \u003csup\u003e3\u003c/sup\u003eHillbot\n    \u003cbr\u003e\n    [arXiv](https://arxiv.org/abs/2504.05304)\n    \n    \u003cimg src=\"docs/assets/gmflow/gmdit.png\" width=\"250\" alt=\"\"/\u003e\n    \u003cbr\u003e\n    \u003cimg src=\"docs/assets/gmflow/gmdit_results.png\" width=\"250\" alt=\"\"/\u003e\n\n## 🔥News\n\n- [May 20, 2026] AsymFlow is now supported in our [ComfyUI extension](https://github.com/Lakonik/ComfyUI-piFlow).\n\n- [May 14, 2026] [AsymFlow](docs/AsymFlow.md) is released.\n\n- [Dec 12, 2025] pi-FLUX.2 is now available for 4-step image generation and editing. Check out the [pi-FLUX.2 Demo🤗](https://huggingface.co/spaces/Lakonik/pi-FLUX.2). Please re-install the latest version of LakonLab (this repository) to use pi-FLUX.2.\n\n- [Nov 7, 2025] [ComfyUI-piFlow](https://github.com/Lakonik/ComfyUI-piFlow) is now available. Supports 4-step sampling of Qwen-Image and Flux.1 dev using 8-bit models on a single consumer-grade GPU, powered by [ComfyUI](https://github.com/comfyanonymous/ComfyUI).\n\n## Installation\n\nThe code has been tested in the following environment:\n\n- Linux (tested on Ubuntu 20 and above)\n- [PyTorch](https://pytorch.org/get-started/previous-versions/) 2.6+\n\nWith the above prerequisites, run `pip install -e . --no-build-isolation` from the repository root to install the LakonLab codebase and its dependencies.\n\nAn example of installation commands is shown below:\n\n```bash\n# Move to this repository (the folder with setup.py) after cloning\ncd \u003cPATH_TO_YOUR_LOCAL_REPO\u003e\n\n# Create uv environment\nuv venv --python 3.10\nsource .venv/bin/activate\n\n# Install Pytorch. Goto https://pytorch.org/get-started/previous-versions/ to select the appropriate version\nuv pip install torch==2.10.0 torchvision==0.25.0 --index-url https://download.pytorch.org/whl/cu128\n\n# Install LakonLab in editable mode\nuv pip install -e . --no-build-isolation\n```\n\nAdditional notes:\n\u003cbr\u003e\nTo access FLUX models, please accept the [FLUX.2 klein Base 9B conditions](https://huggingface.co/black-forest-labs/FLUX.2-klein-base-9B) and [FLUX.1 dev conditions](https://huggingface.co/black-forest-labs/FLUX.1-dev), and then run `hf auth login` to login with your HuggingFace account.\n\n## Codebase\n\n\u003cimg src=\"docs/assets/lakonlab.png\" width=\"200\"  alt=\"\"/\u003e\n\n**LakonLab** is a high-performance codebase for experimenting with large diffusion models. Key features of LakonLab include:\n- **Performance optimizations**: Seamless switching between DDP, FSDP, and FSDP2, all supporting gradient accumulation and mixed precision.\n- **Weight tying**: For LoRA fine-tuning, the base weights of the teacher, student, and EMA models are tied, sharing the same underlying memory. This is compatible with DDP and FSDP.\n- **Advanced flow solvers**:\n  - [FlowSDEScheduler](lakonlab/models/diffusions/schedulers/flow_sde.py): Generic flow SDE solver with an adjustable [diffusion coefficient](https://arxiv.org/pdf/2306.02063). `h=0` corresponds to a flow ODE; `h=1` corresponds to a standard flow SDE; `h='inf'` corresponds to the re-noising sampler in the original [consistency models](https://arxiv.org/pdf/2303.01469). Powers the GM-SDE solver in GMFlow.\n  - [FlowMapSDEScheduler](lakonlab/models/diffusions/schedulers/flow_map_sde.py): Generic flow SDE solver for few-step flow map models, similar to above.\n- **Storage backends**: Most I/O operations (e.g., dataloaders, checkpoint I/O) support both local filesystems and AWS S3. In addition, model checkpoints can be loaded from HuggingFace (link format `huggingface://\u003cHF_REPO_NAME\u003e/\u003cPATH_TO_MODEL\u003e`) and HTTP/HTTPS URLs directly.\n- **Streamlined training and evaluation**: Supports online evaluation using common [metrics](lakonlab/evaluation/metrics.py), including FID, KID, IS, Precision, Recall, CLIP similarity, [VQAScore](https://github.com/linzhiqiu/t2v_metrics), [HPSv2](https://github.com/tgxs002/HPSv2), and [HPSv3](https://github.com/MizzenAI/HPSv3). Supports exporting results to offline evaluators, including [HPSv3 Benchmark](https://github.com/MizzenAI/HPSv3), [DPG-Bench](https://github.com/TencentQQGYLab/ELLA) and [GenEval](https://github.com/djghosh13/geneval).\n- **3rd-party model inference reproduction**:\n  \n  - ImageNet 256x256 models with [ADM evaluation](https://github.com/openai/guided-diffusion/tree/main/evaluations):\n\n    | Model                                                             | FID (reproduced) | FID (official) |\n    |-------------------------------------------------------------------|:----------------:|:--------------:|\n    | [SiT-XL/2](configs/misc/sit_imagenet_test.py)                     |       2.05       |      2.06      |\n    | [JiT-H/16](configs/misc/jit_h_16_imagenet_test.py)                |       1.90       |       -        |\n    | [DiT-XL RAE (unguided)](configs/misc/rae_dinov2_imagenet_test.py) |       1.50       |      1.51      |\n    | [REPA-XL/2](configs/misc/repa_imagenet_test.py)                   |       1.38       |      1.42      |\n    | [REPA-E-XL VAVAE](configs/misc/repae_imagenet_test.py)            |       1.12       |      1.12      |\n\n    Note: \u003cbr\u003e\n    We use BF16 inference for all models except RAE. \u003cbr\u003e\n    Original JiT paper uses its own evaluation protocol that differs from ADM evaluation.\n\n  - Text-to-image models:\n\n    See examples in [configs/misc](configs/misc) and [lakonlab/models/architectures/diffusers](lakonlab/models/architectures/diffusers).\n\nLakonLab uses the configuration system and code structure from [MMCV](https://github.com/open-mmlab/mmcv).\n\n## Citation\n```\n@article{asymflow,\n  title={Asymmetric Flow Models},\n  author={Hansheng Chen and Jan Ackermann and Minseo Kim and Gordon Wetzstein and Leonidas Guibas},\n  url={https://arxiv.org/abs/2605.12964},\n  journal={arXiv preprint arXiv:2605.12964},\n  year={2026},\n}\n\n@article{piflow,\n  title={pi-Flow: Policy-Based Few-Step Generation via Imitation Distillation}, \n  author={Hansheng Chen and Kai Zhang and Hao Tan and Leonidas Guibas and Gordon Wetzstein and Sai Bi},\n  url={https://arxiv.org/abs/2510.14974}, \n  journal={arXiv preprint arXiv:2510.14974},\n  year={2025},\n}\n\n@article{gmflow,\n  title={Gaussian Mixture Flow Matching Models},\n  author={Hansheng Chen and Kai Zhang and Hao Tan and Zexiang Xu and Fujun Luan and Leonidas Guibas and Gordon Wetzstein and Sai Bi},\n  url={https://arxiv.org/abs/2504.05304}, \n  journal={arXiv preprint arXiv:2504.05304},\n  year={2025},\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLakonik%2FLakonLab","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FLakonik%2FLakonLab","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLakonik%2FLakonLab/lists"}