Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -6,12 +6,11 @@ import gradio as gr
|
|
| 6 |
import numpy as np
|
| 7 |
import torch
|
| 8 |
from PIL import Image
|
| 9 |
-
from diffusers import DiffusionPipeline, StableDiffusionXLPipeline, EulerAncestralDiscreteScheduler,
|
| 10 |
from custom_pipeline import CosStableDiffusionXLInstructPix2PixPipeline
|
| 11 |
from huggingface_hub import hf_hub_download
|
| 12 |
from huggingface_hub import InferenceClient
|
| 13 |
|
| 14 |
-
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 15 |
dtype = torch.float16
|
| 16 |
vae = AutoencoderKL.from_pretrained("madebyollin/sdxl-vae-fp16-fix", torch_dtype=torch.float16)
|
| 17 |
|
|
@@ -34,8 +33,7 @@ To optimize image results:
|
|
| 34 |
"""
|
| 35 |
|
| 36 |
# Image Editor
|
| 37 |
-
pipe_edit =
|
| 38 |
-
|
| 39 |
|
| 40 |
# Generator
|
| 41 |
@spaces.GPU(duration=30, queue=False)
|
|
|
|
| 6 |
import numpy as np
|
| 7 |
import torch
|
| 8 |
from PIL import Image
|
| 9 |
+
from diffusers import DiffusionPipeline, StableDiffusionXLPipeline, EulerAncestralDiscreteScheduler, StableDiffusionInstructPix2PixPipeline, AutoencoderKL
|
| 10 |
from custom_pipeline import CosStableDiffusionXLInstructPix2PixPipeline
|
| 11 |
from huggingface_hub import hf_hub_download
|
| 12 |
from huggingface_hub import InferenceClient
|
| 13 |
|
|
|
|
| 14 |
dtype = torch.float16
|
| 15 |
vae = AutoencoderKL.from_pretrained("madebyollin/sdxl-vae-fp16-fix", torch_dtype=torch.float16)
|
| 16 |
|
|
|
|
| 33 |
"""
|
| 34 |
|
| 35 |
# Image Editor
|
| 36 |
+
pipe_edit = StableDiffusionInstructPix2PixPipeline.from_pretrained( "vinesmsuic/magicbrush-jul7", torch_dtype=torch.float16 ).to("cuda")
|
|
|
|
| 37 |
|
| 38 |
# Generator
|
| 39 |
@spaces.GPU(duration=30, queue=False)
|