Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

run error "System.DllNotFoundException:“Unable to load DLL 'stable-diffusion' or one of its dependencies: 找不到指定的模块。 (0x8007007E)”" #38

Closed
billqu01 opened this issue Nov 29, 2024 · 5 comments

Comments

@billqu01
Copy link

in my .net8 WinUI project.
My codes:
public MainWindow()
{
this.InitializeComponent();

// 获取当前应用的安装目录
string model_folder = Path.Combine(Package.Current.InstalledLocation.Path, "model");

// 构建完整的模型路径
var fluxPath = Path.Combine(model_folder, "flux1-schnell-q4_k.gguf");
var clipPath = Path.Combine(model_folder, "clip_l.safetensors");
var t5xxlPath = Path.Combine(model_folder, "t5xxl_fp8_e4m3fn.safetensors");
var aePath = Path.Combine(model_folder, "ae.safetensors");

// 初始化模型
model = ModelBuilder.Flux(fluxPath, clipPath, t5xxlPath, aePath)
                    .WithMultithreading()
                    .Build();

}
in the line:
model = ModelBuilder.Flux(fluxPath, clipPath, t5xxlPath, aePath)
.WithMultithreading()
.Build();
run error:
Unable to load DLL 'stable-diffusion' or one of its dependencies: 找不到指定的模块。 (0x8007007E)

How to solve it?

Thank you.

@DarthAffe
Copy link
Owner

Assuming that you have installed one of the backend packages, I'd guess it's the same as #11
Some packaging issue that I can't really help with as it's a project specific thing.

@billqu01
Copy link
Author

I have installed StableDiffusion.NET.Backend.Cuda.
But the error is still be in.

@DarthAffe
Copy link
Owner

Are you running your application in 32bit? Otherwise I'm pretty sure the dll is just not found which would be related to your project setup/publish/packing. You could try to call StableDiffusionCpp.LoadNativeLibrary at application start with the path to the stable-diffusion.dll

@billqu01
Copy link
Author

billqu01 commented Dec 8, 2024

close.

1 similar comment
@billqu01
Copy link
Author

billqu01 commented Dec 8, 2024

close.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants