n00mkrad / text2image-gui

Somewhat modular text2image GUI, initially just for Stable Diffusion
GNU General Public License v3.0
931 stars 95 forks source link

Unhandled Thread Exception #58

Open gatoradokun opened 1 year ago

gatoradokun commented 1 year ago

Please help me!

Unhandled Thread Exception!

Object reference not set to an instance of an object.

Stack Trace: at StableDiffusionGui.Ui.MainForm.FormControls.get_IsUsingInpaintingModel() at StableDiffusionGui.Ui.MainForm.FormControls.RefreshUiAfterSettingsChanged() at StableDiffusionGui.Ui.MainForm.FormControls.UpdateInitImgAndEmbeddingUi() at System.Windows.Forms.ComboBox.OnSelectedIndexChanged(EventArgs e) at System.Windows.Forms.ComboBox.set_SelectedIndex(Int32 value) at StableDiffusionGui.ExtensionMethods.FillFromEnum[TEnum](ComboBox comboBox, Dictionary2 stringMap, Int32 defaultIndex, List1 exclusionList) at StableDiffusionGui.Ui.MainForm.FormControls.InitializeControls() at StableDiffusionGui.MainForm.d__7.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at StableDiffusionGui.MainForm.d__6.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

I also cannot turn off the program without the task manager, it gives this message:

Unhandled Thread Exception!

Access to the path 'C:\Program Files\SD-GUI-1.8.1\Data\config.json' is denied.

Stack Trace: at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) at System.IO.StreamWriter.CreateFile(String path, Boolean append, Boolean checkHost) at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize, Boolean checkHost) at System.IO.File.InternalWriteAllText(String path, String contents, Encoding encoding, Boolean checkHost) at StableDiffusionGui.Io.ConfigParser.SaveGuiElement(NumericUpDown upDown, String key, StringMode stringMode) at StableDiffusionGui.Ui.MainForm.FormControls.Save() at StableDiffusionGui.MainForm.MainForm_FormClosing(Object sender, FormClosingEventArgs e) at System.Windows.Forms.Form.OnFormClosing(FormClosingEventArgs e) at System.Windows.Forms.Form.WmClose(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Can anyone tell me what I should do? Thanks in advance.

RafaelEstevamReis commented 1 year ago

I could not reproduce this behavior, but there are two interesting factors:

  1. You got an "Access ... is denied."
  2. You installed at 'C:\Program Files\SD-GUI-1.8.1\' This may be an ReadOnly/permission issue related to your installation

Can you try move the SD-GUI folder to outside the "program files" folder? Like create a folder in the root directory And the try again?

I use mine at: C:\AI\SDG-[version]\

gatoradokun commented 1 year ago

Hey there! Thanks for replying but I found the solution, a really silly solution, if I recall correctly I just had to install an older version of Phyton. Thanks again Mr Rafael!

n00mkrad commented 1 year ago

Hey there! Thanks for replying but I found the solution, a really silly solution, if I recall correctly I just had to install an older version of Phyton. Thanks again Mr Rafael!

SD GUI does not use any system python installation, it comes with its own files. I doubt this was the issue.