Skip to content

Fix: Pixal3D Windows compatibility + configurable NAF target size#177

Open
acolasialiuliu wants to merge 1 commit into
visualbruno:mainfrom
acolasialiuliu:pixal3d-windows-fixes
Open

Fix: Pixal3D Windows compatibility + configurable NAF target size#177
acolasialiuliu wants to merge 1 commit into
visualbruno:mainfrom
acolasialiuliu:pixal3d-windows-fixes

Conversation

@acolasialiuliu
Copy link
Copy Markdown

Summary

This PR introduces Windows compatibility fixes for Pixal3D (TencentARC/Pixal3D) rendering on ComfyUI, and adds a configurable NAF target size parameter.

Changes

1. CPU/CUDA Device Mismatch Fix

File: trellis2/pipelines/trellis2_image_to_3d.py

  • get_proj_cond_ss() and get_proj_cond_shape() now check if the image_cond_model is on CPU before moving to CUDA, and only move it back to CPU in low_vram mode if it was originally on CPU. This prevents RuntimeError: Input type (torch.cuda.FloatTensor) and weight type (torch.FloatTensor) should be the same when the model is loaded without low_vram mode.

2. NAF Model Graceful Fallback

File: trellis2/trainers/flow_matching/mixins/image_conditioned_proj.py

  • Added self.naf_download_if_missing = True to DinoV3ProjFeatureExtractor.__init__()
  • Wrapped NAF model loading in try/except — on failure, sets self.naf_model = False instead of crashing with AttributeError
  • Updated forward(), to(), and cuda() methods to handle naf_model being False (not just None)

This allows Pixal3D to run even when NATTEN is unavailable (NAF will be disabled automatically).

3. Configurable NAF Target Size

File: nodes.py

  • Added "naf_target_size" widget to Trellis2ImageCondGenerator.INPUT_TYPES() (INT, default 256, range 128-1024)
  • Pipeline's __init__ now has self.naf_target_size_override = None
  • Added _get_pixal3d_config() helper method that copies stage config with override applied
  • Lower NAF target size significantly reduces VRAM usage on consumer GPUs (16GB)

4. NATTEN Windows Resources & Contact

Tested Environment

  • Windows 64-bit, Python 3.12.10, PyTorch 2.7.0+cu128
  • NVIDIA RTX 4070 Ti SUPER (16GB VRAM)
  • NATTEN 0.17.5 (community Windows wheel)
  • Flash Attention 2.8.3

…CUDA device mismatch when cond model loaded without low_vram; missing naf_download_if_missing attr; NAF graceful fallback when NATTEN unavailable. Feature: naf_target_size widget on ImageCondGenerator (default 256, range 128-1024). Resources: https://hf-mirror.com/lldacing/NATTEN-windows | https://space.bilibili.com/37411464
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant