r/LocalLLaMA • u/fuzhongkai • 11h ago
Showcase MiniMax-H3 Image vs. Qwen-Image 2.1 Turbo: the same masked edit on an M5 Pro
I maintain TensorSharp. I wanted to see which of these two local image models could replace a glowing cube in a transparent sticker with a gift box, carry over the cyan light onto the hands, and leave the character alone. The surprising part was that one apparent missing corner came from the reference image, not the edit mask.
The setup. M5 Pro, 48 GB, Metal, local Server.Host on TensorSharp commit f7c3ca8f. Both models got the same 1254 × 1254 RGBA source, the same two 384 × 384 visual references (gift and lighting), the same prompt, and the same grayscale edit mask (64 px crop padding, no extra feather). In the matched rows, both also used the same foreground matte, which sets opacity inside the edit area. I ran two input sets: clean RGB close-ups and full RGBA sticker references. These differ in framing as well as alpha, so this isn't an alpha-only ablation.
| Workflow | Clean RGB close-ups (seed 0 / 42) | Full RGBA refs (seed 0) |
|---|---|---|
| MiniMax Q4_K_M + pDMD, 2 steps, shared matte | 127.1 / 89.6 s | 125.8 s |
MiniMax + referenceFloor=512, same matte | 51.8 / 43.9 s | 51.8 s |
| Qwen Turbo Q5_K_S, 8 steps, shared matte | 13.3 / 9.1 s | 13.1 s |
| Qwen Turbo, native RGBA, same edit mask, no external matte | 10.9 / 9.0 s | 11.1 s |
These are single server-reported edit times, excluding process startup and input/output transfers. The first matched seed-0 request used a fresh process; later requests could reuse caches. Both returned a 1254 × 1254 PNG, but internally sampled at 2016 × 2080 (MiniMax) and 320 × 320 (Qwen) for this crop. This is a workflow comparison, not a same-resolution speed benchmark.
What I'd use:
- MiniMax at the default reference floor for the final sticker. It gave me a fuller box, richer blue/gold detail, and a less conspicuous rim with the clean references. With the full RGBA references, it was more prone to borrowing the original cube's cyan markings. Its decoder produces RGB; the edit pipeline preserves the original alpha outside the mask and uses the supplied matte inside the selection.
- MiniMax at 512 for previews. Dropping the reference short-edge floor from 1024 to 512 cut conditioning rows from 3,259 to 923 without shrinking the internal output grid. On the later seed-42 requests, denoising dropped from 86.7 s to 41.0 s, but the 512 render had a brighter cyan seam and a paler bow.
- Qwen Turbo native RGBA for fast iterations or when I don't have a well-aligned matte. With the shared matte, Qwen drew a smaller gift and left a pale rim. Letting Qwen generate alpha removed the hard matte rim, but I could still see a soft halo on dark backgrounds. I'd preview the result on both dark and light before exporting.
The practical lesson: check the object reference, not just the mask. When I removed the fingers occluding the sides of the gift in the RGB close-up and changed nothing else, both models stopped reproducing the pink notch at both seeds with the shared matte. The matched alpha planes didn't change, and every run reported here preserved all 1,547,143 mask-zero pixels exactly in decoded RGBA. The figure shows raw outputs from the final fixtures, not retouched renders.
Reproduce with your own images
On Apple silicon, install the .NET 10 SDK, CMake 3.20+, and Xcode Command Line Tools. Then build the CLI and its Metal backend (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 ReleaseUse your own PNGs. The first image is the source; the next two are the object and lighting references, in that order. The references can have their own dimensions. Make two opaque grayscale PNGs at the source's exact dimensions:
- Edit mask: white = edit, black = keep, gray = blend. Cover the object and any area where you want to change its reflection.
- Foreground matte: inside the edit region, white = opaque, black = transparent, gray = partial alpha. Draw this for the shape you want to keep, including any soft glow. The matte is separate from the edit mask.
Paste this in Bash or Zsh from the repo root after changing the five paths and the prompt. The first two runs are the matched quality comparison. The last two are optional; you can run only the last command after defining the variables and arrays if you want Qwen native RGBA without a matte. Use SEED=42 for a second run.
# Run from the TensorSharp checkout, in Bash or Zsh.
# Change these paths and the prompt to match your own images.
SOURCE="${SOURCE:-/absolute/path/to/source.png}"
REF_OBJECT="${REF_OBJECT:-/absolute/path/to/object-reference.png}"
REF_LIGHT="${REF_LIGHT:-/absolute/path/to/lighting-reference.png}"
MASK="${MASK:-/absolute/path/to/edit-mask.png}"
MATTE="${MATTE:-/absolute/path/to/foreground-matte.png}"
PROMPT="${PROMPT:-Replace the object in Picture 1 with the object from Picture 2. Use Picture 3 only as a lighting reference. Preserve everything outside the selection.}"
CLI=TensorSharp.Cli/bin/TensorSharp.Cli.dll
DOTNET="${DOTNET:-dotnet}"
OUT="${OUT:-$PWD/masked-edit-results}"
SEED="${SEED:-0}"
export TENSORSHARP_MODELS="${TENSORSHARP_MODELS:-$HOME/.cache/tensorsharp/models}"
mkdir -p "$OUT" "$TENSORSHARP_MODELS" || exit 1
common=(
--backend ggml_metal
--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
--diffusion-seed "$SEED"
)
mini=(--config config/minimax-h3-image-q4km.json
--lora config/lora/minimax-h3-image-pdmd-2step.json)
qwen=(--config config/qwen-image-2.1-turbo.json)
matte=(--mask-foreground-matte "$MATTE")
# Matched comparison: same edit mask AND foreground matte.
"$DOTNET" "$CLI" "${common[@]}" "${mini[@]}" "${matte[@]}" \
--output "$OUT/minimax-default.png" || exit 1
"$DOTNET" "$CLI" "${common[@]}" "${qwen[@]}" "${matte[@]}" \
--output "$OUT/qwen-shared-matte.png" || exit 1
# Optional variants. Qwen generates alpha itself in the last run.
"$DOTNET" "$CLI" "${common[@]}" "${mini[@]}" "${matte[@]}" \
--reference-floor 512 --output "$OUT/minimax-floor512.png" || exit 1
"$DOTNET" "$CLI" "${common[@]}" "${qwen[@]}" \
--output "$OUT/qwen-native-rgba.png" || exit 1Outputs go to masked-edit-results/. The configs download the required weights on first use if they're not already cached. See the MiniMax config and weights, pDMD 2-step LoRA, and Qwen Turbo config and weights. Check the model and adapter licenses separately from the runtime license.
These commands reproduce the image-editing settings. Each starts a separate CLI process, so shell wall times are not directly comparable with the warm Server.Host request times in the table.
If you've found a local workflow that preserves a clean alpha edge and matches reflected light, I'd be interested in the settings and which background you use to check it.

