ComfyUI Node
P-H3 Prompt Writer
Writes Text2Image and Image2Image prompts with Pruna's P-H3 upsampler. Text2Image can describe the first active reference with use_ref_description; only text reaches the image generator. Load p-h3-image_prompt_upsampler with Load CLIP, type minimax. The first enabled picture is the image to edit; the others are references. VIDEO, IMAGE batches and visual RefMods support exact frame selection. RefMods are expanded to pictures and re-encoded by P-H3, not passed as video latents. Wire references through MiniMax-H3 Reference Slots to p-h3-image Conditioning, and connect width and height to keep its canvas in step with this writer.
P-H3 Prompt Writer
- upsampler
- references
- refmod_vae
- aspect_ratio
- prompt
- thinking
- summary
- width
- height
- references
◄taskText2Image►
◄prompt►
◄keep►
◄resolution1:1►
◄megapixels8►
◄match_image_ratiotrue►
◄refmod_images3►
◄max_length2048►
◄thinkingtrue►
◄bypassfalse►
◄repeat_lastfalse►
◄library_pick►
◄reference_layout►
◄reference_instructions►
◄video_images3►
◄frame_selection►
◄use_ref_descriptionfalse►
CategoryMiniMax-H3
Inputs (21)
| Name | Type | Default | Description |
|---|---|---|---|
| upsampler | CLIP | Load the P-H3 prompt upsampler, not its 4B text encoder; Load CLIP type minimax. | |
| task | COMBO | Text2Image | Text2Image uses text only; use_ref_description can describe the first active reference for its prompt. Image2Image uses the first enabled picture as the base. |
| prompt | STRING | What to create or change. Name references as <Picture 1>, <Picture 2>, etc. | |
| keep | STRING | For edits: faces, poses, objects, composition or lighting that must stay unchanged. | |
| resolution | COMBO | 1:1 | 7 options: 1:1, 4:3, 3:4, 3:2, 2:3, 16:9, +1 |
| megapixels | COMBO | 8 | 2 options: 4, 8 |
| match_image_ratio | BOOLEAN | true | Image2Image uses the first picture's aspect ratio unless aspect_ratio is supplied. Otherwise use resolution. |
| refmod_images | INT | 31–8 | Automatic pictures per visual RefMod, evenly selected. The frames picker overrides this per socket. The total, including ordinary images, must fit within eight. |
| max_length | INT | 2048256–32768 | Token budget per model call, including thinking. With use_ref_description it applies separately to the description and final prompt. Increase if it produces no final text. |
| thinking | BOOLEAN | true | — |
| bypass | BOOLEAN | false | Pass prompt through as written; references and canvas are still prepared. |
| repeat_last | BOOLEAN | false | Reuse the last prompt or the library choice. The current references and canvas still pass through. |
| library_pick | STRING | Which saved prompt this node hands on instead of writing one, as JSON written by the library window. It is a widget so the choice is saved with the workflow and reaches an API run: a pick the graph does not carry is a graph that reproduces something else. It applies only while 'repeat_last' is on. That switch is what hands a kept prompt on at all; this says which one, and empty means the node's own last answer. | |
| reference_layout | STRING | Reference strip order and disabled sockets, saved as JSON. | |
| reference_instructions | STRING | Instructions per input socket, saved as JSON. Applied to each picture expanded from that socket. | |
| referencesopt | COMFY_AUTOGROW_V3 | — | |
| refmod_vaeopt | VAE | The original MiniMax-H3 video VAE, only for RefMods without stored or decoded pictures. | |
| video_imagesopt | INT | 31–8 | Automatic frame count for VIDEO and IMAGE batches larger than eight. Smaller IMAGE batches keep all frames. The frames picker overrides this per socket. |
| frame_selectionopt | STRING | Selected zero-based frame indices per socket, saved as JSON by the frames picker. Missing sockets use automatic selection. | |
| aspect_ratioopt | STRING,COMBO | Optional, and it overrides the picker while something is connected. Reads a ratio ('16:9'), a frame size ('3840x1080') or a bare number ('1.78'), and a label around the pair is fine -- '3:4 (Portrait Standard)' reads as 3:4. A size within 2% of a listed ratio is called by its name, so 1376x768 arrives as 16:9 rather than as 43:24. Also overrides match_image_ratio in Image2Image. | |
| use_ref_descriptionopt | BOOLEAN | false | Text2Image only: describe the first active reference's first selected frame, then write a standalone prompt from that description and the user request. Both steps use this upsampler. The user request takes priority; role says what to take from the picture. No reference images reach the image generator. Bypass passes the original prompt through. |
Outputs (6)
| Name | Type | Description |
|---|---|---|
| prompt | STRING | — |
| thinking | STRING | — |
| summary | STRING | — |
| width | INT | — |
| height | INT | — |
| references | H3_REWRITER_REFERENCES | Image2Image: expanded pictures in prompt order. Reference Slots picture_1 goes to P-H3 Conditioning image_1, and so on. Text2Image returns an empty bundle, including with use_ref_description. |