Skip to content

"Cannot access a disposed object" after clicking image in [inferencer] gallery panel #1367

@richardm1

Description

@richardm1

What happened?

Drag-and-drop image from the gallery (right side of inferencer) into the prompt window:

025-08-31 01:31:20.7650|INFO|StabilityMatrix.Avalonia.ViewModels.Base.InferenceTabViewModelBase|Loading image metadata from LocalImageFile at '"/mnt/M9200/SM/Data/Images/Inference/lustifySDXLNSFW_oltFIXEDTEXTURES-DPM++ 2M SDE Karras-1392122868-00-57-05.png"'
2025-08-31 01:31:20.7650|INFO|StabilityMatrix.Avalonia.ViewModels.Base.InferenceTabViewModelBase|Loading Project State (Type: "InferenceTextToImageViewModel")
2025-08-31 01:31:20.7695|WARN|StabilityMatrix.Avalonia.ViewModels.Base.InferenceTabViewModelBase|Failed to load image from context drop|System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'IServiceProvider'.
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.ThrowHelper.ThrowObjectDisposedException()
   at StabilityMatrix.Avalonia.Services.ScopedServiceManager`1.Get(Type serviceType)
   at StabilityMatrix.Avalonia.ViewModels.Inference.StackViewModelBase.LoadStateFromJsonObject(JsonObject state)
   at StabilityMatrix.Avalonia.ViewModels.Base.LoadableViewModelBase.LoadStateFromJsonObject(JsonObject state)
   at Avalonia.Threading.Dispatcher.Invoke(Action callback, DispatcherPriority priority, CancellationToken cancellationToken, TimeSpan timeout)
   at Avalonia.Threading.Dispatcher.Invoke(Action callback)
   at StabilityMatrix.Avalonia.ViewModels.Base.InferenceTabViewModelBase.LoadImageMetadata(String imageFilePath, ValueTuple`5 metadata)
   at StabilityMatrix.Avalonia.ViewModels.Base.InferenceTabViewModelBase.LoadImageMetadata(LocalImageFile localImageFile)
   at StabilityMatrix.Avalonia.ViewModels.Base.InferenceTabViewModelBase.<>c__DisplayClass30_0.<Drop>b__0()

Seems to happen at random. I can tell it's about to happen when I flip to an existing generation tab and the model (checkpoint) selector is blank.

Note the .PNG generation appears to be fine (i.e. no metadata corruption). Drag-and-drop of said image works if I restart SM.

Steps to reproduce

See above.

Relevant logs

pasted above

Version

v2.15.0-pre.2+fdf2ae0

What Operating System are you using?

Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions