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

Tiled Upscaler only works in webui but not in API #365

Open
psykokwak-com opened this issue Mar 17, 2024 · 5 comments
Open

Tiled Upscaler only works in webui but not in API #365

psykokwak-com opened this issue Mar 17, 2024 · 5 comments

Comments

@psykokwak-com
Copy link

Hi all,
I'm trying to upscale an image using Tiled diffusion (and tiled VAE). Here are my parameters :
image

As you can see, it works well. The second output image comes from the upscaler.

[Tiled Diffusion] upscaling image with 4x-UltraSharp...
tiled upscale: 100%|████████████████████████████████████████████████████████████████████████████| 9/9 [00:01<00:00,  4.78it/s]

But when I apply the same parameters on the API :

    payload = {
       "init_images": [
        "myimage"
      ],
      "seed": 3073412432,
      "sampler_index": "DPM++ 3M SDE Karras",
      "steps": 6,
      "denoising_strength": 0.35,
      "cfg_scale": 1,
      "prompt": "best quality, highres, <lora:more_details:1.0> <lora:SDXLrender_v2.0:1> <lora:LCM_LoRA_Weights_SD15:1>",
      "negative_prompt": "(worst quality, low quality, normal quality:2)",
      "width": img_output_width,
      "height": img_output_height,
      "alwayson_scripts": {
        "Tiled VAE": {
          "args": [ True,       # enable
                    1024, 96,   # encoder tile size, decoder tile size
                    True,       # vae to gpu
                    True,       # fast decoder
                    True,       # fast encoder
                    False]      # color fix
        },
        "Tiled Diffusion": {
          "args": [ True,                       # enable 
                    "MultiDiffusion",           # method
                    True,                      # override size
                    True,                       # keep input size
                    img_output_width,           # image width
                    img_output_height,          # image height
                    112,                        # tile width
                    144,                        # tile height
                    4,                          # tile overlap
                    8,                          # tile batch size
                    "4x-UltraSharp", # Upscaler name
                    scale] # Scale factor
        },
      }
    }

The upscaler pass returns immediately and the output upscaled image seems to be a simple Lancoz or Nearest upscale...
I tried with different upscaler and they all returns a simple stretched resize.

Did I miss something ?

Thanks for your help

@dy-gdut
Copy link

dy-gdut commented Mar 25, 2024

I have encountered the same problem. Have you resolved it

@dy-gdut
Copy link

dy-gdut commented Mar 25, 2024

my email 1431073686@qq.com
thinks

@joel-galleri5
Copy link

facing the same issue

@aaronjolson
Copy link

Have you tried ONLY using Tiled Diffusion via the API? Does that work for you?
I am able to use Tiled Diffusion via the API using this call as my alwayson_scripts json ( I am using Python )

"alwayson_scripts": {
            "tiled diffusion": {
                "args": [
                    True,  # enable
                    "Mixture of Diffusers",  # method, eg MultiDiffusion
                    True,  # Overwrite image size
                    True,  # Keep input image size
                    1024,  # Image width
                    1024,  # Image height
                    96,  # Latent tile width
                    96,  # Latent tile height
                    48,  # Latent tile overlap
                    2,  # Latent tile batch size
                    "4x-UltraMix_Balanced",  # Upscaler
                    2,  # Scale Factor
                    True,  # Enable Noise Inversion
                    10,  # Inversion steps
                    1,  # Retouch
                    1,  # Renoise strength
                    64,  # Renoise kernel size
                    False,  # Move ControlNet tensor to CPU (if applicable)
                    False,  # Enable Control
                    False,  # Draw full canvas background
                    False,  # Causalize layers
                    False, 0, 0, 0, 0, "", "", "Background", 0, -1,  # region 1
                    False, 0, 0, 0, 0, "", "", "Background", 0, -1,  # region 2
                    False, 0, 0, 0, 0, "", "", "Background", 0, -1,  # region 3
                    False, 0, 0, 0, 0, "", "", "Background", 0, -1,  # region 4
                    False, 0, 0, 0, 0, "", "", "Background", 0, -1,  # region 5
                    False, 0, 0, 0, 0, "", "", "Background", 0, -1,  # region 6
                    False, 0, 0, 0, 0, "", "", "Background", 0, -1,  # region 7
                    False, 0, 0, 0, 0, "", "", "Background", 0, -1,  # region 8
                ]
            }
        }

It eats a ton of my VRAM though ( takes all 24gb of it and locks up my PC). I must be doing something wrong, but it also does that for me in the UI.

I have not tried using the tiled VAE with this though. I would test trying this alone first.

@joel-galleri5
Copy link

joel-galleri5 commented Jul 30, 2024 via email

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

4 participants