From 68064e282dba34cfd4f5f1300d06ecf8cf277744 Mon Sep 17 00:00:00 2001 From: DarthAffe Date: Mon, 27 Oct 2025 19:56:48 +0100 Subject: [PATCH] Updated readme --- README.md | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index e96dbe9..0d88a85 100644 --- a/README.md +++ b/README.md @@ -27,11 +27,11 @@ StableDiffusionCpp.Progress += (_, args) => Console.WriteLine($"PROGRESS {args.S Image? treeWithTiger; // Load a StableDiffusion model in a using block to unload it again after the two images are created -using (DiffusionModel sd = ModelBuilder.StableDiffusion(@"") - .WithMultithreading() - .WithFlashAttention() - .Build()) +using (DiffusionModel sd = new(DiffusionModelParameter.Create() + .WithModelPath(@"N:\StableDiffusion\stable-diffusion-webui\models\Stable-diffusion\animagineXLV3_v30.safetensors") + // .WithVae(@"") + .WithMultithreading() + .WithFlashAttention())) { // Create a image from a prompt Image? tree = sd.GenerateImage(ImageGenerationParameter.TextToImage("A beautiful tree standing on a small hill").WithSDXLDefaults()); @@ -43,17 +43,24 @@ using (DiffusionModel sd = ModelBuilder.StableDiffusion(@"", - @"", - @"", - @"") - .WithMultithreading() - .WithFlashAttention() - .Build(); +// Load the qwen image edit model +using DiffusionModel qwenContext = new(DiffusionModelParameter.Create() + .WithDiffusionModelPath(@"") + .WithQwen2VLPath(@"") + .WithQwen2VLVisionPath(@"") + .WithVae(@"") + .WithMultithreading() + .WithFlashAttention() + .WithFlowShift(3) + .WithOffloadedParamsToCPU() + .WithImmediatelyFreedParams()); -// Perform an edit on the previosly created image -Image? tigerOnMoon = flux.GenerateImage(ImageGenerationParameter.TextToImage("Remove the hill with the grass and place the tree with the tiger on the moon").WithFluxDefaults().WithRefImages(treeWithTiger)); +// Perform an edit on the previously created image +Image? tigerOnMoon = qwenContext.GenerateImage(ImageGenerationParameter.TextToImage("Remove the background and place the tree and the tiger on the moon.") + .WithSize(1024, 1024) + .WithCfg(2.5f) + .WithSampler(Sampler.Euler) + .WithRefImages(treeWithTiger)); File.WriteAllBytes("image3.png", tigerOnMoon.ToPng()); ```