Modly × Hunyuan3D-2.1

An image-to-3D extension for Modly.

Input imageInput: a stylized ramen shop with red banners, a paper lantern, and a street lamp, on a raised corner base.
Generated modelOutput: the generated 3D model of the ramen shop with PBR textures, on a dark grid in Modly's viewport.
Generated on an RTX 3090, High shape quality, with the PBR (physically based rendering) texture pass. Shown in Modly's unlit viewport.

Sole developer

The open-source extension (v1.7.1) adds Hunyuan3D-2.1 to Modly, a free desktop app.

Project dates, tools, and platform

Built
July–August 2026
Software
Python, PyTorch, CUDA
Runs on
NVIDIA graphics cards on Windows and Linux

The texture pass exceeded a 16 GB card

Graphics card memory during the texture passMeasured peak

The fix keeps only the working model on the card.

Texture-pass models and memory use

The extension runs the full Hunyuan3D-2.1 shape model, with 3.3 billion parameters, and an optional PBR (physically based rendering) texture pass.

The texture pass runs in stages: encode the condition images, run multiview diffusion, decode, then upscale and bake. On the full-GPU path, every model stays on the GPU for the whole pass. On an RTX 3090, that path reserved 20.4 GB, more than a 16 GB card holds.

Models move to the graphics card in stages

How the models take turns on the cardSimplified
The models take turns on the graphics cardThe encoder, the diffusion model, and the VAE wait in main memory. Each one moves onto the graphics card for its step, then goes back. With one model on the card at a time, the texture pass reserved 13.0 GB of a 16 GB card. MAIN MEMORYGRAPHICS CARD ENCODERDIFFUSIONVAE

Graphics card, 16 GB

13.0 GB reserved

Staging reserved 13.0 GB in the recorded RTX 3090 benchmark.

How models move between stages

Each stage needs only some of the models. The vision encoder visits the GPU once, for a single forward pass. The VAE visits twice: to encode the condition images and to decode the result. The large diffusion model stays only for the denoising loop. Between stages, idle weights wait in ordinary system memory.

On a 12 GB card, the staged path briefly places about 1 GB in system memory.

Auto mode selects staging from available memory

What each design choice doesFive choices

Auto mode checks memory before choosing the texture-pass path.

Staging, automatic selection, and install checks

Move whole components. Standard offloading works through hooks on each module. This pipeline's custom dual-stream architecture bypasses those hooks, so the extension moves whole components at stage boundaries. The extension can then unload each component after its step.

Accept the measured time cost. Staging moves the weights once per stage, which added 5 seconds in the recorded benchmark. The staged run took 116 seconds, and the full-GPU run took 111. Both paths use the same weights and calculations. Their outputs differed within the normal variation between runs.

Select the path from available memory. Auto compares free GPU memory with the measured peak plus a 1.5 GB safety margin. Most people never need to change the setting.

Check the 7.4 GB model file before loading. A cut-short download leaves a checkpoint that PyTorch can't open. The extension checks the file's size and footer before every load, and downloads a damaged file again once.

Include compiled modules for standard Windows setups. Windows builds ship prebuilt native modules for the standard PyTorch install (CUDA 12.8). Other setups compile the modules on first use.

An RTX 3090 benchmark used 36% less reserved memory

One recorded benchmark, July 9, 2026Measured

Texture pass on an RTX 3090

  • 13.0 GBmemory reserved on the cardwas 20.4 GB
  • 36%less memory reserved
  • 116 sfor one texture passwas 111 s

The benchmark's input and output

Input imageInput: a stylized tree with rounded orange foliage on a white background.
Generated modelOutput: the generated 3D model of the tree with textures, on a dark grid in Modly's viewport.

Rendered views of the two paths' outputs differ by 2.24 of 255 color levels, within the normal variation between runs.

Staging reserved 36% less GPU memory and added 5 s.

RTX 3090 benchmark conditions and results

Texture pass on an RTX 3090, July 9, 2026
PathReservedAllocatedTime
Full GPU20.4 GB13.3 GB111 s
Staged13.0 GB9.1 GB116 s

Tree input, seed 42. Stock sizes: 2,048 render, 4,096 texture, 512 view resolution, 6 views. Reserved GPU memory is the memory PyTorch holds on the graphics card. The rendered views of the two outputs differ by 2.24/255, within normal variation between runs.

See the measurement record

On the extension

"thanks again for the extension, it's brilliant!"

Modly collaborator Lorchie, on GitHub

Contact

I'm open to full-time AI product engineering roles.