diffusers icon indicating copy to clipboard operation
diffusers copied to clipboard

Diffusers Stable Diffusion upscale pipeline

Open UglyStupidHonest opened this issue 2 years ago • 2 comments

Describe the bug

I get this message when I try to upscale a image

(/tmp/pip-install-r2dsw42o/xformers_584b8336664f4e63bb32e09d7dcaeac6/third_party/flash-attention/csrc/flash_attn/src/fmha_fprop_fp16_kernel.sm80.cu:68): invalid argument

I can't find the culprit unfortunately, thank you!!

Reproduction

No response

Logs

CUDA error (/tmp/pip-install-r2dsw42o/xformers_584b8336664f4e63bb32e09d7dcaeac6/third_party/flash-attention/csrc/flash_attn/src/fmha_fprop_fp16_kernel.sm80.cu:68): invalid argument

System Info

diffusers 0.9.0 Ubuntu 20.4 LTS

UglyStupidHonest avatar Nov 30 '22 09:11 UglyStupidHonest

Hey @UglyStupidHonest,

Could you please add a reproducible code snippet?

patrickvonplaten avatar Nov 30 '22 10:11 patrickvonplaten

Hey sure its pretty much the example for that model

from diffusers import StableDiffusionPipeline, DDIMScheduler , EulerDiscreteScheduler,KarrasVeScheduler from diffusers import StableDiffusionUpscalePipeline import torch import os from realesrgan import RealESRGANer import random import requests from PIL import Image from io import BytesIO

import requests from PIL import Image from io import BytesIO from diffusers import StableDiffusionUpscalePipeline import torch

load model and scheduler

model_id = "stabilityai/stable-diffusion-x4-upscaler" pipeline = StableDiffusionUpscalePipeline.from_pretrained(model_id, revision="fp16", torch_dtype=torch.float16,cache_dir="/media/chris/Elements/hfcache/huggingface/diffusers") pipeline = pipeline.to("cuda")

let's download an image

url = "https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/sd2-upscale/low_res_cat.png" response = requests.get(url) low_res_img = Image.open(BytesIO(response.content)).convert("RGB") low_res_img = low_res_img.resize((128, 128))

prompt = "a white cat"

upscaled_image = pipeline(prompt=prompt, image=low_res_img).images[0] upscaled_image.save("upsampled_cat.png")

UglyStupidHonest avatar Nov 30 '22 11:11 UglyStupidHonest

Hey I solved it it was probably a faulty xformers install :)

UglyStupidHonest avatar Dec 01 '22 14:12 UglyStupidHonest