Skip to content

'Scene' object has no attribute 'node_tree'ย #65

@aliabougazia

Description

@aliabougazia

Describe the Bug
I set up everything as per the guide. When hitting 'Generate', I get the following error in blender. No errors at all in ComfyUI console.

AttributeError: 'Scene' object has no attribute 'node_tree'

To Reproduce
Steps to reproduce the behavior:

  1. Setup ComfyUI. ComfyUI working as expected.
  2. Install Blender v5.0
  3. Use installer.py in this repo to setup ComfyUI nodes and models. All models, nodes and dependencies are integrated in ComfyUI.
  4. Set up 'StableGen' addon in blender v5.0. Integration with running ComfyUI server checked, output folder set up and online access granted.
  5. Adjust StableGen parameters (camera, prompts, etc. Making sure models exist) in 3d view after uploading 3D model. Hit 'generate'.
  6. See error

Expected Behavior
Texture generated for 3d model.

Actual Behavior
The above error.

Console Logs
Please provide any relevant logs from:

  1. Blender System Console: (Window > Toggle System Console)

๐Ÿ”„ blenderkit: Verbose is enabled
๐Ÿ”„ blenderkit: Read in JSON settings from file
โ„น๏ธ blenderkit: Ports reordered so first port is now 62485 (previous index was 0) [13:20:14.468, client_lib.py:125]
Reloading external rigs...
Reloading external metarigs...
Created history step ab2fb8f5-a1fe-4f69-84c9-bf7feaacc7b1
โ„น๏ธ blenderkit: Created new search history step [13:20:17.346, search.py:1853]
โ„น๏ธ blenderkit: No temporarily enabled addons to clean up [13:20:17.347, download.py:391]
blenderkit updater: Running background check for update
๐Ÿ”„ blenderkit: Starting background checking thread
๐Ÿ”„ blenderkit: Checking for update now in background
๐Ÿ”„ blenderkit: Checking for update function
โ„น๏ธ blenderkit: Global dir permissions are OK. [13:20:17.441, utils.py:1524]
๐Ÿ”„ blenderkit: Read in JSON settings from file
๐Ÿ”„ blenderkit: Determined it's not yet time to check for updates
๐Ÿ”„ blenderkit: Aborting check for updated, check interval not reached
๐Ÿ”„ blenderkit: Finished check update, doing callback
๐Ÿ”„ blenderkit: Running background update callback
๐Ÿ”„ blenderkit: BG thread: Finished check update, no callback
Initial server check failed: Timeout (0.5s).
Error: Cannot fetch models. Check server address.
StableGen Load Handler: Failed to refresh checkpoints for 'sdxl': Error: Cannot fetch models. Check server address.

โ„น๏ธ blenderkit: Expectedly, first request for BKClient reports failed: HTTPConnectionPool(host='127.0.0.1', port=62485): Max retries exceeded with url: /v1.7/report (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x000001A885D25CD0>, 'Connection to 127.0.0.1 timed out. (connect timeout=0.1)')) <class 'requests.exceptions.ConnectTimeout'> [13:20:19.010, timer.py:68]
โ„น๏ธ blenderkit: BlenderKit-Client v1.7.0 starting on http://127.0.0.1:62485 [13:20:19.053, client_lib.py:677]
StableGen: Performing initial model list refresh...
Checking server status at localhost:8191...
Initial server check failed: Timeout (0.75s).
Error: ComfyUI server unreachable or timed out at localhost:8191.
StableGen: Error during initial refresh: Error: ComfyUI server unreachable or timed out at localhost:8191.

โ„น๏ธ blenderkit: BlenderKit-Client is running on port 62485! [13:20:20.607, timer.py:137]
โ„น๏ธ blenderkit: Please take part in our Happiness survey! [13:20:21.230, disclaimer_op.py:102]
โ„น๏ธ blenderkit: Please take part in our Happiness survey! [13:20:21.231, disclaimer_op.py:102]
Repository data: C:\Users\aliab\AppData\Roaming\Blender Foundation\Blender\5.0\extensions\blender_org not found, sync required!
Checking server status at localhost:8191...
Initial server check failed: Timeout (0.75s).
05:06.625 operator | ERROR ComfyUI server unreachable or timed out at localhost:8191.
Checking server status at localhost:8191...
Initial server check failed: Timeout (0.75s).
05:20.593 operator | ERROR ComfyUI server unreachable or timed out at localhost:8191.
Server address changed, attempting to refresh model lists...
Checking server status at localhost:8189...
Info: Refreshed Checkpoint list (4 found).
Info: Refreshed LoRA list (192 found).
Could not guess type for 'IllustriousXL_openpose.safetensors'. Please assign manually.
Info: Refreshed ControlNet list: 1 added, 0 removed.
05:39.234 operator | ComfyUI server is online at localhost:8189.
Info: Refreshed Checkpoint list (4 found).
Info: Refreshed LoRA list (192 found).
Info: Refreshed ControlNet list: 0 added, 0 removed.
Info: Refreshed Checkpoint list (4 found).
06:05.140 operator | Cameras added successfully.
06:22.343 operator | Collected prompts for 2 cameras.
Server address changed, attempting to refresh model lists...
Warning: No UNET (GGUF) models found on server.
Info: Refreshed LoRA list (192 found).
Info: Refreshed ControlNet list: 0 added, 0 removed.
Warning: No UNET (GGUF) models found on server.
Server address changed, attempting to refresh model lists...
Info: Refreshed UNET (GGUF) list (1 found).
Info: Refreshed LoRA list (3 found).
Warning: No ControlNet models found on the server.
Checking server status at localhost:8190...
Info: Refreshed UNET (GGUF) list (1 found).
Info: Refreshed LoRA list (3 found).
Warning: No ControlNet models found on the server.
06:53.578 operator | ComfyUI server is online at localhost:8190.
Checking server status at localhost:8190...
Info: Refreshed UNET (GGUF) list (1 found).
Info: Refreshed LoRA list (3 found).
Warning: No ControlNet models found on the server.
06:53.812 operator | ComfyUI server is online at localhost:8190.
Checking server status at localhost:8190...
Info: Refreshed UNET (GGUF) list (1 found).
Info: Refreshed LoRA list (3 found).
Warning: No ControlNet models found on the server.
06:54.703 operator | ComfyUI server is online at localhost:8190.
Checking server status at localhost:8190...
Info: Refreshed UNET (GGUF) list (1 found).
Info: Refreshed LoRA list (3 found).
Warning: No ControlNet models found on the server.
06:55.718 operator | ComfyUI server is online at localhost:8190.
06:59.843 operator | Refreshed UNET (GGUF) list (1 found).
Executing ComfyUI Generation
Generating images for 2 cameras
Exporting depth map
Traceback (most recent call last):
File "C:\Users\aliab\AppData\Roaming\Blender Foundation\Blender\5.0\extensions\user_default\stablegen\generator.py", line 1106, in invoke
return self.execute(context)
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\aliab\AppData\Roaming\Blender Foundation\Blender\5.0\extensions\user_default\stablegen\generator.py", line 586, in execute
self.export_depthmap(context, camera_id=i)
File "C:\Users\aliab\AppData\Roaming\Blender Foundation\Blender\5.0\extensions\user_default\stablegen\generator.py", line 1258, in export_depthmap
nodes = bpy.context.scene.node_tree.nodes
^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'Scene' object has no attribute 'node_tree'
07:07.203 bpy.rna | ERROR Python script error in OBJECT_OT_test_stable.invoke
07:07.203 operator | Resolution automatically rescaled to 1328x744.
07:07.203 operator | ERROR Python: Traceback (most recent call last):
| File "C:\Users\aliab\AppData\Roaming\Blender Foundation\Blender\5.0\extensions\user_default\stablegen\generator.py", line 1106, in invoke
| return self.execute(context)
| ^^^^^^^^^^^^^^^^^^^^^
| File "C:\Users\aliab\AppData\Roaming\Blender Foundation\Blender\5.0\extensions\user_default\stablegen\generator.py", line 586, in execute
| self.export_depthmap(context, camera_id=i)
| File "C:\Users\aliab\AppData\Roaming\Blender Foundation\Blender\5.0\extensions\user_default\stablegen\generator.py", line 1258, in export_depthmap
| nodes = bpy.context.scene.node_tree.nodes
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
| AttributeError: 'Scene' object has no attribute 'node_tree'


2.  **ComfyUI Server Console:** (The terminal where you launched ComfyUI)
```(my_cu128_env) aa@AAdesktop:~/docker$ python ./cu128/ComfyUI/main.py --listen --enable-cors-header --max-upload-size 1000 --port 8190
[START] Security scan
[ComfyUI-Manager] Using `uv` as Python module for pip operations.
Using Python 3.12.12 environment at: miniconda3/envs/my_cu128_env
[DONE] Security scan
## ComfyUI-Manager: installing dependencies done.
** ComfyUI startup time: 2025-12-09 13:24:57.577
** Platform: Linux
** Python version: 3.12.12 | packaged by Anaconda, Inc. | (main, Oct 21 2025, 20:16:04) [GCC 11.2.0]
** Python executable: /home/aa/docker/miniconda3/envs/my_cu128_env/bin/python
** ComfyUI Path: /home/aa/docker/cu128/ComfyUI
** ComfyUI Base Folder Path: /home/aa/docker/cu128/ComfyUI
** User directory: /home/aa/docker/cu128/ComfyUI/user
** ComfyUI-Manager config path: /home/aa/docker/cu128/ComfyUI/user/__manager/config.ini
** Log path: /home/aa/docker/cu128/ComfyUI/user/comfyui.log
Using Python 3.12.12 environment at: miniconda3/envs/my_cu128_env
Using Python 3.12.12 environment at: miniconda3/envs/my_cu128_env

Prestartup times for custom nodes:
   2.2 seconds: /home/aa/docker/cu128/ComfyUI/custom_nodes/ComfyUI-Manager

Checkpoint files will always be loaded safely.
Total VRAM 32607 MB, total RAM 98227 MB
pytorch version: 2.9.1+cu128
xformers version: 0.0.33.post2
Set vram state to: NORMAL_VRAM
Device: cuda:0 NVIDIA GeForce RTX 5090 : cudaMallocAsync
Using async weight offloading with 2 streams
Enabled pinned memory 93315.0
working around nvidia conv3d memory bug.
Using xformers attention
Python version: 3.12.12 | packaged by Anaconda, Inc. | (main, Oct 21 2025, 20:16:04) [GCC 11.2.0]
ComfyUI version: 0.3.76
ComfyUI frontend version: 1.33.10
[Prompt Server] web root: /home/aa/docker/miniconda3/envs/my_cu128_env/lib/python3.12/site-packages/comfyui_frontend_package/static
Total VRAM 32607 MB, total RAM 98227 MB
pytorch version: 2.9.1+cu128
xformers version: 0.0.33.post2
Set vram state to: NORMAL_VRAM
Device: cuda:0 NVIDIA GeForce RTX 5090 : cudaMallocAsync
Using async weight offloading with 2 streams
Enabled pinned memory 93315.0
ComfyUI-GGUF: Allowing full torch compile
======================================== ComfyUI-QwenImageLoraLoader Initialization ========================================
[DEBUG] Added to sys.path: /home/aa/docker/cu128/ComfyUI/custom_nodes/ComfyUI-QwenImageLoraLoader
[DEBUG] wrappers dir exists: True
[DEBUG] qwenimage.py exists: True
============================================================================================================================
/home/aa/docker/miniconda3/envs/my_cu128_env/lib/python3.12/site-packages/timm/models/layers/__init__.py:48: FutureWarning: Importing from timm.models.layers is deprecated, please import via timm.layers
  warnings.warn(f"Importing from {__name__} is deprecated, please import via timm.layers", FutureWarning)
[ComfyUI-RMBG] v2.9.4 | 33 nodes Loaded
### Loading: ComfyUI-Manager (V3.38.1)
[ComfyUI-Manager] network_mode: public
### ComfyUI Version: v0.3.76-42-g56fa7dbe | Released on '2025-12-07'

Import times for custom nodes:
   0.0 seconds: /home/aa/docker/cu128/ComfyUI/custom_nodes/websocket_image_save.py
   0.0 seconds: /home/aa/docker/cu128/ComfyUI/custom_nodes/ComfyUI-QwenImageLoraLoader
   0.0 seconds: /home/aa/docker/cu128/ComfyUI/custom_nodes/ComfyUI_IPAdapter_plus
   0.0 seconds: /home/aa/docker/cu128/ComfyUI/custom_nodes/ComfyUI-GGUF
   0.2 seconds: /home/aa/docker/cu128/ComfyUI/custom_nodes/ComfyUI-Manager
   7.4 seconds: /home/aa/docker/cu128/ComfyUI/custom_nodes/comfyui-rmbg

[ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/alter-list.json
[ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/model-list.json
[ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/github-stats.json
[ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/custom-node-list.json
[ComfyUI-Manager] default cache updated: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/extension-node-map.json
Context impl SQLiteImpl.
Will assume non-transactional DDL.
No target revision found.
Starting server

To see the GUI go to: http://0.0.0.0:8190
To see the GUI go to: http://[::]:8190
FETCH ComfyRegistry Data: 5/111
FETCH ComfyRegistry Data: 10/111
FETCH ComfyRegistry Data: 15/111
FETCH ComfyRegistry Data: 20/111
FETCH ComfyRegistry Data: 25/111
FETCH ComfyRegistry Data: 30/111
FETCH ComfyRegistry Data: 35/111
FETCH ComfyRegistry Data: 40/111
FETCH ComfyRegistry Data: 45/111
FETCH ComfyRegistry Data: 50/111
FETCH ComfyRegistry Data: 55/111
FETCH ComfyRegistry Data: 60/111
FETCH ComfyRegistry Data: 65/111
FETCH ComfyRegistry Data: 70/111
FETCH ComfyRegistry Data: 75/111
FETCH ComfyRegistry Data: 80/111
FETCH ComfyRegistry Data: 85/111
FETCH ComfyRegistry Data: 90/111
FETCH ComfyRegistry Data: 95/111
FETCH ComfyRegistry Data: 100/111
FETCH ComfyRegistry Data: 105/111
FETCH ComfyRegistry Data: 110/111
FETCH ComfyRegistry Data [DONE]
[ComfyUI-Manager] default cache updated: https://api.comfy.org/nodes
FETCH DATA from: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/custom-node-list.json [DONE]
[ComfyUI-Manager] broken item:{'author': 'rjgoif', 'title': 'Img Label Tools', 'id': 'Img-Label-Tools', 'reference': 'https://github.com/rjgoif/ComfyUI-Img-Label-Tools', 'install_type': 'git-clone', 'description': 'Tools to help annotate images for sharing on Reddit, Discord, etc.'}
[ComfyUI-Manager] All startup tasks have been completed.```

**System Information:**
* **Blender Version:** V5.0
* **StableGen Version:** latest on 'Main' branch. # 4123f3e
* **Operating System:** Windows 11 WSL2 Ubuntu 22.04.
* **ComfyUI Installation:** Standard local install in conda-managed environment. Pytorch 2.8.0 and Cuda 12.8.
* **GPU:** NVIDIA RTX 5090.

* **StableGen Installation Method:** `installer.py` . I chose the qwen image edit with lora package (not int.4).

**Is the issue scene specific?**
No. Applies to all and any scenes.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions