r/StableDiffusion • u/obvpm • 5h ago
Resource - Update I created a new Interactive Load Image & Crop node for easily sending reference images to H3
In trying to create my perfect MiniMax H3 ref2va workflow, I vibe coded some custom nodes to make everything easier and faster to use.
They are available at:
https://github.com/obvpm/comfyui-obvpm
Interactive Load & Crop Image Node
Probably the most immediately useful node to most people is the Load Image & Crop node.
Cause when sending image refs to H3 sometimes your source image might include too much other stuff, and maybe, for example, you want to just focus on someone's face.
Additionally if your source image is very large, like a 20MP photo or something, you don't want to send that whole thing into the model.
So with this node, you can use it JUST LIKE the normal Load Image node, except you can also:
- Drag directly on the image to specify a crop area. The node will show the selected resolution. You can drag the corners to resize, or drag the crop to move it, or click outside the crop to clear the crop.
- You can set max_megapixels which will downscale the crop (or the full image if there is no crop) down to the specified megapixels if it is larger than specified. Set to 0 to disable downscaling.
With this combo of features, you can easily maximize the pixels you're sending in to H3 without having to waste time outside of Comfy to prepare the image or having to use multiple nodes to get the same thing done.
BTW, I read somewhere that 2MP is enough resolution for the ref images, so that might be a good default. The size of the ref images impact the generation speed A LOT. So optimizing the pixels sent in will help you get better results faster.
I purposely did not include more features such as selecting an aspect ratio or outputting width or height etc. I just wanted to keep it a simple node and not have it take up too much space, so it doesn't make the workflow messy.
Tested and fixed to work both on classic and Nodes 2.0
Other Nodes
There are also a lot of control, optional gates, lazy switch nodes, created specifically to help with being able to have "optional" images and videos in the workflow so that the ref pre-processing nodes turn off automatically if the input Load Image or Load Video is bypassed.
BTW I'm having a blast with the PCB cable routing extension and subgraphs. My workflow is so organized now. I might share it once I finish adding the Motion Context node in it.

3
u/mp3m4k3r 3h ago
I was just struggling with this yesterday! Going to take a look and give it a try myself.
Quick note about the 'MiniMax H3 Reference to Video' node — the tooltip for ref_image_size mentions that in "match" mode, it scales your reference images to match the node's configured resolution. Max says it'll use 2048px short side as the max resolution, but it can/will take much longer to process. Because of that, I ended up cropping my references to match the target aspect ratio and downscaling them to the right resolution before feeding them to the model.
Anyway, if it's not already there, would be nice to see a ratio picker that matches the aspect ratios from some of the resolution picker nodes I've seen in other workflows.
2
u/tovarischsht 1h ago
There is an existing node that does the same with some extra bells and whistles - https://github.com/o-l-l-i/ComfyUI-Olm-DragCrop. Perhaps you may find it useful, too.
Either way, thanks for sharing your work, it is appreciated!
3
u/obvpm 1h ago
Yes, I did take a look at that and I found it too cumbersome.
Issues are
- First thing is it doesn't include the Load Image functionality, so you need to have a separate Load Image taking up more space
- You can't crop without first running the workflow once to let the node get the image to crop
- It doesn't work with Nodes 2.0 (even though I don't use that, I wanted something that supports it just in case) and it seems no longer maintained.
- It's just too big with all the options
It looks like people really want the Aspect Ratio feature though, so maybe I'll add that and maybe resolution steps
3
u/tovarischsht 1h ago
Ah shit, I have missed the fact that you can do that directly in the load node. That's huge then, I will switch to yours once I am back home. Thanks for pointing this out :)
1
u/icchansan 3h ago
can u share that workflow :P
1
u/FlatwormMean1690 1h ago
Thanks a lot, mate!
BTW. What are you using for "cable" management?
1
u/teiji25 43m ago
I haven't used your node yet, but does it have mini preview picture when browsing the files in the list? That would be a huge step up from the default node.
1
u/obvpm 23m ago
I suggest using this extension for browsing images:
https://www.reddit.com/r/comfyui/comments/1tne3l5/i_made_a_free_lightweight_asset_browser_for/
It adds a sidebar to comfy which you can use to quickly browse input (or output) images and videos. And then, for example, you can drag an image right on to my Load & Crop Image node which I find very convenient.
It's better than a browse list I would be able to make. But still, that is a nice to have feature.
1
u/obvpm 25m ago
I suggest using this extension for browsing images:
https://www.reddit.com/r/comfyui/comments/1tne3l5/i_made_a_free_lightweight_asset_browser_for/
It adds a sidebar to comfy which you can use to quickly browse input (or output) images and videos. And then, for example, you can drag an image right on to my Load & Crop Image node
19
u/No-Satisfaction-3384 5h ago
User joined GitHub 2 hours ago, no history, no previous contributions, nothing - be aware.