Comfy-Org / Comfy-Org/ComfyUI

Windows access violation during first model load, reproducible with CPU and no custom nodes

Open
#16,153 0 comments 0 reactions 0 assignees View on GitHub
Potential Bug
Dominant language
Python
Stars
133k
Forks
15.7k
Avg merge
1d 7h
Merged PRs (30d)
158

Description

### Custom Node Testing

- [x] I have tried disabling custom nodes and the issue persists (see [how to disable custom nodes](https://docs.comfy.org/troubleshooting/custom-node-issues#step-1%3A-test-with-all-custom-nodes-disabled) if you need help)

### Expected Behavior

ComfyUI should load the checkpoint without producing a Windows access violation.

The model should load normally and the workflow should execute without native access-violation errors.

### Actual Behavior

On the first load of a standard SD1 checkpoint, ComfyUI reports repeated:

`Windows fatal exception: access violation`

The access violation occurs while ComfyUI is loading the model weights, with the stack trace passing through `_load_from_state_dict()` and `comfy.ops.py`.

Despite the access violations, ComfyUI does not terminate. It continues loading the model and the workflow eventually completes successfully.

Subsequent executions complete normally without the access violation.

The issue reproduces with:

- `--cpu`
- `--disable-dynamic-vram`
- `--disable-all-custom-nodes`

Therefore the issue does not appear to depend on CUDA/GPU execution, DynamicVRAM/AIMDO, or custom nodes.

### Steps to Reproduce

1. Start ComfyUI with:
`--cpu --fast --enable-manager --disable-all-custom-nodes`

2. Load the standard SD1 checkpoint:
`Juggernaut_aftermath.safetensors`

3. Run a simple SD1 text-to-image workflow.

4. During the first model load, observe repeated:
`Windows fatal exception: access violation`

5. ComfyUI continues execution despite the access violations.

6. The model finishes loading and the workflow completes successfully.

7. Subsequent executions complete normally without the access violation.

### Debug Logs

```powershell
[WARNING] On windows we are currently forcing single GPU mode in ComfyUI due to a Nvidia related issue, if you want to disable this use: --cuda-device all
[INFO] Adding extra search path checkpoints E:\ASSETS\AI-TOOLS\MODEL-ASSETS\Stable-diffusion
[INFO] Adding extra search path configs E:\ASSETS\AI-TOOLS\MODEL-ASSETS\configs
[INFO] Adding extra search path vae E:\ASSETS\AI-TOOLS\MODEL-ASSETS\VAE
[INFO] Adding extra search path vae G:\AI-MODELS\VAE
[INFO] Adding extra search path unet E:\ASSETS\AI-TOOLS\MODEL-ASSETS\unet
[INFO] Adding extra search path clip E:\ASSETS\AI-TOOLS\MODEL-ASSETS\clip
[INFO] Adding extra search path loras E:\ASSETS\AI-TOOLS\MODEL-ASSETS\Lora
[INFO] Adding extra search path loras E:\ASSETS\AI-TOOLS\MODEL-ASSETS\LyCORIS
[INFO] Adding extra search path loras D:\AI-STUFF\MODELS\Lora
[INFO] Adding extra search path loras G:\AI-MODELS\Lora
[INFO] Adding extra search path upscale_models E:\ASSETS\AI-TOOLS\MODEL-ASSETS\ESRGAN
[INFO] Adding extra search path upscale_models E:\ASSETS\AI-TOOLS\MODEL-ASSETS\RealESRGAN
[INFO] Adding extra search path upscale_models E:\ASSETS\AI-TOOLS\MODEL-ASSETS\SwinIR
[INFO] Adding extra search path embeddings E:\ASSETS\AI-TOOLS\MODEL-ASSETS\embeddings
[INFO] Adding extra search path embeddings G:\AI-MODELS\embeddings
[INFO] Adding extra search path hypernetworks E:\ASSETS\AI-TOOLS\MODEL-ASSETS\hypernetworks
[INFO] Adding extra search path controlnet E:\ASSETS\AI-TOOLS\MODEL-ASSETS\ControlNet
[INFO] Adding extra search path blip E:\ASSETS\AI-TOOLS\MODEL-ASSETS\BLIP
[INFO] Adding extra search path blip E:\ASSETS\AI-TOOLS\MODEL-ASSETS\BLIP\checkpoints
[INFO] Adding extra search path wildcards E:\ASSETS\AI-TOOLS\WILDCARD-ASSETS
[INFO] Adding extra search path instantid E:\ASSETS\AI-TOOLS\MODEL-ASSETS\intantid
[INFO] Adding extra search path florence2 E:\ASSETS\AI-TOOLS\MODEL-ASSETS\LLM
[INFO] Adding extra search path LLM E:\ASSETS\AI-TOOLS\MODEL-ASSETS\LLM
[INFO] Adding extra search path diffusion_models E:\ASSETS\AI-TOOLS\MODEL-ASSETS\diffusion_models
[INFO] Adding extra search path diffusion_models D:\AI-STUFF\MODELS\diffusion_models
[INFO] Adding extra search path diffusion_models G:\AI-MODELS\diffusion_models
[INFO] Adding extra search path text_encoders E:\ASSETS\AI-TOOLS\MODEL-ASSETS\text_encoders
[INFO] Adding extra search path text_encoders G:\AI-MODELS\text_encoders
[INFO] Adding extra search path dia2 D:\AI-STUFF\MODELS\dia2
[START] Security scan
[DONE] Security scan
** ComfyUI startup time: 2026-09-07 00:54:04.038
** Platform: Windows
** Python version: 3.12.0 (tags/v3.12.0:0fb18b0, Oct 2 2023, 13:03:39) [MSC v.1935 64 bit (AMD64)]
** Python executable: D:\apps\Python\Python312\python.exe
** ComfyUI Path: D:\apps\SD-WebUI\ComfyUI
** ComfyUI Base Folder Path: D:\apps\SD-WebUI\ComfyUI
** User directory: D:\apps\SD-WebUI\ComfyUI\user
** ComfyUI-Manager config path: D:\apps\SD-WebUI\ComfyUI\user\__manager\config.ini
** Log path: D:\apps\SD-WebUI\ComfyUI\user\comfyui.log
[INFO] [PRE] ComfyUI-Manager
[INFO] Found comfy_kitchen backend cuda: {'available': True, 'disabled': False, 'unavailable_reason': None, 'capabilities': ['adaln', 'apply_rope', 'apply_rope1', 'apply_rope1_', 'apply_rope_', 'apply_rope_split_half', 'apply_rope_split_half1', 'apply_rope_split_half1_', 'apply_rope_split_half_', 'convrot_w4a4_linear', 'dequantize_convrot_w4a4_weight', 'dequantize_int8_convrot_weight', 'dequantize_int8_convrot_weight_dtype', 'dequantize_int8_simple', 'dequantize_int8_simple_dtype', 'dequantize_nvfp4', 'dequantize_per_tensor_fp8', 'dequantize_w4a8_int8_weight', 'gemv_awq_w4a16', 'int8_linear', 'na3d', 'prepare_int4_weight_for_int8_linear', 'quantize_and_rotate_rowwise', 'quantize_convrot_w4a4_weight', 'quantize_int8_convrot_weight', 'quantize_int8_rowwise', 'quantize_int8_tensorwise', 'quantize_mxfp8', 'quantize_nvfp4', 'quantize_per_tensor_fp8', 'quantize_svdquant_w4a4', 'quantize_w4a8_int8_weight', 'rms_adaln', 'rms_rope', 'rms_rope1', 'rms_rope1_', 'rms_rope_', 'rms_rope_split_half', 'rms_rope_split_half1', 'rms_rope_split_half1_', 'rms_rope_split_half_', 'rotate_int8_convrot_weight', 'scaled_mm_nvfp4', 'scaled_mm_svdquant_w4a4', 'sol_attn', 'stochastic_rounding_fp8', 'w4a8_int8_linear']}
[INFO] Found comfy_kitchen backend hip: {'available': False, 'disabled': False, 'unavailable_reason': 'PyTorch ROCm/HIP runtime not available', 'capabilities': []}
[INFO] Found comfy_kitchen backend eager: {'available': True, 'disabled': False, 'unavailable_reason': None, 'capabilities': ['adaln', 'apply_rope', 'apply_rope1', 'apply_rope1_', 'apply_rope_', 'apply_rope_split_half', 'apply_rope_split_half1', 'apply_rope_split_half1_', 'apply_rope_split_half_', 'convrot_w4a4_linear', 'dequantize_convrot_w4a4_weight', 'dequantize_int8_convrot_weight', 'dequantize_int8_convrot_weight_dtype', 'dequantize_int8_embedding', 'dequantize_int8_simple', 'dequantize_int8_simple_dtype', 'dequantize_mxfp8', 'dequantize_nvfp4', 'dequantize_per_tensor_fp8', 'dequantize_w4a8_int8_weight', 'gemv_awq_w4a16', 'int8_linear', 'na3d', 'prepare_int4_weight_for_int8_linear', 'quantize_and_rotate_rowwise', 'quantize_convrot_w4a4_weight', 'quantize_int8_convrot_weight', 'quantize_int8_rowwise', 'quantize_int8_tensorwise', 'quantize_mxfp8', 'quantize_nvfp4', 'quantize_per_tensor_fp8', 'quantize_svdquant_w4a4', 'quantize_w4a8_int8_weight', 'rms_adaln', 'rms_rope', 'rms_rope1', 'rms_rope1_', 'rms_rope_', 'rms_rope_split_half', 'rms_rope_split_half1', 'rms_rope_split_half1_', 'rms_rope_split_half_', 'rotate_int8_convrot_weight', 'scaled_mm_mxfp8', 'scaled_mm_nvfp4', 'scaled_mm_svdquant_w4a4', 'sol_attn', 'stochastic_rounding_fp8', 'w4a8_int8_linear']}
[INFO] Found comfy_kitchen backend triton: {'available': True, 'disabled': True, 'unavailable_reason': None, 'capabilities': ['adaln', 'apply_rope', 'apply_rope1', 'apply_rope1_', 'apply_rope_', 'apply_rope_split_half', 'apply_rope_split_half1', 'apply_rope_split_half1_', 'apply_rope_split_half_', 'dequantize_nvfp4', 'dequantize_per_tensor_fp8', 'int8_linear', 'na3d', 'quantize_and_rotate_rowwise', 'quantize_int8_rowwise', 'quantize_mxfp8', 'quantize_nvfp4', 'quantize_per_tensor_fp8', 'rms_adaln', 'rms_rope', 'rms_rope1', 'rms_rope1_', 'rms_rope_', 'rms_rope_split_half', 'rms_rope_split_half1', 'rms_rope_split_half1_', 'rms_rope_split_half_', 'w4a8_int8_linear']}
[INFO] Checkpoint files will always be loaded safely.
[INFO] Total VRAM 65456 MB, total RAM 65456 MB
[INFO] pytorch version: 2.12.1+cu130
[INFO] Set vram state to: DISABLED
[INFO] Device: cpu
[INFO] Using sub quadratic optimization for attention, if you have memory or speed issues try using: --use-split-cross-attention
[INFO] Python version: 3.12.0 (tags/v3.12.0:0fb18b0, Oct 2 2023, 13:03:39) [MSC v.1935 64 bit (AMD64)]
[INFO] ComfyUI version: 0.34.0
[INFO] comfy-aimdo version: 0.5.2
[INFO] comfy-kitchen version: 0.2.33
[INFO] comfyui-frontend-package version: 1.52.7
[INFO] comfyui-workflow-templates version: 0.11.55
[INFO] comfyui-embedded-docs version: 0.5.11
[INFO] comfy-kitchen version: 0.2.33
[INFO] comfy-aimdo version: 0.5.2
[INFO] [Prompt Server] web root: D:\apps\Python\Python312\Lib\site-packages\comfyui_frontend_package\static
[INFO] Asset seeder disabled
[INFO] [START] ComfyUI-Manager
[ComfyUI-Manager] Using GitPython backend
[INFO] [ComfyUI-Manager] network_mode: public
D:\apps\Python\Python312\Lib\site-packages\kornia\feature\lightglue.py:44: FutureWarning: `torch.cuda.amp.custom_fwd(args...)` is deprecated. Please use `torch.amp.custom_fwd(args..., device_type='cuda')` instead.
@torch.cuda.amp.custom_fwd(cast_inputs=torch.float32)
[INFO] No OpenGL_accelerate module loaded: No module named 'OpenGL_accelerate'
[INFO] Skipping loading of custom nodes
[INFO] Context impl SQLiteImpl.
[INFO] Will assume non-transactional DDL.
[INFO] Using RAM pressure cache.
[INFO] Starting server

[INFO] To see the GUI go to: http://0.0.0.0:8188
[INFO] To see the GUI go to: http://[::]:8188
[INFO] got prompt
[INFO] model weight dtype torch.float32, manual cast: None
[INFO] model_type EPS
Windows fatal exception: access violation

Stack (most recent call first):
File "D:\apps\Python\Python312\Lib\site-packages\torch\nn\modules\module.py", line 2495 in _load_from_state_dict
File "D:\apps\SD-WebUI\ComfyUI\comfy\ops.py", line 549 in _load_from_state_dict
File "D:\apps\Python\Python312\Lib\site-packages\torch\nn\modules\module.py", line 2588 in load
File "D:\apps\Python\Python312\Lib\site-packages\torch\nn\modules\module.py", line 2605 in load
File "D:\apps\Python\Python312\Lib\site-packages\torch\nn\modules\module.py", line 2605 in load
File "D:\apps\Python\Python312\Lib\site-packages\torch\nn\modules\module.py", line 2618 in load_state_dict
File "D:\apps\SD-WebUI\ComfyUI\comfy\model_base.py", line 369 in load_model_weights
File "D:\apps\SD-WebUI\ComfyUI\comfy\sd.py", line 2207 in load_state_dict_guess_config
File "D:\apps\SD-WebUI\ComfyUI\comfy\sd.py", line 2090 in load_checkpoint_guess_config
File "D:\apps\SD-WebUI\ComfyUI\nodes.py", line 636 in load_checkpoint
File "D:\apps\SD-WebUI\ComfyUI\execution.py", line 306 in process_inputs
File "D:\apps\SD-WebUI\ComfyUI\execution.py", line 318 in _async_map_node_over_list
File "D:\apps\SD-WebUI\ComfyUI\execution.py", line 344 in get_output_data
File "D:\apps\SD-WebUI\ComfyUI\execution.py", line 545 in execute
File "D:\apps\SD-WebUI\ComfyUI\execution.py", line 789 in execute_async
File "D:\apps\Python\Python312\Lib\asyncio\events.py", line 84 in _run
File "D:\apps\Python\Python312\Lib\asyncio\base_events.py", line 1951 in _run_once
File "D:\apps\Python\Python312\Lib\asyncio\base_events.py", line 618 in run_forever
File "D:\apps\Python\Python312\Lib\asyncio\windows_events.py", line 321 in run_forever
File "D:\apps\Python\Python312\Lib\asyncio\base_events.py", line 651 in run_until_complete
File "D:\apps\Python\Python312\Lib\asyncio\runners.py", line 118 in run
File "D:\apps\Python\Python312\Lib\asyncio\runners.py", line 194 in run
File "D:\apps\SD-WebUI\ComfyUI\execution.py", line 728 in execute
File "D:\apps\SD-WebUI\ComfyUI\main.py", line 394 in prompt_worker
File "D:\apps\Python\Python312\Lib\threading.py", line 989 in run
File "D:\apps\Python\Python312\Lib\threading.py", line 1052 in _bootstrap_inner
File "D:\apps\Python\Python312\Lib\threading.py", line 1009 in _bootstrap
Windows fatal exception: access violation

Stack (most recent call first):
File "D:\apps\Python\Python312\Lib\site-packages\torch\nn\modules\module.py", line 2495 in _load_from_state_dict
File "D:\apps\SD-WebUI\ComfyUI\comfy\ops.py", line 549 in _load_from_state_dict
File "D:\apps\Python\Python312\Lib\site-packages\torch\nn\modules\module.py", line 2588 in load
File "D:\apps\Python\Python312\Lib\site-packages\torch\nn\modules\module.py", line 2605 in load
File "D:\apps\Python\Python312\Lib\site-packages\torch\nn\modules\module.py", line 2605 in load
File "D:\apps\Python\Python312\Lib\site-packages\torch\nn\modules\module.py", line 2618 in load_state_dict
File "D:\apps\SD-WebUI\ComfyUI\comfy\model_base.py", line 369 in load_model_weights
File "D:\apps\SD-WebUI\ComfyUI\comfy\sd.py", line 2207 in load_state_dict_guess_config
File "D:\apps\SD-WebUI\ComfyUI\comfy\sd.py", line 2090 in load_checkpoint_guess_config
File "D:\apps\SD-WebUI\ComfyUI\nodes.py", line 636 in load_checkpoint
File "D:\apps\SD-WebUI\ComfyUI\execution.py", line 306 in process_inputs
File "D:\apps\SD-WebUI\ComfyUI\execution.py", line 318 in _async_map_node_over_list
File "D:\apps\SD-WebUI\ComfyUI\execution.py", line 344 in get_output_data
File "D:\apps\SD-WebUI\ComfyUI\execution.py", line 545 in execute
File "D:\apps\SD-WebUI\ComfyUI\execution.py", line 789 in execute_async
File "D:\apps\Python\Python312\Lib\asyncio\events.py", line 84 in _run
File "D:\apps\Python\Python312\Lib\asyncio\base_events.py", line 1951 in _run_once
File "D:\apps\Python\Python312\Lib\asyncio\base_events.py", line 618 in run_forever
File "D:\apps\Python\Python312\Lib\asyncio\windows_events.py", line 321 in run_forever
File "D:\apps\Python\Python312\Lib\asyncio\base_events.py", line 651 in run_until_complete
File "D:\apps\Python\Python312\Lib\asyncio\runners.py", line 118 in run
File "D:\apps\Python\Python312\Lib\asyncio\runners.py", line 194 in run
File "D:\apps\SD-WebUI\ComfyUI\execution.py", line 728 in execute
File "D:\apps\SD-WebUI\ComfyUI\main.py", line 394 in prompt_worker
File "D:\apps\Python\Python312\Lib\threading.py", line 989 in run
File "D:\apps\Python\Python312\Lib\threading.py", line 1052 in _bootstrap_inner
File "D:\apps\Python\Python312\Lib\threading.py", line 1009 in _bootstrap
Windows fatal exception: access violation

Stack (most recent call first):
File "D:\apps\Python\Python312\Lib\site-packages\torch\nn\modules\module.py", line 2495 in _load_from_state_dict
File "D:\apps\SD-WebUI\ComfyUI\comfy\ops.py", line 549 in _load_from_state_dict
File "D:\apps\Python\Python312\Lib\site-packages\torch\nn\modules\module.py", line 2588 in load
File "D:\apps\Python\Python312\Lib\site-packages\torch\nn\modules\module.py", line 2605 in load
File "D:\apps\Python\Python312\Lib\site-packages\torch\nn\modules\module.py", line 2605 in load
File "D:\apps\Python\Python312\Lib\site-packages\torch\nn\modules\module.py", line 2618 in load_state_dict
File "D:\apps\SD-WebUI\ComfyUI\comfy\model_base.py", line 369 in load_model_weights
File "D:\apps\SD-WebUI\ComfyUI\comfy\sd.py", line 2207 in load_state_dict_guess_config
File "D:\apps\SD-WebUI\ComfyUI\comfy\sd.py", line 2090 in load_checkpoint_guess_config
File "D:\apps\SD-WebUI\ComfyUI\nodes.py", line 636 in load_checkpoint
File "D:\apps\SD-WebUI\ComfyUI\execution.py", line 306 in process_inputs
File "D:\apps\SD-WebUI\ComfyUI\execution.py", line 318 in _async_map_node_over_list
File "D:\apps\SD-WebUI\ComfyUI\execution.py", line 344 in get_output_data
File "D:\apps\SD-WebUI\ComfyUI\execution.py", line 545 in execute
File "D:\apps\SD-WebUI\ComfyUI\execution.py", line 789 in execute_async
File "D:\apps\Python\Python312\Lib\asyncio\events.py", line 84 in _run
File "D:\apps\Python\Python312\Lib\asyncio\base_events.py", line 1951 in _run_once
File "D:\apps\Python\Python312\Lib\asyncio\base_events.py", line 618 in run_forever
File "D:\apps\Python\Python312\Lib\asyncio\windows_events.py", line 321 in run_forever
File "D:\apps\Python\Python312\Lib\asyncio\base_events.py", line 651 in run_until_complete
File "D:\apps\Python\Python312\Lib\asyncio\runners.py", line 118 in run
File "D:\apps\Python\Python312\Lib\asyncio\runners.py", line 194 in run
File "D:\apps\SD-WebUI\ComfyUI\execution.py", line 728 in execute
File "D:\apps\SD-WebUI\ComfyUI\main.py", line 394 in prompt_worker
File "D:\apps\Python\Python312\Lib\threading.py", line 989 in run
File "D:\apps\Python\Python312\Lib\threading.py", line 1052 in _bootstrap_inner
File "D:\apps\Python\Python312\Lib\threading.py", line 1009 in _bootstrap
Windows fatal exception: access violation

Stack (most recent call first):
File "D:\apps\Python\Python312\Lib\site-packages\torch\nn\modules\module.py", line 2495 in _load_from_state_dict
File "D:\apps\SD-WebUI\ComfyUI\comfy\ops.py", line 549 in _load_from_state_dict
File "D:\apps\Python\Python312\Lib\site-packages\torch\nn\modules\module.py", line 2588 in load
File "D:\apps\Python\Python312\Lib\site-packages\torch\nn\modules\module.py", line 2605 in load
File "D:\apps\Python\Python312\Lib\site-packages\torch\nn\modules\module.py", line 2605 in load
File "D:\apps\Python\Python312\Lib\site-packages\torch\nn\modules\module.py", line 2618 in load_state_dict
File "D:\apps\SD-WebUI\ComfyUI\comfy\model_base.py", line 369 in load_model_weights
File "D:\apps\SD-WebUI\ComfyUI\comfy\sd.py", line 2207 in load_state_dict_guess_config
File "D:\apps\SD-WebUI\ComfyUI\comfy\sd.py", line 2090 in load_checkpoint_guess_config
File "D:\apps\SD-WebUI\ComfyUI\nodes.py", line 636 in load_checkpoint
File "D:\apps\SD-WebUI\ComfyUI\execution.py", line 306 in process_inputs
File "D:\apps\SD-WebUI\ComfyUI\execution.py", line 318 in _async_map_node_over_list
File "D:\apps\SD-WebUI\ComfyUI\execution.py", line 344 in get_output_data
File "D:\apps\SD-WebUI\ComfyUI\execution.py", line 545 in execute
File "D:\apps\SD-WebUI\ComfyUI\execution.py", line 789 in execute_async
File "D:\apps\Python\Python312\Lib\asyncio\events.py", line 84 in _run
File "D:\apps\Python\Python312\Lib\asyncio\base_events.py", line 1951 in _run_once
File "D:\apps\Python\Python312\Lib\asyncio\base_events.py", line 618 in run_forever
File "D:\apps\Python\Python312\Lib\asyncio\windows_events.py", line 321 in run_forever
File "D:\apps\Python\Python312\Lib\asyncio\base_events.py", line 651 in run_until_complete
File "D:\apps\Python\Python312\Lib\asyncio\runners.py", line 118 in run
File "D:\apps\Python\Python312\Lib\asyncio\runners.py", line 194 in run
File "D:\apps\SD-WebUI\ComfyUI\execution.py", line 728 in execute
File "D:\apps\SD-WebUI\ComfyUI\main.py", line 394 in prompt_worker
File "D:\apps\Python\Python312\Lib\threading.py", line 989 in run
File "D:\apps\Python\Python312\Lib\threading.py", line 1052 in _bootstrap_inner
File "D:\apps\Python\Python312\Lib\threading.py", line 1009 in _bootstrap
Windows fatal exception: access violation

Stack (most recent call first):
File "D:\apps\Python\Python312\Lib\site-packages\torch\nn\modules\module.py", line 2495 in _load_from_state_dict
File "D:\apps\SD-WebUI\ComfyUI\comfy\ops.py", line 549 in _load_from_state_dict
File "D:\apps\Python\Python312\Lib\site-packages\torch\nn\modules\module.py", line 2588 in load
File "D:\apps\Python\Python312\Lib\site-packages\torch\nn\modules\module.py", line 2605 in load
File "D:\apps\Python\Python312\Lib\site-packages\torch\nn\modules\module.py", line 2605 in load
File "D:\apps\Python\Python312\Lib\site-packages\torch\nn\modules\module.py", line 2618 in load_state_dict
File "D:\apps\SD-WebUI\ComfyUI\comfy\model_base.py", line 369 in load_model_weights
File "D:\apps\SD-WebUI\ComfyUI\comfy\sd.py", line 2207 in load_state_dict_guess_config
File "D:\apps\SD-WebUI\ComfyUI\comfy\sd.py", line 2090 in load_checkpoint_guess_config
File "D:\apps\SD-WebUI\ComfyUI\nodes.py", line 636 in load_checkpoint
File "D:\apps\SD-WebUI\ComfyUI\execution.py", line 306 in process_inputs
File "D:\apps\SD-WebUI\ComfyUI\execution.py", line 318 in _async_map_node_over_list
File "D:\apps\SD-WebUI\ComfyUI\execution.py", line 344 in get_output_data
File "D:\apps\SD-WebUI\ComfyUI\execution.py", line 545 in execute
File "D:\apps\SD-WebUI\ComfyUI\execution.py", line 789 in execute_async
File "D:\apps\Python\Python312\Lib\asyncio\events.py", line 84 in _run
File "D:\apps\Python\Python312\Lib\asyncio\base_events.py", line 1951 in _run_once
File "D:\apps\Python\Python312\Lib\asyncio\base_events.py", line 618 in run_forever
File "D:\apps\Python\Python312\Lib\asyncio\windows_events.py", line 321 in run_forever
File "D:\apps\Python\Python312\Lib\asyncio\base_events.py", line 651 in run_until_complete
File "D:\apps\Python\Python312\Lib\asyncio\runners.py", line 118 in run
File "D:\apps\Python\Python312\Lib\asyncio\runners.py", line 194 in run
File "D:\apps\SD-WebUI\ComfyUI\execution.py", line 728 in execute
File "D:\apps\SD-WebUI\ComfyUI\main.py", line 394 in prompt_worker
File "D:\apps\Python\Python312\Lib\threading.py", line 989 in run
File "D:\apps\Python\Python312\Lib\threading.py", line 1052 in _bootstrap_inner
File "D:\apps\Python\Python312\Lib\threading.py", line 1009 in _bootstrap
Windows fatal exception: access violation

Stack (most recent call first):
File "D:\apps\Python\Python312\Lib\site-packages\torch\nn\modules\module.py", line 2495 in _load_from_state_dict
File "D:\apps\SD-WebUI\ComfyUI\comfy\ops.py", line 549 in _load_from_state_dict
File "D:\apps\Python\Python312\Lib\site-packages\torch\nn\modules\module.py", line 2588 in load
File "D:\apps\Python\Python312\Lib\site-packages\torch\nn\modules\module.py", line 2605 in load
File "D:\apps\Python\Python312\Lib\site-packages\torch\nn\modules\module.py", line 2605 in load
File "D:\apps\Python\Python312\Lib\site-packages\torch\nn\modules\module.py", line 2618 in load_state_dict
File "D:\apps\SD-WebUI\ComfyUI\comfy\model_base.py", line 369 in load_model_weights
File "D:\apps\SD-WebUI\ComfyUI\comfy\sd.py", line 2207 in load_state_dict_guess_config
File "D:\apps\SD-WebUI\ComfyUI\comfy\sd.py", line 2090 in load_checkpoint_guess_config
File "D:\apps\SD-WebUI\ComfyUI\nodes.py", line 636 in load_checkpoint
File "D:\apps\SD-WebUI\ComfyUI\execution.py", line 306 in process_inputs
File "D:\apps\SD-WebUI\ComfyUI\execution.py", line 318 in _async_map_node_over_list
File "D:\apps\SD-WebUI\ComfyUI\execution.py", line 344 in get_output_data
File "D:\apps\SD-WebUI\ComfyUI\execution.py", line 545 in execute
File "D:\apps\SD-WebUI\ComfyUI\execution.py", line 789 in execute_async
File "D:\apps\Python\Python312\Lib\asyncio\events.py", line 84 in _run
File "D:\apps\Python\Python312\Lib\asyncio\base_events.py", line 1951 in _run_once
File "D:\apps\Python\Python312\Lib\asyncio\base_events.py", line 618 in run_forever
File "D:\apps\Python\Python312\Lib\asyncio\windows_events.py", line 321 in run_forever
File "D:\apps\Python\Python312\Lib\asyncio\base_events.py", line 651 in run_until_complete
File "D:\apps\Python\Python312\Lib\asyncio\runners.py", line 118 in run
File "D:\apps\Python\Python312\Lib\asyncio\runners.py", line 194 in run
File "D:\apps\SD-WebUI\ComfyUI\execution.py", line 728 in execute
File "D:\apps\SD-WebUI\ComfyUI\main.py", line 394 in prompt_worker
File "D:\apps\Python\Python312\Lib\threading.py", line 989 in run
File "D:\apps\Python\Python312\Lib\threading.py", line 1052 in _bootstrap_inner
File "D:\apps\Python\Python312\Lib\threading.py", line 1009 in _bootstrap
Windows fatal exception: access violation

Stack (most recent call first):
File "D:\apps\Python\Python312\Lib\site-packages\torch\nn\modules\module.py", line 2495 in _load_from_state_dict
File "D:\apps\SD-WebUI\ComfyUI\comfy\ops.py", line 549 in _load_from_state_dict
File "D:\apps\Python\Python312\Lib\site-packages\torch\nn\modules\module.py", line 2588 in load
File "D:\apps\Python\Python312\Lib\site-packages\torch\nn\modules\module.py", line 2605 in load
File "D:\apps\Python\Python312\Lib\site-packages\torch\nn\modules\module.py", line 2605 in load
File "D:\apps\Python\Python312\Lib\site-packages\torch\nn\modules\module.py", line 2618 in load_state_dict
File "D:\apps\SD-WebUI\ComfyUI\comfy\model_base.py", line 369 in load_model_weights
File "D:\apps\SD-WebUI\ComfyUI\comfy\sd.py", line 2207 in load_state_dict_guess_config
File "D:\apps\SD-WebUI\ComfyUI\comfy\sd.py", line 2090 in load_checkpoint_guess_config
File "D:\apps\SD-WebUI\ComfyUI\nodes.py", line 636 in load_checkpoint
File "D:\apps\SD-WebUI\ComfyUI\execution.py", line 306 in process_inputs
File "D:\apps\SD-WebUI\ComfyUI\execution.py", line 318 in _async_map_node_over_list
File "D:\apps\SD-WebUI\ComfyUI\execution.py", line 344 in get_output_data
File "D:\apps\SD-WebUI\ComfyUI\execution.py", line 545 in execute
File "D:\apps\SD-WebUI\ComfyUI\execution.py", line 789 in execute_async
File "D:\apps\Python\Python312\Lib\asyncio\events.py", line 84 in _run
File "D:\apps\Python\Python312\Lib\asyncio\base_events.py", line 1951 in _run_once
File "D:\apps\Python\Python312\Lib\asyncio\base_events.py", line 618 in run_forever
File "D:\apps\Python\Python312\Lib\asyncio\windows_events.py", line 321 in run_forever
File "D:\apps\Python\Python312\Lib\asyncio\base_events.py", line 651 in run_until_complete
File "D:\apps\Python\Python312\Lib\asyncio\runners.py", line 118 in run
File "D:\apps\Python\Python312\Lib\asyncio\runners.py", line 194 in run
File "D:\apps\SD-WebUI\ComfyUI\execution.py", line 728 in execute
File "D:\apps\SD-WebUI\ComfyUI\main.py", line 394 in prompt_worker
File "D:\apps\Python\Python312\Lib\threading.py", line 989 in run
File "D:\apps\Python\Python312\Lib\threading.py", line 1052 in _bootstrap_inner
File "D:\apps\Python\Python312\Lib\threading.py", line 1009 in _bootstrap
Windows fatal exception: access violation

Stack (most recent call first):
File "D:\apps\Python\Python312\Lib\site-packages\torch\nn\modules\module.py", line 2495 in _load_from_state_dict
File "D:\apps\SD-WebUI\ComfyUI\comfy\ops.py", line 549 in _load_from_state_dict
File "D:\apps\Python\Python312\Lib\site-packages\torch\nn\modules\module.py", line 2588 in load
File "D:\apps\Python\Python312\Lib\site-packages\torch\nn\modules\module.py", line 2605 in load
File "D:\apps\Python\Python312\Lib\site-packages\torch\nn\modules\module.py", line 2605 in load
File "D:\apps\Python\Python312\Lib\site-packages\torch\nn\modules\module.py", line 2618 in load_state_dict
File "D:\apps\SD-WebUI\ComfyUI\comfy\model_base.py", line 369 in load_model_weights
File "D:\apps\SD-WebUI\ComfyUI\comfy\sd.py", line 2207 in load_state_dict_guess_config
File "D:\apps\SD-WebUI\ComfyUI\comfy\sd.py", line 2090 in load_checkpoint_guess_config
File "D:\apps\SD-WebUI\ComfyUI\nodes.py", line 636 in load_checkpoint
File "D:\apps\SD-WebUI\ComfyUI\execution.py", line 306 in process_inputs
File "D:\apps\SD-WebUI\ComfyUI\execution.py", line 318 in _async_map_node_over_list
File "D:\apps\SD-WebUI\ComfyUI\execution.py", line 344 in get_output_data
File "D:\apps\SD-WebUI\ComfyUI\execution.py", line 545 in execute
File "D:\apps\SD-WebUI\ComfyUI\execution.py", line 789 in execute_async
File "D:\apps\Python\Python312\Lib\asyncio\events.py", line 84 in _run
File "D:\apps\Python\Python312\Lib\asyncio\base_events.py", line 1951 in _run_once
File "D:\apps\Python\Python312\Lib\asyncio\base_events.py", line 618 in run_forever
File "D:\apps\Python\Python312\Lib\asyncio\windows_events.py", line 321 in run_forever
File "D:\apps\Python\Python312\Lib\asyncio\base_events.py", line 651 in run_until_complete
File "D:\apps\Python\Python312\Lib\asyncio\runners.py", line 118 in run
File "D:\apps\Python\Python312\Lib\asyncio\runners.py", line 194 in run
File "D:\apps\SD-WebUI\ComfyUI\execution.py", line 728 in execute
File "D:\apps\SD-WebUI\ComfyUI\main.py", line 394 in prompt_worker
File "D:\apps\Python\Python312\Lib\threading.py", line 989 in run
File "D:\apps\Python\Python312\Lib\threading.py", line 1052 in _bootstrap_inner
File "D:\apps\Python\Python312\Lib\threading.py", line 1009 in _bootstrap
Windows fatal exception: access violation

Stack (most recent call first):
File "D:\apps\Python\Python312\Lib\site-packages\torch\nn\modules\module.py", line 2495 in _load_from_state_dict
File "D:\apps\SD-WebUI\ComfyUI\comfy\ops.py", line 549 in _load_from_state_dict
File "D:\apps\Python\Python312\Lib\site-packages\torch\nn\modules\module.py", line 2588 in load
File "D:\apps\Python\Python312\Lib\site-packages\torch\nn\modules\module.py", line 2605 in load
File "D:\apps\Python\Python312\Lib\site-packages\torch\nn\modules\module.py", line 2605 in load
File "D:\apps\Python\Python312\Lib\site-packages\torch\nn\modules\module.py", line 2618 in load_state_dict
File "D:\apps\SD-WebUI\ComfyUI\comfy\model_base.py", line 369 in load_model_weights
File "D:\apps\SD-WebUI\ComfyUI\comfy\sd.py", line 2207 in load_state_dict_guess_config
File "D:\apps\SD-WebUI\ComfyUI\comfy\sd.py", line 2090 in load_checkpoint_guess_config
File "D:\apps\SD-WebUI\ComfyUI\nodes.py", line 636 in load_checkpoint
File "D:\apps\SD-WebUI\ComfyUI\execution.py", line 306 in process_inputs
File "D:\apps\SD-WebUI\ComfyUI\execution.py", line 318 in _async_map_node_over_list
File "D:\apps\SD-WebUI\ComfyUI\execution.py", line 344 in get_output_data
File "D:\apps\SD-WebUI\ComfyUI\execution.py", line 545 in execute
File "D:\apps\SD-WebUI\ComfyUI\execution.py", line 789 in execute_async
File "D:\apps\Python\Python312\Lib\asyncio\events.py", line 84 in _run
File "D:\apps\Python\Python312\Lib\asyncio\base_events.py", line 1951 in _run_once
File "D:\apps\Python\Python312\Lib\asyncio\base_events.py", line 618 in run_forever
File "D:\apps\Python\Python312\Lib\asyncio\windows_events.py", line 321 in run_forever
File "D:\apps\Python\Python312\Lib\asyncio\base_events.py", line 651 in run_until_complete
File "D:\apps\Python\Python312\Lib\asyncio\runners.py", line 118 in run
File "D:\apps\Python\Python312\Lib\asyncio\runners.py", line 194 in run
File "D:\apps\SD-WebUI\ComfyUI\execution.py", line 728 in execute
File "D:\apps\SD-WebUI\ComfyUI\main.py", line 394 in prompt_worker
File "D:\apps\Python\Python312\Lib\threading.py", line 989 in run
File "D:\apps\Python\Python312\Lib\threading.py", line 1052 in _bootstrap_inner
File "D:\apps\Python\Python312\Lib\threading.py", line 1009 in _bootstrap
Windows fatal exception: access violation

Stack (most recent call first):
File "D:\apps\Python\Python312\Lib\site-packages\torch\nn\modules\module.py", line 2495 in _load_from_state_dict
File "D:\apps\SD-WebUI\ComfyUI\comfy\ops.py", line 549 in _load_from_state_dict
File "D:\apps\Python\Python312\Lib\site-packages\torch\nn\modules\module.py", line 2588 in load
File "D:\apps\Python\Python312\Lib\site-packages\torch\nn\modules\module.py", line 2605 in load
File "D:\apps\Python\Python312\Lib\site-packages\torch\nn\modules\module.py", line 2605 in load
File "D:\apps\Python\Python312\Lib\site-packages\torch\nn\modules\module.py", line 2618 in load_state_dict
File "D:\apps\SD-WebUI\ComfyUI\comfy\model_base.py", line 369 in load_model_weights
File "D:\apps\SD-WebUI\ComfyUI\comfy\sd.py", line 2207 in load_state_dict_guess_config
File "D:\apps\SD-WebUI\ComfyUI\comfy\sd.py", line 2090 in load_checkpoint_guess_config
File "D:\apps\SD-WebUI\ComfyUI\nodes.py", line 636 in load_checkpoint
File "D:\apps\SD-WebUI\ComfyUI\execution.py", line 306 in process_inputs
File "D:\apps\SD-WebUI\ComfyUI\execution.py", line 318 in _async_map_node_over_list
File "D:\apps\SD-WebUI\ComfyUI\execution.py", line 344 in get_output_data
File "D:\apps\SD-WebUI\ComfyUI\execution.py", line 545 in execute
File "D:\apps\SD-WebUI\ComfyUI\execution.py", line 789 in execute_async
File "D:\apps\Python\Python312\Lib\asyncio\events.py", line 84 in _run
File "D:\apps\Python\Python312\Lib\asyncio\base_events.py", line 1951 in _run_once
File "D:\apps\Python\Python312\Lib\asyncio\base_events.py", line 618 in run_forever
File "D:\apps\Python\Python312\Lib\asyncio\windows_events.py", line 321 in run_forever
File "D:\apps\Python\Python312\Lib\asyncio\base_events.py", line 651 in run_until_complete
File "D:\apps\Python\Python312\Lib\asyncio\runners.py", line 118 in run
File "D:\apps\Python\Python312\Lib\asyncio\runners.py", line 194 in run
File "D:\apps\SD-WebUI\ComfyUI\execution.py", line 728 in execute
File "D:\apps\SD-WebUI\ComfyUI\main.py", line 394 in prompt_worker
File "D:\apps\Python\Python312\Lib\threading.py", line 989 in run
File "D:\apps\Python\Python312\Lib\threading.py", line 1052 in _bootstrap_inner
File "D:\apps\Python\Python312\Lib\threading.py", line 1009 in _bootstrap
Windows fatal exception: access violation

Stack (most recent call first):
File "D:\apps\Python\Python312\Lib\site-packages\torch\nn\modules\module.py", line 2495 in _load_from_state_dict
File "D:\apps\SD-WebUI\ComfyUI\comfy\ops.py", line 549 in _load_from_state_dict
File "D:\apps\Python\Python312\Lib\site-packages\torch\nn\modules\module.py", line 2588 in load
File "D:\apps\Python\Python312\Lib\site-packages\torch\nn\modules\module.py", line 2605 in load
File "D:\apps\Python\Python312\Lib\site-packages\torch\nn\modules\module.py", line 2605 in load
File "D:\apps\Python\Python312\Lib\site-packages\torch\nn\modules\module.py", line 2618 in load_state_dict
File "D:\apps\SD-WebUI\ComfyUI\comfy\model_base.py", line 369 in load_model_weights
File "D:\apps\SD-WebUI\ComfyUI\comfy\sd.py", line 2207 in load_state_dict_guess_config
File "D:\apps\SD-WebUI\ComfyUI\comfy\sd.py", line 2090 in load_checkpoint_guess_config
File "D:\apps\SD-WebUI\ComfyUI\nodes.py", line 636 in load_checkpoint
File "D:\apps\SD-WebUI\ComfyUI\execution.py", line 306 in process_inputs
File "D:\apps\SD-WebUI\ComfyUI\execution.py", line 318 in _async_map_node_over_list
File "D:\apps\SD-WebUI\ComfyUI\execution.py", line 344 in get_output_data
File "D:\apps\SD-WebUI\ComfyUI\execution.py", line 545 in execute
File "D:\apps\SD-WebUI\ComfyUI\execution.py", line 789 in execute_async
File "D:\apps\Python\Python312\Lib\asyncio\events.py", line 84 in _run
File "D:\apps\Python\Python312\Lib\asyncio\base_events.py", line 1951 in _run_once
File "D:\apps\Python\Python312\Lib\asyncio\base_events.py", line 618 in run_forever
File "D:\apps\Python\Python312\Lib\asyncio\windows_events.py", line 321 in run_forever
File "D:\apps\Python\Python312\Lib\asyncio\base_events.py", line 651 in run_until_complete
File "D:\apps\Python\Python312\Lib\asyncio\runners.py", line 118 in run
File "D:\apps\Python\Python312\Lib\asyncio\runners.py", line 194 in run
File "D:\apps\SD-WebUI\ComfyUI\execution.py", line 728 in execute
File "D:\apps\SD-WebUI\ComfyUI\main.py", line 394 in prompt_worker
File "D:\apps\Python\Python312\Lib\threading.py", line 989 in run
File "D:\apps\Python\Python312\Lib\threading.py", line 1052 in _bootstrap_inner
File "D:\apps\Python\Python312\Lib\threading.py", line 1009 in _bootstrap
[INFO] Using split attention in VAE
[INFO] Using split attention in VAE
[INFO] VAE load device: cpu, offload device: cpu, dtype: torch.float32
[INFO] Requested to load SD1ClipModel
[INFO] loaded completely; 235.84 MB loaded, full load: True
[INFO] CLIP/text encoder model load device: cpu, offload device: cpu, current: cpu, dtype: torch.float16
[INFO] Requested to load BaseModel
[INFO] loaded completely; 3278.81 MB loaded, full load: True
75%|████████████████████████████████████████████████████████████▊ | 3/4 [02:22<00:47, 47.32s/it][WARNING] Cannot connect to comfyregistry.
FETCH DATA from: D:\apps\SD-WebUI\ComfyUI\user\__manager\cache\1514988643_custom-node-list.json [DONE]
[INFO] [ComfyUI-Manager] All startup tasks have been completed.
100%|█████████████████████████████████████████████████████████████████████████████████| 4/4 [03:09<00:00, 47.49s/it]
[INFO] Requested to load AutoencoderKL
[INFO] loaded completely; 319.11 MB loaded, full load: True
[INFO] Prompt executed in 209.71 seconds
```

### Other

### Environment

- Windows 11
- ComfyUI 0.34.0
- Python 3.12.0
- PyTorch 2.12.1+cu130
- NVIDIA driver 610.88
- RTX 4070 Ti SUPER 16GB
- Ryzen 9 5900X
- 64GB RAM
- comfy-aimdo 0.5.2
- comfy-kitchen 0.2.33

### Investigation

I initially suspected DynamicVRAM/AIMDO because I was also seeing access violations during startup when DynamicVRAM was enabled.

However, `--disable-dynamic-vram` removes the startup access violations, but the runtime access violation described here still occurs.

I then reproduced the runtime issue using `--cpu`, and the same access violation occurs. This rules out the runtime issue being dependent on CUDA/GPU execution.

I have also reproduced the issue with all custom nodes disabled using:

`--disable-all-custom-nodes`

The startup log confirms:

`[INFO] Skipping loading of custom nodes`

The access violation still occurs in exactly the same model-loading path.

I also tested the underlying components independently:

- `torch.nn.Module.load_state_dict()` — PASS
- `load_state_dict(assign=True)` — PASS
- `comfy.ops.disable_weight_init.Linear` state_dict loading — PASS
- `safetensors.torch.load_file()` against the actual Juggernaut checkpoint — PASS
- SafeTensors successfully loaded 1,145 tensors

The access violation therefore appears to require the full ComfyUI model-loading path rather than simply loading the SafeTensors file or performing a basic PyTorch state_dict operation.

The relevant traceback passes through:

`comfy.model._base.load_model_weights()`
→ `torch.nn.Module.load_state_dict()`
→ `comfy.ops.py`
→ `torch.nn.Module._load_from_state_dict()`

The native access violation does not terminate the process. ComfyUI continues and successfully completes the generation.

I am aware of issue #15255 concerning Windows access violations and DynamicVRAM. However, this issue reproduces with DynamicVRAM disabled and also with `--cpu`, so it appears to be separate from the DynamicVRAM/CUDA issue reported there.

Image

[Basic-Test-workflow.json](https://github.com/user-attachments/files/31891152/Basic-Test-workflow.json)

Contributor guide

Open the contributing guide

Research direction

Reproduce on Windows with --cpu --fast --enable-manager --disable-all-custom-nodes using Juggernaut_aftermath.safetensors. Start at comfy/ops.py line 549 and follow the model-loading path through comfy/model_base.py:369, comfy/sd.py, and nodes.py:636. Done means the first model load completes without a Windows access violation and the workflow still executes successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
backend, machine-learning, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.