ComfyUI_MiraSubPack Introduction
ComfyUI_MiraSubPack is a collection of experimental ComfyUI nodes that complement ComfyUI_Mira. It gives you tools for placing an image patch onto another image, working on large images in smaller overlapping tiles, handling VAE encoding and decoding, and adjusting how certain models use GPU memory and compute precision.
For an AI artist, the tiled-image tools are especially useful when you want to refine or upscale a large image piece by piece. The overlap and blending tools help bring those pieces back together without obvious borders. The pack also includes options for giving individual tiles different prompt text and for matching their colors after generation.
These are building blocks for ComfyUI workflows, not a single one-click upscaler. The example workflow images below show how the nodes can be connected.
How ComfyUI_MiraSubPack Works
Think of a large image as a mural that is easier to work on in smaller panels. A tiled workflow cuts the image into overlapping tiles, processes each tile, then blends the panels back into one image. Overlap gives neighboring tiles shared image content; feathering gradually blends their edges so the join is less noticeable.
A typical image-tile workflow follows this path:
- Crop: Divide the image into overlapping tiles. The crop node also creates a
mira_itu_pipeline, which carries the tile layout and merge settings. - Encode and sample: Convert the tiles into latents with a VAE, then use a tiled KSampler to generate or refine them. A latent is the compact representation the model works on during generation.
- Decode and correct: Convert the results back into images. If processing has shifted their colors, compare them with the original tiles and apply color correction.
- Merge: Use the saved pipeline settings to place the processed tiles back in their original positions and blend their overlaps.
You can also merge tiles while they are still latents, before decoding. The two merge nodes serve different points in a workflow; choose the one that matches the type of tiles you have.
Separately, Image Merge By Pixel Align is for placing a patch onto a base image. It looks for matching visual details to align the patch, can exclude a chosen background color, and feathers its edges into the base. For example, you might use it when a generated replacement area needs to line up with the original artwork.
ComfyUI_MiraSubPack Features
Image merging
- Image Merge By Pixel Align (
ImageMergeByPixelAlign_MiraSubPack) aligns a patch to a base image using matching image features. You can exclude a background color in the patch and blend the placed area with solid central coverage and softer edges. This is useful when simply placing a patch at fixed coordinates would leave it misaligned or visibly outlined.
<img src="examples/ImageMergeByPixelAlign.png" width="600" alt="Example result of Image Merge By Pixel Align">
<img src="examples/ImageMergeByPixelAlign_workflow.png" width="600" alt="Image Merge By Pixel Align workflow">
Tiled image upscaling and refinement
- Image Crop to Tiles (
ImageCropTiles_MiraSubPack) divides an image into overlapping tiles and outputs themira_itu_pipelineneeded to merge them later. - Image Crop to Tiles by Pixels (
ImageCropTilesByPixels_MiraSubPack) does the same job, but derives tile size from a maximum megapixels-per-tile budget. This gives you a way to limit how much image area each tile contains. - Latent Upscale then Crop to Tiles (
LatentUpscaleAndCropTiles_MiraSubPack) first enlarges a latent using bislerp, then splits it into overlapping tiles. Optional variance matching adjusts the upscaled latent’s value distribution. Use this path when your workflow is already working with latents rather than a decoded image. - Mira ITU Pipeline Extract and Mira ITU Pipeline Combine (
MiraITUPipelineExtract_MiraSubPack,MiraITUPipelineCombine_MiraSubPack) let you inspect or rebuild the pipeline settings: full-image size, tile size, overlap, feather rate, and pixel alignment. They are useful when you need to pass or adjust those settings within a more customized workflow. - Tiled Image KSampler with Tagger (
ImageTiledKSamplerWithTagger_MiraSubPack) samples tiles individually. Each line oftagger_textcorresponds to a tile and is appended to that tile’s positive prompt. For example, you can give a tile containing foliage different descriptive text from one containing a building. The node offersNormalfor SDXL and Z Image, andReferencefor Flux.2;Referencealso supports optionalref_latentsand a noise boost. - Overlapped Latent Merge and Overlapped Image Merge (
OverlappedLatentMerge_MiraSubPack,OverlappedImageMerge_MiraSubPack) put tiles back together using the pipeline’s geometry and feather-weighted blending. Use the latent node for latent tiles and the image node for decoded image tiles. - Tiled Image Color Correction (
TiledImageColorCorrection_MiraSubPack) compares processed tiles with their pre-sampler reference tiles to reduce color shifts. It offers histogram or LAB-based transfer, with optional luminance handling and edge-preserving smoothing. This can help when individually generated tiles no longer share a consistent color or brightness. - Mira Image Upscale Calculator (
MiraImageUpscaleCalculator_MiraSubPack) checks an image against a megapixel limit. If the image exceeds that limit, it reduces the input size and recalculates the effective upscale factor. - Image Tiles to LLM (
ImageTilesToLLM_MiraSubPack) sends each tile to an OpenAI-compatible API, such as a llama.cpp/v1endpoint, and returns one response per tile as newline-separated text. Those responses can provide tile-specific descriptions for a workflow.
The examples include a general tiled workflow, a sample output, Flux.2 workflow, Flux.2 prebake workflow, Flux.2 sample, and an Anima workflow.
<img src="examples/MiraITU_workflow.png" width="600" alt="General Mira tiled-image workflow">
<img src="examples/MiraITU_FLUX2_workflow.png" width="600" alt="Mira tiled-image workflow for Flux.2">
VAE utilities
A VAE converts images to latents and latents back to images. These nodes offer direct or tiled processing and handle batches of more than one image one image at a time. They also temporarily bypass a fused fp16 VAE path for the operations they wrap, addressing the compatibility case described by the author for sm_75 hardware such as a TITAN RTX with --fast fp16_accumulation.
- VAE Encode (Mira SubPack) (
VAEEncode_MiraSubPack) converts images into latents. Choosedirectortiledmode; tiled mode has optional tile, overlap, and temporal parameters. - VAE Decode (Mira SubPack) (
VAEDecode_MiraSubPack) converts latents back into images, with the same direct/tiled choice and batch strategy. - VAE Safe Passthrough (Mira SubPack) (
VAESafePassthrough_MiraSubPack) passes a VAE connection through a proxy that applies the same handling when another node performs encoding or decoding internally. That matters for nodes such as Impact Pack’sFaceDetailer, whose internal VAE calls are not visible as separate Encode or Decode nodes in the graph. The author notes that SAA Override VAE inserts this passthrough onFaceDetailerVAE inputs.
Model and GPU controls
- Sage FP16 Switch (Mira SubPack) (
SageFP16Switch_MiraSubPack) goes after a model loader. It can set that model’s compute type to fp16 and optionally cast attention inputs (q/k/v) to fp16 for SageAttention. Its effect is per model, not a global patch, and you can bypass the node to disable it. The author describes it as useful on GPUs without hardware bf16 support, such as Turing GPUs. Changing precision can affect image output, so compare results before adopting it for a finished workflow. - Load Diffusion Model FP16 Storage (Mira SubPack) (
UNETLoaderFP16Storage_MiraSubPack) is a diffusion-model loader variant that stores weights in fp16 rather than fp32. The author describes this as using half the weight-storage VRAM of fp32. It is a memory option, not a different image-generation model.
ComfyUI_MiraSubPack Models
ComfyUI_MiraSubPack does not list downloadable model weights of its own in the supplied documentation. Its nodes are used alongside models and other workflow components you choose.
The examples and tests mention SDXL, Z Image, Flux.2, MOSS-Image SFT, and Qwen-Image 2.1. In particular, the tiled KSampler documents Normal mode for SDXL and Z Image, and Reference mode for Flux.2. MOSS-Image SFT and Qwen-Image 2.1 appear in the author’s performance tests of Sage FP16 Switch; they are not models supplied by this pack.
What's New with ComfyUI_MiraSubPack
The provided documentation does not include a dated release history or version numbers. It does identify one fix:
- Sage FP16 Switch now applies its fp16 setting when
compute_fp16is on, even if another dtype patch, such asModelComputeDtype, was loaded earlier on the same server. Previously, it could read a shared model’s dtype setting and leave the switch running in fp32.
The author also tested the switch on a TITAN RTX. In the documented MOSS-Image SFT workflow, tested fp16 and SageAttention configurations ran faster than that workflow’s bf16/default-attention baseline, but produced measurably different images. In the Qwen-Image 2.1 test, the switch and ComfyUI’s ModelComputeDtype produced pixel-identical images at the same speed under matching attention settings. These are results from specific hardware, models, and workflows, not promises of the same speed or appearance on your system.
<img src="examples/SageFP16Switch_MOSS_sft_benchmark.jpg" width="1000" alt="Author's MOSS-Image SFT Sage FP16 Switch benchmark">
<img src="examples/SageFP16Switch_QwenImage21_benchmark.jpg" width="1000" alt="Author's Qwen-Image 2.1 Sage FP16 Switch benchmark">
Troubleshooting ComfyUI_MiraSubPack
Visible lines appear where tiles meet.
- Check that the merge node receives the
mira_itu_pipelineproduced for those tiles. It contains the positions, overlap, and feather settings used to put them back together. - Confirm that you are using Overlapped Latent Merge for latent tiles or Overlapped Image Merge for image tiles.
- If the joins remain visible, review the crop node’s overlap and the pipeline’s feather rate. More shared area gives the merge more room to blend; feathering controls how that shared area transitions.
Neighboring tiles have noticeably different colors.
- Keep the pre-sampler tiles available as references.
- Place Tiled Image Color Correction after tile sampling and before the image merge.
- Compare its histogram and LAB transfer options. If brightness or fine edges need attention, try the optional luminance and edge-preserving smoothing settings.
A tile receives the wrong description.
- Check the order of the tiles and the lines in
tagger_text. - Provide one line for each tile you intend to describe; the node appends each line to the corresponding tile’s positive prompt.
- If you generate descriptions with Image Tiles to LLM, review its newline-separated responses before using them as tile-specific text.
A model behaves unexpectedly after enabling fp16.
- Bypass Sage FP16 Switch and run the same workflow again for comparison.
- If you use SageAttention, compare the result with and without the optional
q/k/vcast. - Keep the setting that gives you an acceptable balance of output and performance on your own hardware. The author’s benchmarks show that faster configurations can produce visibly different results.
Frequently asked questions
Is this a one-click upscaler?
No. It provides crop, sampling, correction, and merge nodes that you connect into a workflow. Start with the example workflow images if you want to see the intended order.
Do I need to use every tiled-image node?
No. For example, choose the crop node that suits your input, and use the merge node that suits your output type. Color correction is available when tile colors need matching.
What is mira_itu_pipeline?
It is the bundle of image and tile settings passed between tiled-workflow nodes. Keeping it connected helps the merge node reconstruct the image with the intended layout and blending.
Does the FP16 loader provide a new image model?
No. It changes how a diffusion model’s weights are stored in memory; it does not supply model weights.
Learn More about ComfyUI_MiraSubPack
For related nodes, see the author’s ComfyUI_Mira project. For visual guidance, begin with the pixel-alignment workflow or the general tiled-image workflow. The Flux.2 workflow and Anima workflow show additional examples for artists working with those setups.
