DeSinc / SallyBot

AI Chatbot coded in Discord.net C#
MIT License
299 stars 51 forks source link

enable_hr broken output #34

Closed BPplays closed 1 year ago

BPplays commented 1 year ago

when enable_hr is true i get

here is my var payload

            var payload = new JObject
            {
                { "prompt", imgPrompt },
                { "negative_prompt", imgNegPrompt},
                { "steps", 45 },
                { "width", width },
                { "height", height },
                { "send_images", true },
                { "sampler_name", "Euler" }, // DDIM set this to "DPM++ 2M SDE Karras" if you want slightly higher quality images, but slower image generation
                { "override_settings", overrideSettings },
                { "enable_hr", true },
                { "hr_second_pass_steps", 40 },
                { "hr_scale", 1.7 }
            };
DeSinc commented 1 year ago

you need a few more options, here use mine, this works fine on my end:


            var payload = new JObject
            {
                { "prompt", imgPrompt },
                { "negative_prompt", imgNegPrompt},
                { "steps", 20 },
                { "width", width },
                { "height", height },
                { "send_images", true },
                { "sampler_name", "DPM++ SDE Karras" },
                { "enable_hr", true },
                { "denoising_strength", 0.3 },
                { "hr_scale", 2 },
                { "hr_resize_x", width*2 },
                { "hr_resize_y", height*2 },
                { "hr_upscaler", "R-ESRGAN 4x+ Anime6B" },
                { "hr_second_pass_steps", 5 },
                { "override_settings", overrideSettings }
            };

change back to { "sampler_name", "Euler" } if you have a slow GPU. the results are worse but it's faster.

also, if you're running 45 steps, that's a supreme waste of your time. above 30 does basically nothing, and that's for single rendered image. with HR, you are basically discarding this image you just put 45 steps into and then replacing it with a high res upscale of that image, so anything above 20 is pretty much wasted. the HR step will be where your final image comes from.

20 steps of DPM++ SDE Karras is I find better than any number of steps of euler.

also, the { "hr_second_pass_steps", 40 } - don't put 40 steps, it's not actually 40. it's a multiple of the steps you set with 10 being equal and 40 being 4x more. so 45 steps, with { "hr_second_pass_steps", 40 } means you are rendering 4 x 45 steps I believe. An absolute supreme waste of time and energy. I only use 5 HR steps which is half of your main steps (I think, from what someone told me). give that a try. those above settings give me very high quality outputs.