I used MiniMax-H3 Image to replace a glowing cube in a transparent sticker with a gift box. The inputs were the original PNG, a tight crop of the gift box, and a separate cyan lighting reference. I wanted the glow on the hands to blend with the original, without changing the rest of the sticker.
I maintain TensorSharp, which I used to run this locally on an M5 Pro (48 GB, Metal). Both versions used the same Q4_K_M checkpoint and the linoyts two-step pDMD LoRA, at strength 1, CFG 1, and sigmas [1, 12/13, 0] with by-step heads. I changed only the reference short-edge floor in the request. This is not a two-step versus six-step test.
| Reference floor | Conditioning rows | Seed 0 request | Seed 42 request | Seed 42 denoise |
|---|
| Default (1024) | 3,259 | 127.1 s | 89.6 s | 86.7 s |
| 512 | 923 | 51.8 s | 43.9 s | 41.0 s |
The 512 setting kept the same 2016 × 2080 internal sampling grid and 1254 × 1254 output canvas. The request times are from local Server.Host and exclude process startup and transfers. The 512 requests followed the default ones in the same process, so cache state differs; these are single observations per seed and setting, not a cold-to-cold benchmark.
What changed in the image: the 512 render had a stronger cyan seam and a paler bow. The default render kept more of the blue panel shading and the gold ribbon. For this sticker, I'd use 512 for drafts and re-render at the default floor before export. The attached crops show the unretouched outputs over both dark and light backgrounds.
The mask and the matte serve different purposes. The edit mask marks where the model can make changes. The foreground matte sets opacity inside that area because the MiniMax decoder produces RGB. Both runs used the same matte, and all 1,547,143 mask-zero pixels stayed identical in decoded RGBA. One thing I learned the hard way: the first gift reference had fingers over its lower corner. Cleaning the reference stopped the model from copying that pink notch without a mask change.
Reproduce with your own images
Install the .NET 10 SDK, CMake 3.20+, and Xcode Command Line Tools on Apple silicon. Then follow the pinned build notes:
git clone https://github.com/zhongkaifu/TensorSharp.git
cd TensorSharp
git checkout f7c3ca8f6e28a5c58e07a43cebb459130deb78e5
TENSORSHARP_GGML_GIT_REF=bb877c0c51f38c52ee2d5e41d58e3d0c20f3fed4 \
dotnet build TensorSharp.Cli/TensorSharp.Cli.csproj -c Release
Change the paths and prompt below. The first image is the source; the next two are the object and lighting references. The edit mask and foreground matte are separate grayscale PNGs at the source's exact dimensions. White means edit in the mask, but opaque in the matte; black means keep in the mask and transparent in the matte. Gray provides partial coverage.
SOURCE="/absolute/path/to/source.png"
REF_OBJECT="/absolute/path/to/object-reference.png"
REF_LIGHT="/absolute/path/to/lighting-reference.png"
MASK="/absolute/path/to/edit-mask.png"
MATTE="/absolute/path/to/foreground-matte.png"
PROMPT="Replace the glowing cube in Picture 1 with the gift box from Picture 2. Use Picture 3 only for lighting. Match the soft cyan light around the gift and preserve everything outside the selection."
export TENSORSHARP_MODELS="${TENSORSHARP_MODELS:-$HOME/.cache/tensorsharp/models}"
mkdir -p "$TENSORSHARP_MODELS" masked-edit-results
cli=(dotnet TensorSharp.Cli/bin/TensorSharp.Cli.dll)
common=(
--backend ggml_metal --config config/minimax-h3-image-q4km.json
--lora config/lora/minimax-h3-image-pdmd-2step.json
--image "$SOURCE" --image "$REF_OBJECT" --image "$REF_LIGHT"
--prompt "$PROMPT" --mask "$MASK" --mask-mode grayscale
--mask-feather 0 --mask-crop --mask-crop-padding 64 --keep-source-size
--mask-foreground-matte "$MATTE" --diffusion-seed "${SEED:-0}"
)
"${cli[@]}" "${common[@]}" --output masked-edit-results/minimax-default.png
"${cli[@]}" "${common[@]}" --reference-floor 512 \
--output masked-edit-results/minimax-floor512.png
The Q4_K_M preset and pDMD preset pin the weights and adapter. Check their terms separately from the runtime license. Each CLI call starts a separate process, so don't compare its shell wall time directly with the server numbers above.
For anyone using H3 Image for local edits: what reference sizes have held up best for you when the replacement needs fine edges or reflected light?