Spaces:
Runtime error
Runtime error
Update app.py
#4
by
HuyRemy
- opened
app.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
import torch
|
| 3 |
-
|
| 4 |
from PIL import Image
|
| 5 |
import numpy as np
|
| 6 |
from io import BytesIO
|
|
@@ -11,7 +11,7 @@ device="cpu"
|
|
| 11 |
pipe = StableDiffusionImg2ImgPipeline.from_pretrained("CompVis/stable-diffusion-v1-4", use_auth_token=st.secrets['USER_TOKEN'])
|
| 12 |
pipe.to(device)
|
| 13 |
|
| 14 |
-
def resize(w_val,
|
| 15 |
img = Image.open(img)
|
| 16 |
img = img.resize((w_val,l_val), Image.Resampling.LANCZOS)
|
| 17 |
#img = img.resize((value,value), Image.Resampling.LANCZOS)
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import torch
|
| 3 |
+
|
| 4 |
from PIL import Image
|
| 5 |
import numpy as np
|
| 6 |
from io import BytesIO
|
|
|
|
| 11 |
pipe = StableDiffusionImg2ImgPipeline.from_pretrained("CompVis/stable-diffusion-v1-4", use_auth_token=st.secrets['USER_TOKEN'])
|
| 12 |
pipe.to(device)
|
| 13 |
|
| 14 |
+
def resize(w_val,img):
|
| 15 |
img = Image.open(img)
|
| 16 |
img = img.resize((w_val,l_val), Image.Resampling.LANCZOS)
|
| 17 |
#img = img.resize((value,value), Image.Resampling.LANCZOS)
|