Stable Diffusion Upscale
from auto1111sdk import StableDiffusionPipeline, EsrganPipeline
upscaler = EsrganPipeline("<PATH TO YOUR LOCAL PTH WEIGHTS FILE>")
pipe = StableDiffusionPipeline("<PATH TO YOUR LOCAL MODEL SAFETENSORS FILE>")from PIL import Image
image = Image.open("init.png")output = pipe.sd_upscale_img2img(upscaler=upscaler, prompt=prompt, negative_prompt=negative_prompt, init_images=image)Parameters
init_image: a PIL Image object
prompt: str
negative_prompt: str = ''
seed: int = -1
steps: int = 20
cfg_scale: float = 7.5
num_images: int = 1
sampler_name: str = "Euler"
denoising_strength: float = 0.75
scale_factor: int = 2 # the scale by which you want to upscale your image by
overlap: int = 64
upscaler # Should be either an instance of EsrganPipeline or RealEsrganPipelineLast updated