# Fixing tyDiffusion / ComfyUI Engine Installation & Startup Errors (3ds Max) This guide summarizes the root causes and simple steps to fix the common installation/startup failure of tyDiffusion's bundled ComfyUI engine when used in 3ds Max. --- ## Symptoms - tyDiffusion installation error: Setup command line batch process closed prior to engine connection test - Engine window closes immediately after startup - Errors like: - `tyDiffusion error - could not save settings file: ...tyDiffusionSettings.xml` - `AttributeError: module 'torch.utils._pytree' has no attribute 'register_pytree_node'` - Numpy version keeps switching between 1.26.4 and 2.x --- ## Root Causes 1. **Write permissions** Default install path (`C:\ProgramData\tyFlow\tyDiffusion\`) is protected. tyDiffusion cannot save settings or install dependencies. 2. **Package conflicts** - `comfyui-easyapi-nodes` forces numpy >= 2.2.6 - ComfyUI core requires numpy == 1.26.4 → results in broken environment - Newer `transformers` (e.g. 4.56.0) requires PyTorch >= 2.2, but tyDiffusion bundles torch 2.1.2 --- ## Step-by-Step Fix ### 1. Clean reinstall location - Remove old folder: ``` C:\ProgramData yFlow yDiffusion ``` - Create new path (writeable by user), e.g.: ``` D: yFlow yDiffusion ``` - In tyDiffusion (3ds Max → Setup → Paths), set **Root Path** to this new folder. ### 2. Run 3ds Max as Administrator Right-click → *Run as administrator*. This avoids permission issues when installing the engine. ### 3. Disable problematic custom nodes Rename these folders inside `Engines\ComfyUI\ComfyUI\custom_nodes`: ``` comfyui-easyapi-nodes → comfyui-easyapi-nodes.disabled comfyui_controlnet_aux → comfyui_controlnet_aux.disabled (optional at first) ``` This prevents numpy upgrade and heavy dependency failures. ### 4. Fix package versions in embedded Python Open a command prompt (Administrator) and run: ```bat "D: yFlow yDiffusion\Tools\python\python.exe" -m pip install --upgrade "numpy==1.26.4" "D: yFlow yDiffusion\Tools\python\python.exe" -m pip uninstall -y transformers "D: yFlow yDiffusion\Tools\python\python.exe" -m pip install "transformers==4.43.3" "D: yFlow yDiffusion\Tools\python\python.exe" -m pip install --upgrade "opencv-python==4.10.0.84" ``` ### 5. Restart Engine In tyDiffusion (Setup → Engine → Advanced → Additional command line args) set: ``` --preview-method none --disable-smart-memory --disable-cuda-malloc-async ``` Then click **Restart engine (hard)**. Open Web UI to confirm ComfyUI starts. ### 6. Verify stability - Leave idle for a few minutes. Memory should stay stable. - If needed, re-enable controlnet_aux later by restoring its folder and manually installing its requirements: ``` "...\python.exe" -m pip install -r "...custom_nodes\comfyui_controlnet_aux equirements.txt" ``` --- ## Notes - Do NOT re-enable `comfyui-easyapi-nodes` unless you manage a separate environment. It requires numpy >= 2.x and breaks ComfyUI's dependency tree. - Always prefer a custom Root Path (D:\tyFlow\tyDiffusion\) instead of ProgramData to avoid Windows folder protection issues. --- ## TL;DR (Quick Fix) 1. Change Root Path to `D: yFlow yDiffusion\` 2. Disable `comfyui-easyapi-nodes` 3. Lock numpy to 1.26.4 4. Downgrade transformers to 4.43.3 5. Restart engine with: ``` --preview-method none --disable-smart-memory --disable-cuda-malloc-async ``` This resolves the startup crash and memory leak issues. --- Shared for others facing the same tyDiffusion + ComfyUI installation errors in 3ds Max.