Skip to content

Object reference not set #12

@Panabou

Description

@Panabou

(EDIT: This was with version 0.4.2, I will try the recent version. EDIT2: There is no 0.4.4 Windows installer yet.)
Hello, if I can load a new model (e.g. the 2 GB StableDiffusionXL model) I get the following error after I Press "Generate":

Image

2026-01-26 13:34:35.672 +01:00 [INF] [StartAsync] Starting Pipeline server...
2026-01-26 13:34:35.725 +01:00 [INF] [PipelineServer] [WaitForConnection] Waiting for connection...
2026-01-26 13:34:35.726 +01:00 [INF] [PipelineServer] [WaitForConnection] Client connected.
2026-01-26 13:34:35.727 +01:00 [INF] [PipelineServer] [ProgressChannel] Start progress channel.
2026-01-26 13:34:35.781 +01:00 [INF] [PipelineServer] [CommandChannel] Start command channel.
2026-01-26 13:34:35.781 +01:00 [INF] [PipelineServer] [CommandChannel] Waiting for command...
2026-01-26 13:34:35.785 +01:00 [INF] [PipelineServer] [PipelineChannel] Start pipeline channel.
2026-01-26 13:34:35.786 +01:00 [INF] [PipelineServer] [PipelineChannel] Waiting for request.
2026-01-26 13:34:35.871 +01:00 [INF] [PipelineServer] [PipelineChannel] Start request received.
2026-01-26 13:34:35.875 +01:00 [INF] [PipelineServer] [StartServer] Server started.
2026-01-26 13:34:35.875 +01:00 [INF] [PipelineServer] [PipelineChannel] Waiting for request.
2026-01-26 13:34:35.877 +01:00 [INF] [PipelineServer] [PipelineChannel] Environment request received.
2026-01-26 13:34:35.909 +01:00 [DBG] Adding environment site-packages to extra paths: C:\Users\x\AppData\Local\Diffuse\PythonRuntime\Pipelines.default-cuda\Lib\site-packages
2026-01-26 13:34:35.912 +01:00 [DBG] Virtual environment already exists at C:\Users\x\AppData\Local\Diffuse\PythonRuntime\Pipelines.default-cuda
2026-01-26 13:34:35.912 +01:00 [DBG] Setting up Python environment from C:\Users\x\AppData\Local\Diffuse\PythonRuntime\Python using home of C:\Users\x\AppData\Local\Diffuse\PythonRuntime\Pipelines
2026-01-26 13:34:35.912 +01:00 [DBG] Python DLL: C:\Users\x\AppData\Local\Diffuse\PythonRuntime\Python\python312.dll
2026-01-26 13:34:35.912 +01:00 [DBG] Python path: C:\Users\x\AppData\Local\Diffuse\PythonRuntime\Python\Lib;C:\Users\x\AppData\Local\Diffuse\PythonRuntime\Python\DLLs
2026-01-26 13:34:35.913 +01:00 [DBG] Adding extra paths to PYTHONPATH: C:\Users\x\AppData\Local\Diffuse\PythonRuntime\Pipelines.default-cuda\Lib\site-packages
2026-01-26 13:34:36.212 +01:00 [INF] [PipelineServer] [PipelineChannel] Waiting for request.
2026-01-26 13:34:36.216 +01:00 [INF] [PipelineServer] [PipelineChannel] PipelineLoad request received.
2026-01-26 13:34:36.217 +01:00 [INF] [PythonPipeline] [ReloadModule] Importing pipeline module 'StableDiffusionXLPipeline'.
2026-01-26 13:34:53.712 +01:00 [INF] [PythonPipeline] [Load] Loading pipeline.
2026-01-26 13:34:54.522 +01:00 [INF] [PythonPipeline] [PythonRuntime] Loading pipeline components...
2026-01-26 13:34:54.797 +01:00 [INF] [PythonPipeline] [PythonRuntime] Loading pipeline components...
2026-01-26 13:34:55.049 +01:00 [INF] [PythonPipeline] [PythonRuntime] Loading pipeline components...
2026-01-26 13:34:56.818 +01:00 [INF] [PythonPipeline] [PythonRuntime] [Quantize] OffloadCPU does not support quantization.
2026-01-26 13:35:02.636 +01:00 [ERR] [PythonPipeline] [PythonRuntime] MemoryError exception occurred
CSnakes.Runtime.PythonRuntimeException
File "C:\Users\x\AppData\Local\Diffuse\PythonRuntime\Pipelines\StableDiffusionXLPipeline.py", line 50, in load
_pipeline = create_pipeline(config)
^^^^^^^^^^^^^^^^^^^^^^^

File "C:\Users\x\AppData\Local\Diffuse\PythonRuntime\Pipelines\StableDiffusionXLPipeline.py", line 206, in create_pipeline
unet = load_unet(config, pipeline_config, quant_config_diffusers, pipeline_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "C:\Users\x\AppData\Local\Diffuse\PythonRuntime\Pipelines\StableDiffusionXLPipeline.py", line 285, in load_unet
return UNet2DConditionModel.from_pretrained(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "C:\Users\x\AppData\Local\Diffuse\PythonRuntime\Pipelines.default-cuda\Lib\site-packages\huggingface_hub\utils_validators.py", line 114, in _inner_fn
return fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^

File "C:\Users\x\AppData\Local\Diffuse\PythonRuntime\Pipelines.default-cuda\Lib\site-packages\diffusers\models\modeling_utils.py", line 1268, in from_pretrained
state_dict = load_state_dict(resolved_model_file[0], disable_mmap=disable_mmap, dduf_entries=dduf_entries)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "C:\Users\x\AppData\Local\Diffuse\PythonRuntime\Pipelines.default-cuda\Lib\site-packages\diffusers\models\model_loading_utils.py", line 196, in load_state_dict
if f.read().startswith("version"):
^^^^^^^^

2026-01-26 13:35:02.695 +01:00 [ERR] File "C:\Users\x\AppData\Local\Diffuse\PythonRuntime\Pipelines\StableDiffusionXLPipeline.py", line 50, in load
_pipeline = create_pipeline(config)
^^^^^^^^^^^^^^^^^^^^^^^

File "C:\Users\x\AppData\Local\Diffuse\PythonRuntime\Pipelines\StableDiffusionXLPipeline.py", line 206, in create_pipeline
unet = load_unet(config, pipeline_config, quant_config_diffusers, pipeline_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "C:\Users\x\AppData\Local\Diffuse\PythonRuntime\Pipelines\StableDiffusionXLPipeline.py", line 285, in load_unet
return UNet2DConditionModel.from_pretrained(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "C:\Users\x\AppData\Local\Diffuse\PythonRuntime\Pipelines.default-cuda\Lib\site-packages\huggingface_hub\utils_validators.py", line 114, in _inner_fn
return fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^

File "C:\Users\x\AppData\Local\Diffuse\PythonRuntime\Pipelines.default-cuda\Lib\site-packages\diffusers\models\modeling_utils.py", line 1268, in from_pretrained
state_dict = load_state_dict(resolved_model_file[0], disable_mmap=disable_mmap, dduf_entries=dduf_entries)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "C:\Users\x\AppData\Local\Diffuse\PythonRuntime\Pipelines.default-cuda\Lib\site-packages\diffusers\models\model_loading_utils.py", line 196, in load_state_dict
if f.read().startswith("version"):
^^^^^^^^

2026-01-26 13:35:02.697 +01:00 [ERR] [PipelineServer] [LoadPipeline] An exception occurred loading pipeline.
System.Exception
---> CSnakes.Runtime.PythonRuntimeException
File "C:\Users\x\AppData\Local\Diffuse\PythonRuntime\Pipelines\StableDiffusionXLPipeline.py", line 50, in load
_pipeline = create_pipeline(config)
^^^^^^^^^^^^^^^^^^^^^^^

File "C:\Users\x\AppData\Local\Diffuse\PythonRuntime\Pipelines\StableDiffusionXLPipeline.py", line 206, in create_pipeline
unet = load_unet(config, pipeline_config, quant_config_diffusers, pipeline_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "C:\Users\x\AppData\Local\Diffuse\PythonRuntime\Pipelines\StableDiffusionXLPipeline.py", line 285, in load_unet
return UNet2DConditionModel.from_pretrained(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "C:\Users\x\AppData\Local\Diffuse\PythonRuntime\Pipelines.default-cuda\Lib\site-packages\huggingface_hub\utils_validators.py", line 114, in _inner_fn
return fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^

File "C:\Users\x\AppData\Local\Diffuse\PythonRuntime\Pipelines.default-cuda\Lib\site-packages\diffusers\models\modeling_utils.py", line 1268, in from_pretrained
state_dict = load_state_dict(resolved_model_file[0], disable_mmap=disable_mmap, dduf_entries=dduf_entries)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "C:\Users\x\AppData\Local\Diffuse\PythonRuntime\Pipelines.default-cuda\Lib\site-packages\diffusers\models\model_loading_utils.py", line 196, in load_state_dict
if f.read().startswith("version"):
^^^^^^^^

--- End of inner exception stack trace ---
at TensorStack.Python.PythonPipeline.b__15_0()
at System.Threading.Tasks.Task1.InnerInvoke() at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state) --- End of stack trace from previous location --- at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread) --- End of stack trace from previous location --- at DiffuseApp.Common.PipelineServer.LoadPipelineAsync(PipelineRequest request, CancellationToken cancellationToken) 2026-01-26 13:35:02.725 +01:00 [INF] [PipelineServer] [PipelineChannel] Waiting for request. 2026-01-26 13:35:19.095 +01:00 [INF] [PipelineServer] [PipelineChannel] PipelineRun request received. 2026-01-26 13:35:19.096 +01:00 [ERR] [PipelineServer] [RunPipeline] An exception occurred running pipeline. System.NullReferenceException: Object reference not set to an instance of an object. at DiffuseApp.Common.PipelineServer.RunPipelineAsync(PipelineRequest request, PythonPipeline pipeline, CancellationToken cancellationToken) 2026-01-26 13:35:19.097 +01:00 [INF] [PipelineServer] [PipelineChannel] Waiting for request. 2026-01-26 13:40:27.215 +01:00 [INF] [PipelineServer] [PipelineChannel] PipelineUnload request received. 2026-01-26 13:40:27.216 +01:00 [ERR] [PipelineServer] [UnloadPipeline] An exception occurred unloading pipeline. System.NullReferenceException: Object reference not set to an instance of an object. at DiffuseApp.Common.PipelineServer.UnloadPipelineAsync(PipelineRequest request, PythonPipeline pipeline, CancellationToken cancellationToken) 2026-01-26 13:40:27.216 +01:00 [INF] [PipelineServer] [PipelineChannel] Waiting for request. 2026-01-26 13:40:27.218 +01:00 [INF] [PipelineServer] [PipelineChannel] Pipeline channel closed. 2026-01-26 13:40:27.219 +01:00 [ERR] [PipelineServer] [CommandChannel] - An exception occurred receiving command. System.IO.EndOfStreamException: Unable to read beyond the end of the stream. at System.IO.Stream.ReadAtLeastAsyncCore(Memory1 buffer, Int32 minimumBytes, Boolean throwOnEndOfStream, CancellationToken cancellationToken)
at System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder1.StateMachineBox1.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token)
at DiffuseApp.Common.Extensions.ReceiveObject[T](PipeStream pipe, CancellationToken cancellationToken)
at DiffuseApp.Common.PipelineServer.StartCommandChannelAsync(CancellationToken cancellationToken)
2026-01-26 13:40:27.219 +01:00 [INF] [PipelineServer] [Start] Generate loop stopped.
2026-01-26 13:40:27.221 +01:00 [INF] [StartAsync] Pipeline server stopped.

The new entries in the Diffuse Log:

2026-01-26 13:40:27.205 +01:00 [INF] [TextToImageView] [LoadPipelineAsync] - Loading pipeline...
2026-01-26 13:40:46.077 +01:00 [INF] [TextToImageView] [LoadPipelineAsync] - Loading pipeline complete.
2026-01-26 13:40:46.078 +01:00 [INF] [TextToImageView] [LoadPipelineAsync] - Elapsed: 00:00:18.8726791
2026-01-26 13:40:58.450 +01:00 [INF] [TextToImageView] [ExecuteAsync] - Executing pipeline..
2026-01-26 13:40:58.467 +01:00 [ERR] [TextToImageView] [ExecuteAsync] - An exception occurred executing pipeline.
System.Exception: Object reference not set to an instance of an object.
at DiffuseApp.Common.PipelineClient.SendPipelineRequestAsync(PipelineRequest request, CancellationToken cancellationToken)
at DiffuseApp.Common.PipelineClient.RunAsync(PipelineOptions options)
at Diffuse.Services.DiffusionService.GenerateImageAsync(DiffusionInputOptions options)
at Diffuse.Views.TextToImageView.ExecuteAsync()
2026-01-26 13:41:01.912 +01:00 [INF] [TextToImageView] [ExecuteAsync] - Elapsed: 00:00:03.4618410

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions