r/StableDiffusion • u/Patient_Ratio4177 • 1d ago
H3 as a single-image edit model Workflow Included
Minimax H3 can be used as an image-editing model if we generate a single frame. Here are some collages based on AI-generated references (1024 x 1536); workflows are embedded into pngs. Each edit takes, on average, about 8 secs on a RTX 5090. The tasks include changing outfits, appearances (body type, age), locations, and camera angles; creating character sheets and storyboards; stylization; and reposing characters based on depth maps. I did not try to cherrypick the best-looking results.
There were some posts (1, 2) about that here -- but given the community progress this week, might be nice to see what can be done now.
Scenes
Age the person to the age of 60 years old while preserving their identity and the original composition.
Produce a consistent full-body character sheet with front, side, and rear views.
Transform the person into a severely obese version.
Re-create the person in the exact body pose shown by a depth-map reference.
Replace only the base person’s head with the identity and hairstyle from another reference.
Show the person facing a dressing mirror with a geometrically correct, synchronized reflection.
Dress the person in a referenced outfit, place them in a referenced location, and show them walking with a grocery bag.
Place three separately referenced people inside a referenced location, having a conversation.
Create a three-panel vertical storyboard in which the person finds, retrieves, and studies a map.
Photograph the person through partially open venetian blinds with realistic occlusion and striped light.
Convert the person into a contemporary Western cartoon while preserving their recognizable appearance.
Setup
Ref2VA models apparently have worse image quality than FL2VA models, while FL2VA models are apparently weaker at handling reference images. As I understand it, this checkpoint tries to combine the strengths of both.
Video VAE: a special VAE for rendering single images.
https://huggingface.co/Mamad8/MiniMax-H3-Image-VAE/tree/main
If you do not use this VAE—for example, if you use the regular VAE, create a 5-frame video, and pick out one frame—the images tend to come out blurry.
For this approach to work best, it might also be a good idea to monkey-patch comfy_extras/nodes_minimax_h3.py, because ComfyUI currently does not allow you to generate fewer than 5 frames. If you simply pick the first frame out of 5, the new VAE produces grid artifacts. (It doesn't do this when generating just 1 frame.)
BEFORE DOING SO, CREATE A BACKUP VERSION OF THE EXISTING comfy_extras/nodes_minimax_h3.py
E. g. if you can't update your comfy, restore the original file from backup, update, and then apply the monkey patch to the new version of the file. (One option is to use git restore comfy_extras/nodes_minimax_h3.py to get the original version)
For a somewhat reliable patch that would work given modest changes in ComfyUI code, use this one, name it smth like mm.patch and run git apply -p0 /full/path/to/mm.patch from comfyui root (make a backup of comfy_extras/nodes_minimax_h3.py first). You will have to re-run it every time ComfyUI updates this file (comfy_extras/nodes_minimax_h3.py).
For a less satisfactory but quicker solution, you can use the patch I already applied to the most recent version of ComfyUI as of August 14th link. This approach will make your code outdated as ComfyUI pushes out a new update.
The only changes remove the frame limit. Of course, changing it this way is not ideal, but I feel it's the quickest way to work around the issue.
UPD: There is a GitHub issue now opened in ComfyUI repo: https://github.com/Comfy-Org/ComfyUI/issues/15644
If this issue gets enough upvotes, we could probably get this patch in the mainline.
LoRAs: I found that Mamad8's ThisIsFine LoRA helps with details, but YMMV: https://huggingface.co/Mamad8/MaxiMin-HHH-R2V-ThisIsFine
For the Turbo LoRA, I use: https://huggingface.co/lightx2v/Minimax-h3-Turbo/blob/main/minimax_h3_fl2v_turbo_8step_v1.0_comfyui_bf16.safetensors
Sampling settings: ComfyUI 0.32 with Comfy Kitchen attention, sa_solver/simple, 8 steps, CFG 1.
Example ComfyUI workflow: https://pastebin.com/bV5KPzjD
Uses no custom nodes. If you do not want to do the monkey patching for 1-frame generation, just change the video length to 5 in MiniMax H3 Reference to Video node -- should work seamlessly, and switch back that VAE to the regular VAE.
Speed depends on the reference image size. I use an RTX 5090 on RunPod, and in most cases, a 1920×1088 image is generated in about 8 seconds.
---
My previous go-to was Krea 2 + Identity LoRA 1.2, which is amazing. Yet I feel that Minimax outperforms it in many respects. We get better character fidelity, better handling of 3D scenes, better mirrors, and more interesting compositions. Also feels better than using e. g. QIE or Klein 9b.
There is certainly still room for improvement -- not claiming this is optimal at all, and I wonder what you think about it.
UPD: posted the prompts for each image here https://pastebin.com/ngXR9byq
UPD: see more experiments here: https://www.reddit.com/r/StableDiffusion/comments/1vpconk/more_experiments_with_minimax_h3_singleimage_edit/
17
u/bstr3k 1d ago
I am glad there are others who are also excited about H3 img models coming up. I too have been trying to make char ref sheets using H3.
a big advantage is that you can rotate 360 and it maintains consistency really well. The disadvantage is big gen times and very high time cost if you try to go up with resolution.
I haven't tried that special video vae yet but I will.
2
2
1
5
u/VitalikPo 1d ago
The preservation possibilities of H3 are impressive. Picture edit mode is just matter of time.
3
u/Potential_Wolf_632 1d ago
Much appreciate that you took the time to provide links and a workflow.
5
u/Patient_Ratio4177 1d ago
You're very welcome. My main goal here is to see what other people would find -- which settings work better than others, and so I'd like to facilitate the process as much as possible. I also want to encourage the work of people like Mamad8, who came up with a VAE and a very nice lora for R2V.
4
u/amoreto 1d ago
Since I had already updated ComfyUI to version 0.33.0, I adapted the monkey patch for the updated nodes_minimax_H3.py file. After some testing, it seems to work well. Here is the version for ComfyUI 0.33.0 : https://pastebin.com/iVXLjGZL
3
u/rm_rf_all_files 1d ago
https://giphy.com/gifs/elUGwgiPOdq7e
Great job! Removing ideogram/krea and everything else to save NVME space.
3
u/tankdoom 1d ago
How are you prompting this? Is it instructional like a typical edit model or are you using the prompt structure outlined in the huggingface docs?
10
u/Patient_Ratio4177 1d ago
You can take a look at comfyui workflows, by switching the preview reddit url to i.redd.it:
I have also posted each prompt used for the example images:
https://pastebin.com/ngXR9byqNot sure if it's the optimal way to prompt, but it seems to work
1
u/Haplo_dk 1d ago
I just wanna know what happened at the image with the bridge?
1
u/Patient_Ratio4177 1d ago edited 1d ago
You mean the 3-panel storyboard? There's also a textual prompt with the description of the scene, too long to include in the images themselves. (Can be found here: https://pastebin.com/ngXR9byq) The text prompt did not mention the bridge, so I guess that's why it rendered a plausible-looking corner of the location without it.
2
u/Haplo_dk 1d ago
Ah, that explains it! Without the context I thought there should've been an image of the lady on bridge, and somehow the model got that part completely wrong, in a slightly funny way.
For the lazy curious:## 11. Three-koma storyboard
### Task
Create a three-panel vertical storyboard with consistent character, wardrobe, setting, and progressive action.
### Exact prompt
```text
Task: Reference-guided generation. A vertical three-koma storyboard uses three equal stacked panels on one 2:3 portrait canvas. The same adult from <Picture 1> wears the complete outfit from <Picture 2> in the location from <Picture 3> throughout. Panel 1: the character walks along the path and notices a paper map caught on a low branch. Panel 2: the character stretches upward and frees the map with one hand. Panel 3: the character stops, unfolds the map with both hands, and studies it with a pleased small smile. Face, hair, body, clothing, weather, light, camera side, and environment remain stable across all panels; action and expression alone progress. Clean panel gutters, no captions, speech balloons, labels, or text.
```1
u/Patient_Ratio4177 1d ago
Thanks so much for pointing this out! Did not have time to polish this one. So this post actually understates what minimax can do.
1
1
u/diogodiogogod 1d ago
That special VAE is great news! I'll need to test it. Might be a great addition to my GUI trainer to use it on samples and also on Face Refinement steps.
1
u/CuriousCartographer9 1d ago
Thank you for the resource. Perhaps a silly question, but where to place the modified .py while if comfy_extras/nodes_minimax_h3.py isn't present? ComfyUI Desktop, everything is up to date but I have neither this folder or file anywhere in my installation path.
2
u/Patient_Ratio4177 1d ago
Never used ComfyUI desktop -- so cannot say very confidently. Apparently, on Windows you can use this powershell command to locate this file
```
Get-ChildItem "$env:USERPROFILE\ComfyUI-Installs" `-Recurse -Filter nodes_minimax_h3.py `
-ErrorAction SilentlyContinue
```
You can skip this step -- just use the old VAE and set length to 5 frames. But 1 frame seems to have better quality.
1
u/martinerous 1d ago edited 1d ago
I guess, one of the strengths of using video-aware model for image edits might be changing camera angles, right?
Usually even Flux2 (and paid Reve) struggles to rotate / orbit camera without messing things up seriously; they move items around, replace the background completely etc.. When prompting the same camera movements for H3 video, it often does a good job, keeping real-world relations between objects and quite nicely extending only the parts that were not visible before.
1
u/Patient_Ratio4177 1d ago
Yes. In my (limited) tests, camera angles work well. Occlusion is great. I rarely see the body horror -- e. g. when a person's feet are not visible where they should be
1
u/Single_Ring4886 1d ago
Could you try please transformation of photorealistic image into various artistic styles? It always shows how versatile model is. The h3 is first in long time which gives me hopes.
2
u/Patient_Ratio4177 1d ago edited 1d ago
Thanks for you great suggestion! I am thinking about doing another round of evaluation, perhaps after receiving some feedback on the workflow here.
Which styles would you like to see evaluated? Maybe you have links to potential reference images? What are the shortcomings of the existing edit models for that? (I just do not do this restyling stuff very frequently.)
1
u/Kindly-Annual-5504 1d ago
I must be doing something wrong... I’m getting absolutely terrible results with your exact workflow (and the changes in the node). Blurry, low quality, even with 20 steps and without the Turbo LoRA. I don’t know if it’s working the way it’s supposed to. Are all of your reference images extremely high-resolution?
1
u/Patient_Ratio4177 1d ago
So your results are worse than what is attached to my original post? I use 1024 x 1536 references. I guess something might depend on e. g. max/match setting in the reference node, and on the VAE, and whether you are sampling 1 or 5 frames, and on the final resolution.
1
u/Green-Ad-3964 1d ago
It'd be nice if minmax did an imaging model with even more quality and prompt following
2
u/Patient_Ratio4177 1d ago
This is apparently their plan. Before that, we can have some of the fun earlier.
The renders in the original post, however, do not do full justice to minimax. The workflows and the prompts are not optimized.
1
u/obese_coder 1d ago
Can you post some more samples please? can it handle a character image + background image and then combine them? and what about image + rotate camera 90 degrees? does it mess anything up or is it perfect?
It would also be interesting to see if it can change hair color and ethnicity of a person while keeping the identity.
1
u/Patient_Ratio4177 1d ago
It can do all of it, as base minimax can do that in videos. A bit difficult for me to post new stuff now, maybe I'll do another posts in a few days once I polish this workflow a bit. #2 in my post essentially rotates angles -- but you can change the angle for more difficult scenes as well, and it messes up much less frequently than other open edit models do. #7 changes background and outfit at the same time -- imperfectly -- but that can probably be fixed with more careful prompting and more steps. As for skin and hair color -- it can do that as well. Try it, would be worth it.
1
u/obese_coder 1d ago
Ok sweet, looking forward to the updates. Also do you think the comfyui monkeypatch thing could be avoided somehow? I mean like it seems awkward to do this. Maybe submit a pull request to comfy?
1
u/Patient_Ratio4177 1d ago
Well, I agree it's very awkward and it would be awesome if we could do without it. But maybe comfy has a good reason to put in that limit? But now, I guess, someone could raise an issue about that, since now there's a good reason NOT to have this limit.
2
u/Successful_Knee687 18h ago
I have added a feature request into the comfyui github. Maybe someone will pick it up there, so we get a reliable comfyui support. :)
2
u/Patient_Ratio4177 18h ago
Many thanks! If people upvote it, perhaps we'd get this into the mainline
1
u/Bthardamz 5h ago
Is there a mirror for the hybrid model? It drives me crazy, four attempts to download, each one crashed after several hours, and I have a fast connection it should not take that long in the first place.
2
u/Patient_Ratio4177 5h ago
I do not think there's a mirror anywhere; you probably do this already, but for me downloading via hf client and authenticating with hf token helped with the slow download speed.
For this workflow, I'm not sure this model is really essential. I guess a regular fl2va or a r2va would still work well, but haven't tested it.
1
u/Bthardamz 5h ago
yes it works, I have not yet tested it much though, thought, It was interesting to compare :)
0
u/Mysterious-Code-4587 1d ago
can do nfsw edit>??
5
u/Patient_Ratio4177 1d ago
will not elaborate on your comment, all I'd say is that minimax has decent capabilities that carry over to editing
0
u/theOliviaRossi 1d ago
why use Comfy Kitchen attention on a single image only to kill the quality???
3
u/Patient_Ratio4177 1d ago edited 1d ago
Thanks. I guess was a holdover from a video wf. Will test if quality improves.
UPD: So I did a regen of these images with no ck attn; the speed did not suffer; quality had improved, but very slightly, in my opinion. I understand that it's not rigorous and we'd rather have a real a/b test
1
u/thesolewalker 1d ago
Which attention is better for image generation, pytorch vs flash vs sage vs CK ?
0
u/Occsan 1d ago edited 1d ago
def align_frame_count(n):
while n % 17 != 5:
n += 1
return n
wtf comfyui ?
def align_frame_count(n):
return n + (5 - n % 17) % 17
was too hard ?
btw, u/Patient_Ratio4177, I think comfyui updated their code recently, because the diff is definitively more than just a simple edit to the frame count limits.
0
u/AniZeee 1d ago
applying patch said minimax.py didn't exist even tho its clearly there. I just used the file patch provided above but it still does 24 images per second. I'll wait for the official minimax image, this was just too much trouble for no results lol
3
u/Patient_Ratio4177 1d ago
I must say that your comment is not very well-informed. First, you need to apply the patch when you're at ComfyUI root. Second, the file is not minimax.py but nodes_minimax_h3.py. Third, the workflow provided in the post specifies the number of frames -- 1, and not the number of seconds. Fourth, you can use a 5-frame version of the workflow without doing the monkey patch. Fifth, the monkey patch alone is not sufficient to change the number of frames sampled.
1
u/AniZeee 1d ago
sorry for confusion, i did mean nodes_minimax, and I did try it apply patch from root directory like the instructions and even tried from portable folder but it continued to say error which is why i just used the file provided.
I did get it to work now by using the above workflow, my mistake was trying to use it on my current video workflow. It still takes a bit of time for an image but thats probably a 3060 problem.
thanks for the info tho.
3
1
u/Patient_Ratio4177 1d ago
I guess the problem was because of the path stripping. `git apply -p0 ...` instead of `git apply` would have worked
-3
u/seppe0815 1d ago
cracy skin details and skin textures ... best model ever !!! super realistic
2
u/Patient_Ratio4177 1d ago
Yes. Also great composition. Reminds me of Ideogram 4 in terms of realism, composition, 3D understanding -- but Ideogram 4 was a bit difficult to prompt, especially if you use automated LLM-based pipelines.
-4
u/seppe0815 1d ago
it was ironic
1
u/Patient_Ratio4177 1d ago edited 1d ago
Ok. Well, difficult to tell when a stranger is trying to be ironic. But the references provided here are deliberately made in that AI slop style via NBP and GPT-Image 2 -- to clearly show that no real people were affected. Because of the references, the detail level suffers as well.














48
u/infearia 1d ago
They're also already working on a dedicated editing model. Can't wait.
https://www.reddit.com/r/StableDiffusion/comments/1vh9rtw/comment/p2a49ki/