Views
No views yet



1# Clone the repository
2git clone https://github.com/ephemeral182/PosterCraft.git
3cd PosterCraft
4
5# Create conda environment
6conda create -n postercraft python=3.11
7conda activate postercraft
8
9# Install dependencies
10pip install -r requirements.txt
111import torch
2from diffusers import FluxPipeline, FluxTransformer2DModel
3
4# 1. Define model IDs and settings
5pipeline_id = "black-forest-labs/FLUX.1-dev"
6postercraft_transformer_id = "PosterCraft/PosterCraft-v1_RL"
7device = "cuda"
8dtype = torch.bfloat16
9
10# 2. Load the base pipeline
11pipe = FluxPipeline.from_pretrained(pipeline_id, torch_dtype=dtype)
12
13# 3. The key step: simply replace the original transformer with our fine-tuned PosterCraft model
14pipe.transformer = FluxTransformer2DModel.from_pretrained(
15 postercraft_transformer_id,
16 torch_dtype=dtype
17)
18pipe.to(device)
19
20# Now, `pipe` is a standard diffusers pipeline ready for inference with your own logic.
21inference.py script. This script automatically enhances your creative ideas for optimal results.BF16 precision, please refer to our GitHub repository :1python inference.py \
2 --prompt "Urban Canvas Street Art Expo poster with bold graffiti-style lettering and dynamic colorful splashes" \
3 --enable_recap \
4 --num_inference_steps 28 \
5 --guidance_scale 3.5 \
6 --seed 42 \
7 --pipeline_path "black-forest-labs/FLUX.1-dev" \
8 --custom_transformer_path "PosterCraft/PosterCraft-v1_RL" \
9 --qwen_model_path "Qwen/Qwen3-8B"inference_offload.py to offload some components to the CPU:1python inference_offload.py \
2 --prompt "Urban Canvas Street Art Expo poster with bold graffiti-style lettering and dynamic colorful splashes" \
3 --enable_recap \
4 --num_inference_steps 28 \
5 --guidance_scale 3.5 \
6 --seed 42 \
7 --pipeline_path "black-forest-labs/FLUX.1-dev" \
8 --custom_transformer_path "PosterCraft/PosterCraft-v1_RL" \
9 --qwen_model_path "Qwen/Qwen3-8B"python demo_gradio.py| Method | Text Recall ↑ | Text F-score ↑ | Text Accuracy ↑ |
|---|---|---|---|
| OpenCOLE (Open) | 0.082 | 0.076 | 0.061 |
| Playground-v2.5 (Open) | 0.157 | 0.146 | 0.132 |
| SD3.5 (Open) | 0.565 | 0.542 | 0.497 |
| Flux1.dev (Open) | 0.723 | 0.707 | 0.667 |
| Ideogram-v2 (Close) | 0.711 | 0.685 | 0.680 |
| BAGEL (Open) | 0.543 | 0.536 | 0.463 |
| Gemini2.0-Flash-Gen (Close) | 0.798 | 0.786 | 0.746 |
| PosterCraft (ours) | 0.787 | 0.774 | 0.735 |

1@article{chen2025postercraft,
2 title={PosterCraft: Rethinking High-Quality Aesthetic Poster Generation in a Unified Framework},
3 author={Chen, Sixiang and Lai, Jianyu and Gao, Jialin and Ye, Tian and Chen, Haoyu and Shi, Hengyu and Shao, Shitong and Lin, Yunlong and Fei, Song and Xing, Zhaohu and Jin, Yeying and Luo, Junfeng and Wei, Xiaoming and Zhu, Lei},
4 journal={arXiv preprint arXiv:2506.10741},
5 year={2025}
6}