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

Preview generation does not use selected sampler due to recent WebUI commit changing sampler_index to sampler_name #30

Open
rabidcopy opened this issue Nov 20, 2022 · 0 comments

Comments

@rabidcopy
Copy link

rabidcopy commented Nov 20, 2022

Currently when using Read parameters (prompt, etc...) from txt2img tab when making previews, the sampler selected is ignored and instead the default ("Euler a") sampler is used. This is due to this recent commit to WebUI that changed sampler_index to sampler_name.
AUTOMATIC1111/stable-diffusion-webui@cdc8020#diff-d3503031ef91fb35651a650f994dd8c94d405fe8e690c41817b1d095d66b1c69R348
The one line in this repo affected is this.
https://github.com/7eu7d7/DreamArtist-sd-webui-extension/blob/069ce4124580c69dc2d373a2a9e856b08afa715f/scripts/dream_artist/cptuning.py#L516
I believe this issue can be solved by matching textual_inversion.py by importing sd_samplers from modules and changing p.sampler_index = preview_sampler_index to p.sampler_name = sd_samplers.samplers[preview_sampler_index].name. I will test to see if this fixes it and the correct sampler is respected when generating previews. I would make a PR, but I'm not sure how you'll want to handle backwards compatibility if people aren't on the latest WebUI. E.g. should p.sampler_index still be left along side the new fixed p.sampler_name entry.
Edit: Adding sd_samplers after the images import and changing the line at 516 in cptuning.py to reflect the above change resolves the preview sampler issue and the correct one is used.

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

1 participant