Update app.py
Browse files
app.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
import torch, random, time
|
| 3 |
-
from diffusers import StableDiffusionPipeline, StableDiffusionImg2ImgPipeline
|
| 4 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 5 |
translations = {
|
| 6 |
'en': {
|
|
@@ -74,7 +74,6 @@ def Loading(model):
|
|
| 74 |
else:
|
| 75 |
text2img = StableDiffusionPipeline.from_pretrained(model, use_safetensors=True).to(device)
|
| 76 |
text2img.safety_checker = None
|
| 77 |
-
text2img.scheduler = EulerDiscreteScheduler.from_config(text2img.scheduler.config)
|
| 78 |
img2img = StableDiffusionImg2ImgPipeline(**text2img.components)
|
| 79 |
return model
|
| 80 |
with gr.Blocks() as demo:
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import torch, random, time
|
| 3 |
+
from diffusers import StableDiffusionPipeline, StableDiffusionImg2ImgPipeline
|
| 4 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 5 |
translations = {
|
| 6 |
'en': {
|
|
|
|
| 74 |
else:
|
| 75 |
text2img = StableDiffusionPipeline.from_pretrained(model, use_safetensors=True).to(device)
|
| 76 |
text2img.safety_checker = None
|
|
|
|
| 77 |
img2img = StableDiffusionImg2ImgPipeline(**text2img.components)
|
| 78 |
return model
|
| 79 |
with gr.Blocks() as demo:
|