Mikubill / sd-webui-controlnet

WebUI extension for ControlNet
GNU General Public License v3.0
17.02k stars 1.96k forks source link

[Bug]: ControlNet tile not working when upscaling in img2img with ultimate upscale #1724

Closed Pashahlis closed 1 year ago

Pashahlis commented 1 year ago

Is there an existing issue for this?

What happened?

When I try upscaling an image from 1024 to 2048 using controlnet tile and ultimate upscale, it doesnt work correctly. the image comes out smoothed and the log also shows wrong preprocessor params:

preprocessor params: (-1, 1, -1)"

Steps to reproduce the problem

i tried upscaling an image in img2img using the following params:

full-length highly detailed and photorealistic intricate digital art in 4K high quality trending on Artstation and CGSociety of woman with pointed ears with ((feathered wings)) wearing dress sitting at pond in forest clearing dipping her feet into water, wallpaper, octane render, by Jeremy Mann, Greg Manchess, Greg Rutkowski, Atey Ghailan, Thomas Cole, dramatic, epic, photo, movie still, cinematic, professional Negative prompt: anime, cartoon, sketch, instagram, pastel, dada, zombie, ugly, surreal, text, watermark, abstract, old, fat, jpeg, black and white, vintage, amateur, film grain, evil, damaged, concept, unfinished, model, cover, clay, figure, toy, pixelated, bad, inexperienced, illogical, random, oversaturated, overexposed, rough, fake, unrealistic, sloppy, artificial, low budget, unprofessional, cropped, out of frame, low-quality, poorly drawn, deformed, bad proportions, malformed, imperfect, unnatural, extra, rushed, weird Steps: 35, Sampler: DPM++ 2M Karras, CFG scale: 7, Seed: 2919237412, Size: 2048x2048, Model hash: b4391b7978, Model: Foreign models_deliberate_v2, Denoising strength: 0.3, RNG: CPU, Ultimate SD upscale upscaler: R-ESRGAN 4x+, Ultimate SD upscale tile_width: 512, Ultimate SD upscale tile_height: 512, Ultimate SD upscale mask_blur: 8, Ultimate SD upscale padding: 32, ControlNet 0: "preprocessor: tile_resample, model: control_v11f1e_sd15_tile [a371b31b], weight: 1, starting/ending: (0, 1), resize mode: Crop and Resize, pixel perfect: False, control mode: ControlNet is more important, preprocessor params: (-1, 1, -1)"

the result can be seen below. it looks bad and smoothed.

00037-2919237412

What should have happened?

the image should come out like this (done by someone else with i assume an older version of A1111 and controlnet?)

00657-3585415680 0-full-length_highly_detailed_and_photorealistic_intricate_digital_art_in_4K_high_quality_trending_on_Artstation_and_CGSociety_of

his generation params were:

Prompt: full-length highly detailed and photorealistic intricate digital art in 4K high quality trending on Artstation and CGSociety of woman with pointed ears with ((feathered wings)) wearing dress sitting at pond in forest clearing dipping her feet into water, wallpaper, octane render, by Jeremy Mann, Greg Manchess, Greg Rutkowski, Atey Ghailan, Thomas Cole, dramatic, epic, photo, movie still, cinematic, professional Negative prompt: anime, cartoon, sketch, instagram, pastel, dada, zombie, ugly, surreal, text, watermark, abstract, old, fat, jpeg, black and white, vintage, amateur, film grain, evil, damaged, concept, unfinished, model, cover, clay, figure, toy, pixelated, bad, inexperienced, illogical, random, oversaturated, overexposed, rough, fake, unrealistic, sloppy, artificial, low budget, unprofessional, cropped, out of frame, low-quality, poorly drawn, deformed, bad proportions, malformed, imperfect, unnatural, extra, rushed, weird Steps: 50 | Sampler: DPM++ 2M Karras | CFG scale: 10 | Seed: 3585415680 | Size: 2048x2048 | Model hash: d8691b4d16 | Model: Deliberate_v11 | VAE: vae-ft-mse-840000-ema-pruned | Denoising strength: 0.35 | Clip skip: 1 | Version: 5190f70 | Parser: Full parser | Ultimate SD upscale upscaler: 4x_foolhardy_Remacri | Ultimate SD upscale tile_width: 512 | Ultimate SD upscale tile_height: 512 | Ultimate SD upscale mask_blur: 8 | Ultimate SD upscale padding: 32 | ControlNet: "preprocessor: tile_resample | model: control_v11f1e_sd15_tile [a371b31b] | weight: 1 | starting/ending: (0 | 1) | resize mode: Crop and Resize | pixel perfect: False | control mode: ControlNet is more important | preprocessor params: (512 | 1 | 64)"

notice the difference in preprocessor params at the very end

Commit where the problem happens

webui: for some weird reason it says

Version: Commit hash:

but it should be https://github.com/AUTOMATIC1111/stable-diffusion-webui/commit/394ffa7b0a7fff3ec484bcd084e673a8b301ccc8 (v1.4.0)

controlnet: 8e143d35

What browsers do you use to access the UI ?

Microsoft Edge

Command Line Arguments

Launching Web UI with arguments: --xformers --force-enable-xformers --medvram

List of enabled extensions

image

Console logs

https://pastebin.com/8TiVTzV3

Additional information

No response

huchenlei commented 1 year ago

Following are the preprocessor params for various tile preprocessors:

"tile_resample": [
        None,
        {
            "name": "Down Sampling Rate",
            "value": 1.0,
            "min": 1.0,
            "max": 8.0,
            "step": 0.01
        }
    ],
    "tile_colorfix": [
        None,
        {
            "name": "Variation",
            "value": 8.0,
            "min": 3.0,
            "max": 32.0,
            "step": 1.0
        }
    ],
    "tile_colorfix+sharp": [
        None,
        {
            "name": "Variation",
            "value": 8.0,
            "min": 3.0,
            "max": 32.0,
            "step": 1.0
        },
        {
            "name": "Sharpness",
            "value": 1.0,
            "min": 0.0,
            "max": 2.0,
            "step": 0.01
        }
    ],

So when you are using tile resample, only the middle parameter matters. The first and third param will be ignored by the preprocessor.

Pashahlis commented 1 year ago

I still dont understand then why my results are so much different and worse than the other guys'?

I just now comp 00005-2559832919 letely reinstalled A1111, its now correctly showing ## 1.4.0, and the result is improved now compared to my earlier installation, but still it doesnt look as good as his output.

This is using 1 to 1 his parameters including Deliberate (although v2, but it shouldnt make a huge difference, as even Deliberates results are very similar to my models results)