Skip to content

External component has thrown an exception #53

@SaymanDotNet

Description

@SaymanDotNet

Hello. I have simple code:

using HPPH;
using StableDiffusion.NET;

using DiffusionModel model = ModelBuilder.StableDiffusion(@"G:\path_to_checkpoints\jamJustAnotherMerge_v20bBakedvaePruned.safetensors")
										 .WithMultithreading()
										 .Build();


string prompt = "cat";
IImage<ColorRGB> image = model
						.TextToImage(prompt, model
							.GetDefaultParameter()
							.WithSteps(30)
							.WithCfg(8.0f)
							.WithSampler(Sampler.DPMPP2M)
							.WithSize(512, 800));

And i try to run and have error:
ggml_cuda_init: GGML_CUDA_FORCE_MMQ: no
ggml_cuda_init: GGML_CUDA_FORCE_CUBLAS: no
ggml_cuda_init: found 1 CUDA devices:
Device 0: NVIDIA GeForce RTX 3070, compute capability 8.6, VMM: yes
|==================================================| 1130/1130 - 500.00it/s
Unhandled exception. System.Runtime.InteropServices.SEHException (0x80004005): External component has thrown an exception.
at StableDiffusion.NET.Native.g____PInvoke|10_0(sd_ctx_t* __sd_ctx_native, Byte* __prompt_native, Byte* __negative_prompt_native, Int32 __clip_skip_native, Single __cfg_scale_native, Single __guidance_native, Single __eta_native, Int32 __width_native, Int32 __height_native, Sampler __sample_method_native, Int32 __sample_steps_native, Int64 __seed_native, Int32 __batch_count_native, sd_image_t* __control_cond_native, Single __control_strength_native, Single __style_strength_native, SByte __normalize_input_native, Byte* __input_id_images_path_native, Int32* __skip_layers_native, Int32 __skip_layers_count_native, Single __slg_scale_native, Single __skip_layer_start_native, Single __skip_layer_end_native)
at StableDiffusion.NET.Native.txt2img(sd_ctx_t* sd_ctx, String prompt, String negative_prompt, Int32 clip_skip, Single cfg_scale, Single guidance, Single eta, Int32 width, Int32 height, Sampler sample_method, Int32 sample_steps, Int64 seed, Int32 batch_count, sd_image_t* control_cond, Single control_strength, Single style_strength, Boolean normalize_input, String input_id_images_path, Int32[] skip_layers, Int32 skip_layers_count, Single slg_scale, Single skip_layer_start, Single skip_layer_end)
at StableDiffusion.NET.DiffusionModel.TextToImage(String prompt, DiffusionParameter parameter)
at Program.

$(String[] args) in C:\Users\Sayman\source\repos\SD.NetT1\SD.Net\Program.cs:line 12

Downloaded from nuget. And downloaded some dlls from stable-diffusion.cpp (cuda dlls).
Checkpoint file is sd1.5.
What am I doing wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions