Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -6,7 +6,7 @@ import random
|
|
| 6 |
import torch
|
| 7 |
import spaces
|
| 8 |
|
| 9 |
-
from diffusers import
|
| 10 |
from PIL import Image, ImageFilter, ImageEnhance
|
| 11 |
import PIL.ImageOps
|
| 12 |
from diffusers.pipelines.stable_diffusion import safety_checker
|
|
@@ -24,10 +24,9 @@ else:
|
|
| 24 |
device = "cpu"
|
| 25 |
floatType = torch.float32
|
| 26 |
variant = None
|
| 27 |
-
pipe, params = FlaxStableDiffusionInpaintPipeline.from_pretrained("xvjiarui/stable-diffusion-2-inpainting", torch_dtype = floatType, variant = variant, safety_checker=None)
|
| 28 |
|
| 29 |
-
|
| 30 |
-
|
| 31 |
|
| 32 |
def update_seed(is_randomize_seed, seed):
|
| 33 |
if is_randomize_seed:
|
|
@@ -221,8 +220,9 @@ def inpaint_on_gpu(
|
|
| 221 |
strength,
|
| 222 |
denoising_steps
|
| 223 |
):
|
|
|
|
| 224 |
return pipe(
|
| 225 |
-
|
| 226 |
width = process_width,
|
| 227 |
height = process_height,
|
| 228 |
prompt = prompt,
|
|
|
|
| 6 |
import torch
|
| 7 |
import spaces
|
| 8 |
|
| 9 |
+
from diffusers import StableDiffusionXLInpaintPipeline
|
| 10 |
from PIL import Image, ImageFilter, ImageEnhance
|
| 11 |
import PIL.ImageOps
|
| 12 |
from diffusers.pipelines.stable_diffusion import safety_checker
|
|
|
|
| 24 |
device = "cpu"
|
| 25 |
floatType = torch.float32
|
| 26 |
variant = None
|
|
|
|
| 27 |
|
| 28 |
+
pipe = StableDiffusionXLInpaintPipeline.from_pretrained("diffusers/stable-diffusion-xl-1.0-inpainting-0.1", torch_dtype = floatType, variant = variant)
|
| 29 |
+
pipe = pipe.to(device)
|
| 30 |
|
| 31 |
def update_seed(is_randomize_seed, seed):
|
| 32 |
if is_randomize_seed:
|
|
|
|
| 220 |
strength,
|
| 221 |
denoising_steps
|
| 222 |
):
|
| 223 |
+
|
| 224 |
return pipe(
|
| 225 |
+
seeds = [seed],
|
| 226 |
width = process_width,
|
| 227 |
height = process_height,
|
| 228 |
prompt = prompt,
|