Update README.md
Browse files
README.md
CHANGED
|
@@ -60,8 +60,40 @@ pip install -r requirements.txt
|
|
| 60 |
pip install -e .
|
| 61 |
```
|
| 62 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 63 |
### 🚀 Quick Generation
|
| 64 |
|
|
|
|
|
|
|
| 65 |
Generate high-quality aesthetic posters from your prompt with `BF16` precision, please refer to our [GitHub repository](https://github.com/Ephemeral182/PosterCraft) :
|
| 66 |
|
| 67 |
```bash
|
|
@@ -76,9 +108,11 @@ python inference.py \
|
|
| 76 |
--qwen_model_path "Qwen/Qwen3-8B"
|
| 77 |
```
|
| 78 |
|
|
|
|
|
|
|
| 79 |
### 💻 Gradio Web UI
|
| 80 |
|
| 81 |
-
We provide a Gradio web UI for PosterCraft.
|
| 82 |
|
| 83 |
```bash
|
| 84 |
python -m gradio poster_craft_web_ui.py
|
|
|
|
| 60 |
pip install -e .
|
| 61 |
```
|
| 62 |
|
| 63 |
+
### 🚀 Easy Usage
|
| 64 |
+
|
| 65 |
+
PosterCraft is designed as a unified and flexible framework. This makes it easy to use PosterCraft within your own custom workflows or other compatible frameworks.
|
| 66 |
+
|
| 67 |
+
Loading the model is straightforward:
|
| 68 |
+
|
| 69 |
+
```python
|
| 70 |
+
import torch
|
| 71 |
+
from diffusers import FluxPipeline, FluxTransformer2DModel
|
| 72 |
+
|
| 73 |
+
# 1. Define model IDs and settings
|
| 74 |
+
pipeline_id = "black-forest-labs/FLUX.1-dev"
|
| 75 |
+
postercraft_transformer_id = "PosterCraft/PosterCraft-v1_RL"
|
| 76 |
+
device = "cuda"
|
| 77 |
+
dtype = torch.bfloat16
|
| 78 |
+
|
| 79 |
+
# 2. Load the base pipeline
|
| 80 |
+
pipe = FluxPipeline.from_pretrained(pipeline_id, torch_dtype=dtype)
|
| 81 |
+
|
| 82 |
+
# 3. The key step: simply replace the original transformer with our fine-tuned PosterCraft model
|
| 83 |
+
pipe.transformer = FluxTransformer2DModel.from_pretrained(
|
| 84 |
+
postercraft_transformer_id,
|
| 85 |
+
torch_dtype=dtype
|
| 86 |
+
)
|
| 87 |
+
pipe.to(device)
|
| 88 |
+
|
| 89 |
+
# Now, `pipe` is a standard diffusers pipeline ready for inference with your own logic.
|
| 90 |
+
|
| 91 |
+
```
|
| 92 |
+
|
| 93 |
### 🚀 Quick Generation
|
| 94 |
|
| 95 |
+
For the best results and to leverage our intelligent prompt rewriting feature, we recommend using the provided `inference.py` script. This script automatically enhances your creative ideas for optimal results.
|
| 96 |
+
|
| 97 |
Generate high-quality aesthetic posters from your prompt with `BF16` precision, please refer to our [GitHub repository](https://github.com/Ephemeral182/PosterCraft) :
|
| 98 |
|
| 99 |
```bash
|
|
|
|
| 108 |
--qwen_model_path "Qwen/Qwen3-8B"
|
| 109 |
```
|
| 110 |
|
| 111 |
+
|
| 112 |
+
|
| 113 |
### 💻 Gradio Web UI
|
| 114 |
|
| 115 |
+
We provide a Gradio web UI for PosterCraft, please refer to our [GitHub repository](https://github.com/Ephemeral182/PosterCraft).
|
| 116 |
|
| 117 |
```bash
|
| 118 |
python -m gradio poster_craft_web_ui.py
|