Text-to-Image
Diffusers
Safetensors
MiniMax H3
Pruna AI
English
image-to-image
image-generation
image-editing
prompt-upsampling
modular-diffusers
Instructions to use PrunaAI/P-H3-Image with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use PrunaAI/P-H3-Image with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("PrunaAI/P-H3-Image", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Pruna AI
How to use PrunaAI/P-H3-Image with Pruna AI:
from pruna import PrunaModel pip install -U diffusers transformers accelerate
from pruna import PrunaModel import torch # switch to "mps" for apple devices pipe = PrunaModel.from_pretrained("PrunaAI/P-H3-Image", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Draw Things
- DiffusionBee
File size: 19,251 Bytes
1458c0a 90dba41 1458c0a 90dba41 7f81b36 90dba41 7f81b36 90dba41 ee4a685 90dba41 ee4a685 7f98ace 90dba41 31a8f6a ee4a685 90dba41 ee4a685 90dba41 ee4a685 90dba41 ee4a685 90dba41 ee4a685 90dba41 ee4a685 90dba41 ee4a685 90dba41 ee4a685 90dba41 ee4a685 90dba41 ee4a685 90dba41 ee4a685 90dba41 ee4a685 90dba41 ee4a685 90dba41 ee4a685 90dba41 ee4a685 90dba41 ee4a685 90dba41 ee4a685 90dba41 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 | ---
license: other
license_name: minimax-h3-community-license-agreement
license_link: LICENSE
base_model: MiniMaxAI/MiniMax-H3
base_model_relation: finetune
library_name: diffusers
pipeline_tag: text-to-image
language:
- en
tags:
- text-to-image
- image-to-image
- image-generation
- image-editing
- prompt-upsampling
- minimax-h3
- diffusers
- modular-diffusers
- pruna-ai
---
<!-- header start -->
<p align="center">
<img src="assets/p-h3-image.jpg" width="800">
</p>
<!-- header end -->
<p align="center">
<a href="https://github.com/PrunaAI/pruna">
<img src="https://img.shields.io/badge/GitHub-PrunaAI-9334E9?style=plastic&logo=github&logoColor=white" alt="GitHub">
</a>
<a href="https://twitter.com/PrunaAI">
<img src="https://img.shields.io/badge/Twitter%2FX-@PrunaAI-9334E9?style=plastic&logo=x&logoColor=white" alt="Twitter/X">
</a>
<a href="https://www.linkedin.com/company/pruna-ai">
<img src="https://img.shields.io/badge/LinkedIn-PrunaAI-9334E9?style=plastic&logo=linkedin&logoColor=white" alt="LinkedIn">
</a>
<a href="https://discord.com/invite/JFQmtFKCjd">
<img src="https://img.shields.io/badge/Discord-Join%20us-9334E9?style=plastic&logo=discord&logoColor=white" alt="Discord">
</a>
<a href="https://dashboard.pruna.ai/login?utm_source=huggingface&utm_medium=org_card&utm_campaign=hf_traffic">
<img src="https://img.shields.io/badge/Performance%20Models-Try%20them%20now-9334E9?style=plastic&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MTEiIGhlaWdodD0iNDc3IiBmaWxsPSJub25lIj48cGF0aCBmaWxsPSIjZmZmIiBkPSJNMjMuNzAzIDMwMC41MzJjLTEuODQyLS42NzQtNC4xNDItMS4wNTctNS43MDMtMi4wMjktMTIuNTU4LTcuODQ2LTguODM3LTI1LjE3MiA1LjI1NS0yOC4zNjFhLjY2LjY2IDAgMCAwIC4zNDgtLjIwMS42LjYgMCAwIDAgLjE1Ni0uMzZxNi40OS04MS45ODYgNjguNTc3LTEzNC42MjlhLjM0LjM0IDAgMCAwIC4wOTItLjEyNS4zMy4zMyAwIDAgMC0uMDI2LS4zLjMzLjMzIDAgMCAwLS4xMTItLjEwOGMtNC4xMTUtMi40OTctOC42NC00Ljc1LTEyLjM1My03LjQ0M2ExOTAgMTkwIDAgMCAxLTE4Ljc5NC0xNS41MjJjLTIuOTM2LTIuNzY4LTMuNzAzLTUuODkxLjU4LTcuNzdhLjUuNSAwIDAgMCAuMjgtLjYwOEM1MyA3NS45NSA0OC40MTcgNDguNTk5IDQ1LjUxOCAxOS42NXEtLjM5My0zLjg1Mi0uMjcxLTYuMzJhLjc1Ljc1IDAgMCAxIC4xMzQtLjQuNy43IDAgMCAxIC4zMjQtLjI1NXEyLjEwNC0uODQyIDUuODQ0LTEuNDMxYzU4LjExNC05LjEzNiAxMjcuMDA5IDguNDI1IDE0NC4zMDcgNzIuNjQ1cS4xMDMuMzY0LjE3OCAwIDUuMDk2LTI0LjA5NyA0LjYzOC00OC4xOT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I3LjcxLTI3Ljg2OCAyNy43MS0xNS4xNzIgMC0yNy44NzYtMTMuODM1LTI3Ljg3Ni0yOC44MTEgMC0uMzU3LjAyOS0uNTk2LjA1Ny0uNzQ0WiIvPjwvc3ZnPg==" alt="Performance Models">
</a>
</p>
<div align="center">
<h1 style="color: #9334E9;">P-H3-Image</h1>
<h2>Image generation and editing based on MiniMax-H3</h2>
<h3>
<span style="color: #9334E9;">8 steps</span>
路
<span style="color: #9334E9;">No CFG</span>
路
<span style="color: #9334E9;">8 MP</span>
路
Text-to-image and editing with up to 8 images
</h3>
</div>
**P-H3-Image** is an image model for text-to-image generation and image editing, based on
[MiniMax-H3](https://huggingface.co/MiniMaxAI/MiniMax-H3). It renders 8-megapixel images in 8 steps without
classifier-free guidance, edits with up to 8 input images, and comes with a prompt upsampler that turns a one-line
request into the full prompt P-H3-Image renders best. It is strongest at photorealism, film and editorial looks, and
graphic styles with short quoted text.
This repository holds the [diffusers](https://github.com/huggingface/diffusers) pipeline. For ComfyUI, with int8 and
4-bit files that run in 21 GB of VRAM, see [PrunaAI/P-H3-Image-Comfy](https://huggingface.co/PrunaAI/P-H3-Image-Comfy).
Read the full blog post [here](https://pruna.ai/blog/oss-p-h3-image-launch).
| | |
|---|---|
| **Tasks** | Text-to-image, and image editing with 1 to 8 input images |
| **Sampling** | 8 steps, no CFG or negative prompt |
| **Resolution** | 8 MP for text-to-image, 4 or 8 MP for edits |
| **Prompt upsampler** | Included and on by default, based on Qwen3.5-9B |
| **Weights** | 33.1B-parameter transformer, 4B text encoder, VAE and prompt upsampler, 100 GB in bf16 |
| **GPU memory at 8 MP** | About 101 GB with the prompt upsampler, 83 GB without |
## Quickstart
Run text-to-image and editing with the same pipeline. At 8 MP in bf16 it needs a GPU with about 101 GB of memory,
such as one H200 or B200, or 80 GB with [offloading](#less-gpu-memory).
```bash
pip install git+https://github.com/huggingface/diffusers
pip install -U transformers accelerate torch pillow
```
```python
import torch
from diffusers import ModularPipeline
pipe = ModularPipeline.from_pretrained("PrunaAI/P-H3-Image")
pipe.load_components(dtype=torch.bfloat16)
pipe.to("cuda")
prompt = (
"A German Expressionist oil painting of a Berlin street at night in the manner of Ernst Ludwig Kirchner, "
"with gaunt figures hurrying past a glowing gas lamp."
)
image = pipe(
prompt=prompt,
height=3360, width=2496, # 8 MP, 3:4
generator=torch.Generator().manual_seed(3),
output="images",
)[0]
image.save("berlin.png")
```
The pipeline picks the task from its inputs. Pass `image` to edit.
```python
from diffusers.utils import load_image
# Edit one image
edited = pipe(prompt="let it snow on the street", image=image, output="images")[0]
# Up to 8 images. The first is edited, the others are references, named Picture 2, Picture 3 and so on.
composed = pipe(
prompt="give the woman in picture 1 the hat from picture 2",
image=[load_image("portrait.png"), load_image("hat.png")],
output="images",
)[0]
```
## Recommended resolutions
<p align="center">
<img src="assets/resolutions.png" width="100%">
</p>
P-H3-Image works best at **8 MP**. Images at 2 and 4 MP can be good too, but artifacts become more frequent, especially
in faces, hands and small details. For text-to-image, use one of the 8 MP sizes below. The default is 2912 脳 2912.
Edits work best at 4 or 8 MP. Without `height` and `width`, the edit is generated at the size of Picture 1, scaled up to
at least 4 MP. The other images keep their size between 1 and 8 MP. Passing `height` and `width` changes the canvas,
not the images. Sides are rounded to multiples of 32, with a warning.
| Aspect ratio | 8 MP (width 脳 height) | 4 MP, for edits |
|:---:|:---:|:---:|
| 1:1 | **2912 脳 2912** | 2048 脳 2048 |
| 4:3 | **3360 脳 2496** | 2368 脳 1760 |
| 3:4 | **2496 脳 3360** | 1760 脳 2368 |
| 3:2 | **3552 脳 2368** | 2496 脳 1664 |
| 2:3 | **2368 脳 3552** | 1664 脳 2496 |
| 16:9 | **3872 脳 2176** | 2720 脳 1536 |
| 9:16 | **2176 脳 3872** | 1536 脳 2720 |
```python
SIZES_8MP = { # aspect ratio -> (width, height)
"1:1": (2912, 2912),
"4:3": (3360, 2496),
"3:4": (2496, 3360),
"3:2": (3552, 2368),
"2:3": (2368, 3552),
"16:9": (3872, 2176),
"9:16": (2176, 3872),
}
width, height = SIZES_8MP["16:9"]
image = pipe(prompt=prompt, width=width, height=height, output="images")[0]
```
<p align="center">
<img src="assets/resolution_ladder.jpg" width="100%">
</p>
*The same prompt and seed from 1 to 16 MP, with the face enlarged in the bottom row. At 1 MP the face is smooth and
waxy. From 8 MP on, skin texture, stray hairs and the gold earrings come through. The composition shifts between
resolutions because the noise changes with the image size.*
## Prompting
P-H3-Image is sensitive to prompting and renders full, specific prompts much better than short requests. The pipeline
therefore runs a prompt upsampler, based on Qwen3.5-9B, on every request. It writes a detailed prompt for the aspect
ratio of `height` and `width`, or, for an edit, a brief of what to keep and what to change. The prompt it wrote comes
back as the `prompt` output.
```python
out = pipe(prompt=prompt, height=3360, width=2496, output=["images", "prompt"])
print(out["prompt"])
```
To render a prompt as written, remove the step from the blocks.
```python
blocks = ModularPipeline.from_pretrained("PrunaAI/P-H3-Image").blocks
blocks.sub_blocks.pop("prompt_upsampler")
pipe = blocks.init_pipeline("PrunaAI/P-H3-Image")
pipe.load_components(dtype=torch.bfloat16)
pipe.to("cuda")
image = pipe(prompt=prompt, height=3360, width=2496, output="images")[0] # rendered as written
```
When you write prompts by hand, four things matter most.
1. **Say what the image is.** Open with one sentence that names the real object the image is, such as "a photograph
by an experienced street photographer", "a frame from a Japanese anime TV series", "a two-color risograph print" or
"a flat scan of a handwritten recipe card". This sets the look more reliably than any style word.
2. **Describe one scene.** Give a viewpoint, one main subject caught in a moment, a few supporting elements, and light
with a source and a direction.
3. **Spell out every word.** Text without its exact words turns into pseudo-text. Put each piece of text in quotes,
keep each string short, say where it sits, and end with "no other text". If you want no text, don't mention signs
or labels at all.
4. **Leave out hype words.** Stunning, epic, cinematic, vibrant, hyper-detailed, 8k or masterpiece push P-H3-Image
toward a glossy, oversaturated, airbrushed look.
<p align="center">
<img src="assets/prompt.jpg" width="100%">
</p>
*The first sentence says what the image is (bold), and every string that must appear is quoted (blue). The
handwriting follows the quoted text almost word for word.*
Styles that work especially well include documentary and editorial photography, portraits with real skin texture, film
frames, TV-frame anime, ink and charcoal drawings, screen-printed posters and flat graphic design with short quoted
text.
<p align="center">
<img src="assets/styles.jpg" width="100%">
</p>
*Risograph print, child's crayon drawing, 1960s color photograph, 1970s film frame.*
## Editing
Pass one image to edit it, or a list of up to 8. Picture 1 is the image to edit, and the others are references the
request can name as Picture 2, Picture 3 and so on. The upsampler writes the edit prompt in the form P-H3-Image edits
best from, so a short request such as "make the pickup truck red" is enough.
<p align="center">
<img src="assets/edits.jpg" width="100%">
</p>
*The same short request given as typed (middle) and written as an edit prompt that names what to keep (right), the form
the upsampler writes. As typed, P-H3-Image often redraws the whole scene. As an edit prompt, only the requested part
changes.*
P-H3-Image combines many references at once. Given up to 8 pictures and a one-line request, the upsampler names each
picture and what to take from it, and P-H3-Image composes them into one scene.
<p align="center">
<img src="assets/multi_image.jpg" width="100%">
</p>
*Top, eight public-domain portraits and the dinner party P-H3-Image composed from them, from a one-sentence request.
Bottom, eight scientists at a poker table, seven presidents wading through the swamp with an astronaut, and characters
from our own renders in the same swamp.*
To write edit prompts without the upsampler, use this form.
```txt
Edit <Picture 1>. <The change, described as the finished result>. Keep <everything that must stay> exactly as it is.
```
- **Point to the exact thing.** Name the object, person or text you mean and where it is, such as "the old man's faded
blue cap" rather than "his hat".
- **Describe the result, not the action.** Say how the edited part looks in the finished image, and give new things a
size next to something already there, such as "about the size of the cat's head".
- **Say what stays.** List what must not change, such as faces, poses, the background and the light. Without this
list, P-H3-Image tends to redraw the whole image.
- **Quote new text exactly.** Put new text in quotes and name the text around it that must stay.
## Less GPU memory
With auto offloading, diffusers moves each component onto the GPU when a step needs it, so the pipeline runs on one
80 GB GPU such as an H100, peaking at about 76 GB at 8 MP.
```python
import torch
from diffusers import ComponentsManager, ModularPipeline
manager = ComponentsManager()
manager.enable_auto_cpu_offload(device="cuda")
pipe = ModularPipeline.from_pretrained("PrunaAI/P-H3-Image", components_manager=manager)
pipe.load_components(dtype=torch.bfloat16)
image = pipe(prompt=prompt, height=3360, width=2496, output="images")[0]
```
## Performance
One NVIDIA B200, bf16, batch size 1, 8 MP, no compilation or offloading.
| | Time | Peak GPU memory |
|---|:---:|:---:|
| Text-to-image, prompt as written | about 9 s | 83 GB |
| Prompt upsampler | 6 to 11 s more | 101 GB with the image model |
The 8 steps run over the checkpoint's own sampling grid. Pass `sigmas` to use another one. There is no guider,
`negative_prompt` or `guidance_scale`. For GPUs with less memory, use the int8 or w4a8 files in
[PrunaAI/P-H3-Image-Comfy](https://huggingface.co/PrunaAI/P-H3-Image-Comfy).
## Limitations
- **It is sensitive to prompting.** Hype words and very long prompts make images worse, and very short prompts give
weak results without the upsampler.
- **Hands can break, and small people in the background can come out distorted.** Rendering at 8 MP helps.
- **Text is not fully reliable.** Small or dense text, such as body copy or long code, turns into pseudo-text, and
longer passages sometimes get single letters wrong. Short quoted strings render well.
- **Lower resolutions show more artifacts.** At 2 and 4 MP, faces, hands and small details break more often than at
8 MP.
- **Single images only.** P-H3-Image does not generate video or audio.
## License
P-H3-Image is based on MiniMax-H3 and released under the [MiniMax H3 Community License](LICENSE). Please read it before
use. Among other terms, it excludes the European Union, the United Kingdom, the Republic of Korea and the United States
unless you have a separate license from MiniMax, and products built on it must show "Powered by MiniMax H3". The text
encoder's Qwen3-VL-4B parts and the prompt upsampler, based on Qwen3.5-9B, are under the
[Apache License 2.0](LICENSE-APACHE). See [NOTICE](NOTICE) for details.
## What's next?
- Compress your own models with [Pruna](https://github.com/PrunaAI/pruna) and give us a 猸愶笍 for more efficiency!
- Want to use our optimized image models right away? Check [P-Image-Ideogram](https://www.pruna.ai/p-image-ideogram) and [P-Image-Edit](https://www.pruna.ai/p-image-edit).
<style>
.model-button {
display: inline-flex;
flex-direction: row;
justify-content: center;
align-items: center;
gap: 8px;
padding: 8px 20px;
border: none;
border-radius: 8px;
background: #9334e9;
color: #ffffff;
font-size: 14px;
font-weight: 400;
line-height: 1;
text-decoration: none;
white-space: nowrap;
cursor: pointer;
box-sizing: border-box;
overflow: visible;
opacity: 1;
}
</style>
<a href="https://dashboard.pruna.ai/login?utm_source=huggingface&utm_medium=model_card&utm_campaign=hf_traffic" class="model-button">Try our models</a>
|