Title: ImageGenerationParameterExtension.WithPhotomaker() is a no-op — doesn't set any parameter
Version: StableDiffusion.NET 7.0.0 (NuGet)
Description:
While trying to use PhotoMaker for face-consistent generation, I decompiled StableDiffusion.NET.dll and found that WithPhotomaker() on ImageGenerationParameter doesn't actually do anything — it just returns the parameter object unchanged:
public static ImageGenerationParameter WithPhotomaker(this ImageGenerationParameter parameter, string inputIdImageDirectory, float? styleStrength = null, bool? normalizeInput = null)
{
return parameter;
}
The signature looks correct (matches stable-diffusion.cpp's --input-id-images-dir, --style-ratio, --normalize-input flags), but none of the arguments are stored anywhere on parameter.
For context: DiffusionModelParameter.WithPhotomaker(string stackedIdEmbeddingsDirectory) (on the model, not the generation params) does correctly set parameter.StackedIdEmbeddingsDirectory, — but there's no way to actually pass the reference/id images through the public API, since this generation-level method is empty.
Expected behavior: the method should set something like parameter.InputIdImageDirectory, parameter.StyleStrength, parameter.NormalizeInput (or equivalent fields consumed by the native call), matching how WithControlNet() or WithRefImages() populate their respective fields.
Repro:
using DiffusionModel sd = new(DiffusionModelParameter.Create()
.WithModelPath("<sdxl_model>")
.WithPhotomaker("<path_to_photomaker-v2.safetensors>"));
var img = sd.GenerateImage(ImageGenerationParameter
.TextToImage("a woman img, 40 years old, photorealistic")
.WithPhotomaker("<path_to_id_images_dir>", styleStrength: 20f)
.WithSDXLDefaults());
No error is thrown, but the id images are silently ignored since nothing in WithPhotomaker() propagates them further.
Happy to test a fix if you point me in the right direction — thanks for maintaining this project!
Title:
ImageGenerationParameterExtension.WithPhotomaker()is a no-op — doesn't set any parameterVersion: StableDiffusion.NET 7.0.0 (NuGet)
Description:
While trying to use PhotoMaker for face-consistent generation, I decompiled
StableDiffusion.NET.dlland found thatWithPhotomaker()onImageGenerationParameterdoesn't actually do anything — it just returns the parameter object unchanged:The signature looks correct (matches stable-diffusion.cpp's
--input-id-images-dir,--style-ratio,--normalize-inputflags), but none of the arguments are stored anywhere onparameter.For context:
DiffusionModelParameter.WithPhotomaker(string stackedIdEmbeddingsDirectory)(on the model, not the generation params) does correctly setparameter.StackedIdEmbeddingsDirectory, — but there's no way to actually pass the reference/id images through the public API, since this generation-level method is empty.Expected behavior: the method should set something like
parameter.InputIdImageDirectory,parameter.StyleStrength,parameter.NormalizeInput(or equivalent fields consumed by the native call), matching howWithControlNet()orWithRefImages()populate their respective fields.Repro:
No error is thrown, but the id images are silently ignored since nothing in
WithPhotomaker()propagates them further.Happy to test a fix if you point me in the right direction — thanks for maintaining this project!