AndBobsYourUncle / stable-diffusion-discord-bot

A Discord bot, written in Go, that interfaces with the Automatic 1111's API interface.
MIT License
128 stars 35 forks source link

Nothing happens when changing the upscaler #9

Open konozettoda opened 1 year ago

konozettoda commented 1 year ago

First of all good morning, good afternoon or good evening!

I have a problem when changing the upscale in "queue.go" in Upscaler1: "ESRGAN_4x". I already tried to change to all the other names of upscalers that I have here, but it doesn't seem to have any effect. It seems that even with "ESRGAN_4x" the same does the upscale with the "none" option. How could I fix this!? Sorry for the lay question, but I just downloaded the code and edited it to add more generation size options and ran into this little problem in Upscaler. I will also attach an example trying to use the "4x_fatal_Anime_500000_G" upscaler template, one generated by the site locally and another generated by the bot on discord. sublime_text 9zyZXQrnk6 brave Z5Pk2iXYv2 example

AndBobsYourUncle commented 1 year ago

Hey, good evening!

I'm curious what the API says your possible upscalers are. Could you try going to http://127.0.0.1:7860/docs, and scroll down to this request:

Screenshot 2023-01-31 at 10 23 50 PM

And then click the "Try it out" button and then "Execute".

It should give you a response like this, with all your available upscalers from the SD API:

Screenshot 2023-01-31 at 10 24 25 PM
Terrazocker commented 1 year ago

Hey guys!

Same problem for me changing Upscaler does nothing and even with everything on default the images that get "upscaled" are still 512x512. It looks like to me the images never get upscaled, at least thats what i see when looking into cli.

konozettoda commented 1 year ago

@AndBobsYourUncle Here is the API list:

1 2 3 4


  {
    "name": "None",
    "model_name": null,
    "model_path": "D:\\sdwebui\\models\\None",
    "model_url": null
  },
  {
    "name": "Lanczos",
    "model_name": null,
    "model_path": null,
    "model_url": null
  },
  {
    "name": "Nearest",
    "model_name": null,
    "model_path": null,
    "model_url": null
  },
  {
    "name": "ESRGAN",
    "model_name": "ESRGAN_4x",
    "model_path": "D:\\sdwebui\\models\\ESRGAN",
    "model_url": "https://github.com/cszn/KAIR/releases/download/v1.0/ESRGAN.pth"
  },
  {
    "name": "ESRGAN",
    "model_name": "ESRGAN_4x",
    "model_path": "D:\\sdwebui\\models\\ESRGAN",
    "model_url": "https://github.com/cszn/KAIR/releases/download/v1.0/ESRGAN.pth"
  },
  {
    "name": "ESRGAN",
    "model_name": "ESRGAN_4x",
    "model_path": "D:\\sdwebui\\models\\ESRGAN",
    "model_url": "https://github.com/cszn/KAIR/releases/download/v1.0/ESRGAN.pth"
  },
  {
    "name": "ESRGAN",
    "model_name": "ESRGAN_4x",
    "model_path": "D:\\sdwebui\\models\\ESRGAN",
    "model_url": "https://github.com/cszn/KAIR/releases/download/v1.0/ESRGAN.pth"
  },
  {
    "name": "ESRGAN",
    "model_name": "ESRGAN_4x",
    "model_path": "D:\\sdwebui\\models\\ESRGAN",
    "model_url": "https://github.com/cszn/KAIR/releases/download/v1.0/ESRGAN.pth"
  },
  {
    "name": "ESRGAN",
    "model_name": "ESRGAN_4x",
    "model_path": "D:\\sdwebui\\models\\ESRGAN",
    "model_url": "https://github.com/cszn/KAIR/releases/download/v1.0/ESRGAN.pth"
  },
  {
    "name": "RealESRGAN",
    "model_name": null,
    "model_path": "D:\\sdwebui\\models\\RealESRGAN",
    "model_url": null
  },
  {
    "name": "RealESRGAN",
    "model_name": null,
    "model_path": "D:\\sdwebui\\models\\RealESRGAN",
    "model_url": null
  },
  {
    "name": "LDSR",
    "model_name": null,
    "model_path": "D:\\sdwebui\\models\\LDSR",
    "model_url": "https://heibox.uni-heidelberg.de/f/578df07c8fc04ffbadf3/?dl=1"
  },
  {
    "name": "ScuNET",
    "model_name": "ScuNET GAN",
    "model_path": "D:\\sdwebui\\models\\ScuNET",
    "model_url": "https://github.com/cszn/KAIR/releases/download/v1.0/scunet_color_real_gan.pth"
  },
  {
    "name": "ScuNET",
    "model_name": "ScuNET GAN",
    "model_path": "D:\\sdwebui\\models\\ScuNET",
    "model_url": "https://github.com/cszn/KAIR/releases/download/v1.0/scunet_color_real_gan.pth"
  },
  {
    "name": "SwinIR",
    "model_name": "SwinIR 4x",
    "model_path": "D:\\sdwebui\\models\\SwinIR",
    "model_url": "https://github.com/JingyunLiang/SwinIR/releases/download/v0.0/003_realSR_BSRGAN_DFOWMFC_s64w8_SwinIR-L_x4_GAN.pth "
  }
] ```
konozettoda commented 1 year ago

I saw on the Automatic1111 page that there was an update, I installed it and the names of the upscalers models started to appear. However, it now has a new option called "scale" along with it. Causing "UpscalingResize" to not be read correctly.


  {
    "name": "None",
    "model_name": null,
    "model_path": null,
    "model_url": null,
    "scale": 4
  },
  {
    "name": "Lanczos",
    "model_name": null,
    "model_path": null,
    "model_url": null,
    "scale": 4
  },
  {
    "name": "Nearest",
    "model_name": null,
    "model_path": null,
    "model_url": null,
    "scale": 4
  },
  {
    "name": "4x-AnimeSharp",
    "model_name": "ESRGAN_4x",
    "model_path": "D:\\sdwebui\\models\\ESRGAN\\4x-AnimeSharp.pth",
    "model_url": null,
    "scale": 4
  },
  {
    "name": "4x_FatalPixels_340000_G",
    "model_name": "ESRGAN_4x",
    "model_path": "D:\\sdwebui\\models\\ESRGAN\\4x_FatalPixels_340000_G.pth",
    "model_url": null,
    "scale": 4
  },
  {
    "name": "4x_fatal_Anime_500000_G",
    "model_name": "ESRGAN_4x",
    "model_path": "D:\\sdwebui\\models\\ESRGAN\\4x_fatal_Anime_500000_G.pth",
    "model_url": null,
    "scale": 4
  },
  {
    "name": "4x_NMKD-Siax_200k",
    "model_name": "ESRGAN_4x",
    "model_path": "D:\\sdwebui\\models\\ESRGAN\\4x_NMKD-Siax_200k.pth",
    "model_url": null,
    "scale": 4
  },
  {
    "name": "4x_NMKD-YandereNeoXL_200k",
    "model_name": "ESRGAN_4x",
    "model_path": "D:\\sdwebui\\models\\ESRGAN\\4x_NMKD-YandereNeoXL_200k.pth",
    "model_url": null,
    "scale": 4
  },
  {
    "name": "ESRGAN_4x",
    "model_name": "ESRGAN_4x",
    "model_path": "D:\\sdwebui\\models\\ESRGAN\\ESRGAN_4x.pth",
    "model_url": null,
    "scale": 4
  },
  {
    "name": "R-ESRGAN General 4xV3",
    "model_name": null,
    "model_path": "https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.5.0/realesr-general-x4v3.pth",
    "model_url": null,
    "scale": 4
  },
  {
    "name": "R-ESRGAN 4x+ Anime6B",
    "model_name": null,
    "model_path": "https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.2.4/RealESRGAN_x4plus_anime_6B.pth",
    "model_url": null,
    "scale": 4
  },
  {
    "name": "LDSR",
    "model_name": null,
    "model_path": null,
    "model_url": null,
    "scale": 4
  },
  {
    "name": "ScuNET",
    "model_name": "ScuNET GAN",
    "model_path": "D:\\sdwebui\\models\\ScuNET\\ScuNET.pth",
    "model_url": null,
    "scale": 4
  },
  {
    "name": "ScuNET PSNR",
    "model_name": "ScuNET GAN",
    "model_path": "https://github.com/cszn/KAIR/releases/download/v1.0/scunet_color_real_psnr.pth",
    "model_url": null,
    "scale": 4
  },
  {
    "name": "SwinIR_4x",
    "model_name": "SwinIR 4x",
    "model_path": "D:\\sdwebui\\models\\SwinIR\\SwinIR_4x.pth",
    "model_url": null,
    "scale": 4
  }
]```
SenatorAcadia commented 1 year ago

I came to see why the backgrounds are being removed from any image that gets upscaled. I am pretty lost. Hopefully someone will figure it out. Thanks for the awesome program!

rustylez commented 1 year ago

I came to see why the backgrounds are being removed from any image that gets upscaled. I am pretty lost. Hopefully someone will figure it out. Thanks for the awesome program!

@SenatorAcadia you need to disable the rembg extension in automatic1111.