Spaces:
Runtime error
Runtime error
update diffusers
Browse files- requirements.txt +4 -3
- stablediffusion-infinity/app.py +2 -4
requirements.txt
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
--extra-index-url https://download.pytorch.org/whl/cu113
|
| 2 |
torch
|
| 3 |
huggingface_hub
|
| 4 |
-
diffusers==0.
|
| 5 |
transformers==4.23.1
|
| 6 |
scikit-image==0.19.3
|
| 7 |
Pillow==9.2.0
|
|
@@ -13,5 +13,6 @@ gradio==3.6
|
|
| 13 |
boto3==1.24.93
|
| 14 |
python-magic==0.4.27
|
| 15 |
fastapi-utils==0.2.1
|
| 16 |
-
shortuuid==1.0
|
| 17 |
-
tqdm==4.64
|
|
|
|
|
|
| 1 |
--extra-index-url https://download.pytorch.org/whl/cu113
|
| 2 |
torch
|
| 3 |
huggingface_hub
|
| 4 |
+
diffusers==0.7.0
|
| 5 |
transformers==4.23.1
|
| 6 |
scikit-image==0.19.3
|
| 7 |
Pillow==9.2.0
|
|
|
|
| 13 |
boto3==1.24.93
|
| 14 |
python-magic==0.4.27
|
| 15 |
fastapi-utils==0.2.1
|
| 16 |
+
shortuuid==1.0
|
| 17 |
+
tqdm==4.64
|
| 18 |
+
accelerate==0.13
|
stablediffusion-infinity/app.py
CHANGED
|
@@ -3,7 +3,7 @@ import os
|
|
| 3 |
|
| 4 |
from pathlib import Path
|
| 5 |
import uvicorn
|
| 6 |
-
from fastapi import FastAPI,
|
| 7 |
from fastapi.staticfiles import StaticFiles
|
| 8 |
from fastapi.middleware.cors import CORSMiddleware
|
| 9 |
from fastapi_utils.tasks import repeat_every
|
|
@@ -11,7 +11,7 @@ from fastapi_utils.tasks import repeat_every
|
|
| 11 |
import numpy as np
|
| 12 |
import torch
|
| 13 |
from torch import autocast
|
| 14 |
-
from diffusers import
|
| 15 |
from diffusers.models import AutoencoderKL
|
| 16 |
|
| 17 |
from PIL import Image
|
|
@@ -79,7 +79,6 @@ STATIC_MASK = Image.open("mask.png")
|
|
| 79 |
|
| 80 |
def get_model():
|
| 81 |
if "inpaint" not in model:
|
| 82 |
-
|
| 83 |
vae = AutoencoderKL.from_pretrained(f"stabilityai/sd-vae-ft-ema")
|
| 84 |
inpaint = StableDiffusionInpaintPipeline.from_pretrained(
|
| 85 |
"runwayml/stable-diffusion-inpainting",
|
|
@@ -87,7 +86,6 @@ def get_model():
|
|
| 87 |
torch_dtype=torch.float16,
|
| 88 |
vae=vae,
|
| 89 |
).to("cuda")
|
| 90 |
-
|
| 91 |
# lms = LMSDiscreteScheduler(
|
| 92 |
# beta_start=0.00085, beta_end=0.012, beta_schedule="scaled_linear")
|
| 93 |
|
|
|
|
| 3 |
|
| 4 |
from pathlib import Path
|
| 5 |
import uvicorn
|
| 6 |
+
from fastapi import FastAPI, HTTPException, UploadFile, Depends, status, Request
|
| 7 |
from fastapi.staticfiles import StaticFiles
|
| 8 |
from fastapi.middleware.cors import CORSMiddleware
|
| 9 |
from fastapi_utils.tasks import repeat_every
|
|
|
|
| 11 |
import numpy as np
|
| 12 |
import torch
|
| 13 |
from torch import autocast
|
| 14 |
+
from diffusers import StableDiffusionInpaintPipeline
|
| 15 |
from diffusers.models import AutoencoderKL
|
| 16 |
|
| 17 |
from PIL import Image
|
|
|
|
| 79 |
|
| 80 |
def get_model():
|
| 81 |
if "inpaint" not in model:
|
|
|
|
| 82 |
vae = AutoencoderKL.from_pretrained(f"stabilityai/sd-vae-ft-ema")
|
| 83 |
inpaint = StableDiffusionInpaintPipeline.from_pretrained(
|
| 84 |
"runwayml/stable-diffusion-inpainting",
|
|
|
|
| 86 |
torch_dtype=torch.float16,
|
| 87 |
vae=vae,
|
| 88 |
).to("cuda")
|
|
|
|
| 89 |
# lms = LMSDiscreteScheduler(
|
| 90 |
# beta_start=0.00085, beta_end=0.012, beta_schedule="scaled_linear")
|
| 91 |
|