fork from https://github.com/Jiexuanz/AlignedGen
环境: RTX 5090 32G
1024分辨率可以一次跑两个prompts
提示词为{"Globe in 3D realism style.", "iPhone in 3D realism style."}
提示词为{"Apple in 3D realism style.", "iPhone in 3D realism style."}
提示词为{"A Huawei smartphone in a 3D realistic style.", "An Apple iPhone in a 3D realistic style."}
提示词为{"A Linux-themed anime-style beautiful girl.", "A Windows-themed anime-style beautiful girl."}
Jiexuan Zhang, Yiheng Du, Qian Wang, Yu Gu, Weiqi Li, Jian Zhang
School of Electronic and Computer Engineering, Peking University
AlignedGen generates a set of images with a consistent style from a set of prompts.
For example, given the prompts: {Anchor, Clock, Globe, Bicycle} in 3D realism style., AlignedGen will produce the results shown below. For more details on how to run the model, please see the Inference section. Additional examples are available on our project website.
- 09.23 Released paper and code.
conda create -n aligned python=3.10
conda activate aligned
conda install pytorch==2.5.1 torchvision==0.20.1 torchaudio==2.5.1 -c pytorch
pip install diffusers transformers sentencepiece protobuf==3.19.0Before running, please ensure FLUX.1-dev model is accessible to the script. Then, run the inference script with the following command:
python inference.py --model_path black-forest-labs/FLUX.1-dev --style_lambda 1.1
This will generate the image shown at the beginning of this README.
Note on VRAM: If you encounter out-of-memory errors, try reducing the number of prompts or enabling the offload option within the pipeline.
- Release the paper and code
- Release ControlNet Code
- Release DreamBooth Code
- Release Attention Map Visualization Code
- Release User-Provided Image As Style Inference Code
- Support Qwen-Image
- Support ComfyUI
- Support Gradio demo
We appreciate the releasing codes of StyleAligned and Diffusers.
If our work assists your research, feel free to give us a star ⭐ or cite us using:
@article{zhang2025alignedgen,
title={AlignedGen: Aligning Style Across Generated Images},
author={Zhang, Jiexuan and Du, Yiheng and Wang, Qian and Li, Weiqi and Gu, Yu and Zhang, Jian},
journal={arXiv preprint arXiv:2509.17088},
year={2025}
}