nifleisch commited on
Commit
90dba41
·
verified ·
1 Parent(s): 85eaa44

Add model card

Browse files

Model card with quickstart, recommended resolutions, prompting and editing guidance, and figures.

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

Git LFS Details

  • SHA256: 24e01545a0cd9716417d41cb5e134847a21b2d475bc29223dc590dc1dd8100d8
  • Pointer size: 131 Bytes
  • Size of remote file: 624 kB
assets/multi_image.jpg ADDED

Git LFS Details

  • SHA256: ee0c9775b222d2be273fe3303fec57ad61c44309303f72005c768ca29e0cd64a
  • Pointer size: 131 Bytes
  • Size of remote file: 761 kB
assets/p-h3-image.jpg ADDED

Git LFS Details

  • SHA256: fcd61d4a5a02de7e0a773ee1dbf4b0103f781772949980d82255ce9d76d8dff5
  • Pointer size: 132 Bytes
  • Size of remote file: 1.02 MB
assets/prompt.jpg ADDED

Git LFS Details

  • SHA256: 12f9fa3963b0354105685fcfc46ea38af9fbace472d58df8cbbb990d09270eaf
  • Pointer size: 131 Bytes
  • Size of remote file: 567 kB
assets/resolution_ladder.jpg ADDED

Git LFS Details

  • SHA256: a887f14fe44ff20276397b322b944958245f0e83ae27567f4276f3e0f9074e71
  • Pointer size: 131 Bytes
  • Size of remote file: 601 kB
assets/resolutions.png ADDED
assets/styles.jpg ADDED

Git LFS Details

  • SHA256: 22821811d9936a800b5b8f178bc0ca2865a208a0bc40a2ce86f471083a130d92
  • Pointer size: 131 Bytes
  • Size of remote file: 367 kB