JumpingCoconut / Elrond-stable-diffusion-webui-discord

Integrates AUTOMATIC1111 stable-diffusion-webui into a discord bot for easily accessible use
14 stars 2 forks source link

Option to Adjust Size, Sampling Steps, Sampling Method etc #2

Closed 4U0 closed 1 year ago

4U0 commented 1 year ago

Hello! Thank u so much for making this project. I wanted to ask if you could add option to adjust these option to the bot.

its almost necessary because i'm using a Anime Diffusion model and size on these images should be 512x704. i looked around but can't seem to find an option to adjust image width/height.

image

JumpingCoconut commented 1 year ago

Hello! Image width and height cant be given at the moment, but there is an option to use upscaling in the .env file. Maybe this is what would help you?

Default is UPSCALE_SIZE=2

The original image will always be generated in 512x512, because this is the size where stable diffusion and most other models like waifu diffusion are trained on (as far as I know). The upscaler can make the pictures bigger then. UPSCALE_SIZE=2 means that the final picture will be twice the size, so 1024x1024. You can make it even bigger, but currently it will always stay quadratic.

If this doesnt help you, you can try using the function gradio_mapper.set_this_label_to_value inside /elrond_sd_interface.py. I can't test it now, but in the sd_interface there should be a function for interface_txt2img. There you will find these lines which set the Webui parameters:

    gradio_mapper.set_this_label_to_value("Seed", seed)
    gradio_mapper.set_this_label_to_value("Batch count", quantity)
    gradio_mapper.set_this_label_to_value("Negative prompt", negative_prompt)
...etc

Here you could try adding the following and see if it works: gradio_mapper.set_this_label_to_value("Width", 512) and gradio_mapper.set_this_label_to_value("Height", 704)

Let me know which solution you went with and if it worked.

JumpingCoconut commented 1 year ago

Also, something I forgot, sorry:

The default values you set in your automatic1111s stable diffusion webui guiconfig are also valid for this bot.

Check your automatic1111/stable-diffusion-webui and there the file ui-config.json.

If you set your webui default config to DDIM and your sampling steps to 50, it should also work in the bot completely automatically. No configuration needed. If this doesnt work please let me know.

JumpingCoconut commented 1 year ago

No more replies, I think its solved.

Solution: Set the default values you want inside your automatic1111/stable-diffusion-webui , not inside Elrond. Elrond pays attention to the default values you configure in the webui.