Views
No views yet
1# Clone the repository
2git clone https://github.com/skylinemusiccds/Imagine.git
3cd Imagine
4
5# Create conda environment
6conda create -n imagine python=3.11
7conda activate imagine
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"
6imagine_transformer_id = "Satyam-Singh/Imagine"
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 Imagine model
14pipe.transformer = FluxTransformer2DModel.from_pretrained(
15 imagine_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, which includes our intelligent prompt rewriting feature. This enhancement automatically refines your input to generate more compelling and visually stunning results.BF16 precision for improved performance and efficiency.1python inference.py \
2 --prompt "Urban Canvas Street Art Expo poster with bold graffiti lettering and vibrant, dynamic color splashes capturing the energy of street art." \
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 "Satyam-Singh/Imagine" \
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 lettering and vibrant, dynamic color splashes capturing the energy of street art." \
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 "Satyam-Singh/Imagine" \
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 |
| Imagine (ours) | 0.787 | 0.774 | 0.735 |
1@article{LLaVA : !magine,
2 title={LLaVA Imagine: Words to Visuals},
3 author={Satyam Singh, UniVerse Ai},
4 year={2025}
5}