Spaces:
Running
on
Zero
Running
on
Zero
Add space
Browse files- gradio_app.py +3 -1
- requirements.txt +2 -1
gradio_app.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
from __future__ import annotations
|
2 |
|
3 |
import gradio as gr
|
|
|
4 |
from PIL import Image
|
5 |
import torch
|
6 |
|
@@ -22,12 +23,13 @@ scheduler_type = Scheduler_Type.EULER
|
|
22 |
image_size = model_type_to_size(Model_Type.SDXL_Turbo)
|
23 |
pipe_inversion, pipe_inference = get_pipes(model_type, scheduler_type, device=device)
|
24 |
|
25 |
-
cache_size =
|
26 |
prev_configs = [None for i in range(cache_size)]
|
27 |
prev_inv_latents = [None for i in range(cache_size)]
|
28 |
prev_images = [None for i in range(cache_size)]
|
29 |
prev_noises = [None for i in range(cache_size)]
|
30 |
|
|
|
31 |
def main_pipeline(
|
32 |
input_image: str,
|
33 |
src_prompt: str,
|
|
|
1 |
from __future__ import annotations
|
2 |
|
3 |
import gradio as gr
|
4 |
+
import spaces
|
5 |
from PIL import Image
|
6 |
import torch
|
7 |
|
|
|
23 |
image_size = model_type_to_size(Model_Type.SDXL_Turbo)
|
24 |
pipe_inversion, pipe_inference = get_pipes(model_type, scheduler_type, device=device)
|
25 |
|
26 |
+
cache_size = 25
|
27 |
prev_configs = [None for i in range(cache_size)]
|
28 |
prev_inv_latents = [None for i in range(cache_size)]
|
29 |
prev_images = [None for i in range(cache_size)]
|
30 |
prev_noises = [None for i in range(cache_size)]
|
31 |
|
32 |
+
@spaces.GPU
|
33 |
def main_pipeline(
|
34 |
input_image: str,
|
35 |
src_prompt: str,
|
requirements.txt
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
gradio
|
2 |
-
|
|
|
3 |
torchvision==0.17.1
|
4 |
diffusers==0.24.0
|
5 |
transformers==4.32.1
|
|
|
1 |
gradio
|
2 |
+
spaces
|
3 |
+
torch==2.2.0
|
4 |
torchvision==0.17.1
|
5 |
diffusers==0.24.0
|
6 |
transformers==4.32.1
|