Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -1,3 +1,4 @@
|
|
|
|
1 |
import gradio as gr
|
2 |
from diffusers import StableDiffusionImg2ImgPipeline
|
3 |
import torch
|
@@ -12,6 +13,7 @@ device = "cuda" if torch.cuda.is_available() else "cpu"
|
|
12 |
pipe = pipe.to(device)
|
13 |
|
14 |
# Define the inference function
|
|
|
15 |
def ghibli_transform(input_image, prompt="ghibli style", strength=0.75, guidance_scale=7.5, num_steps=50):
|
16 |
if input_image is None:
|
17 |
raise gr.Error("No image uploaded! Please upload an image before clicking Transform.")
|
|
|
1 |
+
import spaces
|
2 |
import gradio as gr
|
3 |
from diffusers import StableDiffusionImg2ImgPipeline
|
4 |
import torch
|
|
|
13 |
pipe = pipe.to(device)
|
14 |
|
15 |
# Define the inference function
|
16 |
+
@spaces.GPU
|
17 |
def ghibli_transform(input_image, prompt="ghibli style", strength=0.75, guidance_scale=7.5, num_steps=50):
|
18 |
if input_image is None:
|
19 |
raise gr.Error("No image uploaded! Please upload an image before clicking Transform.")
|