Repository navigation
Keep TripoSG and the texture model loaded together - #390
Merged
lightningpixel merged 2 commits intoOct 31, 2026
Merged
lightningpixel merged 2 commits into
lightningpixel merged 2 commits into
Conversation
switch_model unloads the previous model on every switch. When you run TripoSG and then Trellis2 Texture Mesh on the same object, both models get reloaded for every single asset, which cost me 20-27 s per switch on a 3090 Ti. This keeps the two loaded side by side. Any other switch, and the LLM eviction, works exactly as before. Two assets (cart + soldier, 3000 faces, warm): 197 s -> 110 s.
… pair on VRAM switch_model only unloaded the previous active model. After TripoSG -> Trellis2 refine -> any other model, TripoSG was no longer active but stayed loaded beside the new model until unload_all. switch_model now unloads every loaded model except the target and its resident partners. Keeping both models resident also assumed a card with room for both (~10-11 GB peak). Each pair now declares a minimum total VRAM; below it, or when no NVIDIA GPU answers, switching behaves as before. The pair is set to 19.5 GiB (24 GB cards), the configuration the speedup was measured on. Manifests can't size this: TripoSG declares no vram_gb.
lightningpixel
approved these changes
Oct 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I generate a lot of assets with TripoSG for the shape and then Trellis2 "Texture Mesh" for the texture. Every switch between the two goes through
switch_model, which unloads the previous model, so both get reloaded for every single asset. On my 3090 Ti that was 20-27 s of "Loading..." per switch.This adds a small
_KEEP_RESIDENT_PAIRSlist and skips the unload when you switch between the models in a pair. Right now the only pair istriposg/generate+trellis2/refine. Every other switch, and the LLM eviction above it, behaves exactly as before.Numbers from my machine (two assets, 3000 faces, models already warm):
Peak VRAM with both loaded was around 10-11 GB on a 24 GB card, so this does assume a card with room for both. If you'd rather have this behind a setting or a free-VRAM check, I'm happy to change it.
Tested with
pytest tests/test_generator_registry.py tests/test_model_router.py tests/test_agent_workflow_unload.py(45 passed, 2 skipped).