Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
import gradio as gr
|
2 |
import numpy as np
|
3 |
import random
|
4 |
-
|
5 |
from diffusers import StableDiffusionPipeline, StableDiffusionImg2ImgPipeline
|
6 |
import torch
|
7 |
|
@@ -22,7 +22,7 @@ else:
|
|
22 |
MAX_SEED = np.iinfo(np.int32).max
|
23 |
MAX_IMAGE_SIZE = 1024
|
24 |
|
25 |
-
|
26 |
def infer_t2i(model, prompt, negative_prompt, seed, randomize_seed, width, height, guidance_scale, num_inference_steps, progress=gr.Progress(track_tqdm=True)):
|
27 |
|
28 |
if randomize_seed:
|
@@ -46,7 +46,7 @@ def infer_t2i(model, prompt, negative_prompt, seed, randomize_seed, width, heigh
|
|
46 |
|
47 |
return image, seed
|
48 |
|
49 |
-
|
50 |
def infer_i2i(model, prompt, image, strength, negative_prompt, seed, randomize_seed, width, height, guidance_scale, num_inference_steps, progress=gr.Progress(track_tqdm=True)):
|
51 |
|
52 |
if randomize_seed:
|
@@ -72,7 +72,7 @@ def infer_i2i(model, prompt, image, strength, negative_prompt, seed, randomize_s
|
|
72 |
|
73 |
return image, seed
|
74 |
|
75 |
-
|
76 |
def infer_ip_adapter(model, prompt, image, scale, negative_prompt, seed, randomize_seed, width, height, guidance_scale, num_inference_steps, progress=gr.Progress(track_tqdm=True)):
|
77 |
|
78 |
if randomize_seed:
|
|
|
1 |
import gradio as gr
|
2 |
import numpy as np
|
3 |
import random
|
4 |
+
import spaces
|
5 |
from diffusers import StableDiffusionPipeline, StableDiffusionImg2ImgPipeline
|
6 |
import torch
|
7 |
|
|
|
22 |
MAX_SEED = np.iinfo(np.int32).max
|
23 |
MAX_IMAGE_SIZE = 1024
|
24 |
|
25 |
+
@spaces.GPU
|
26 |
def infer_t2i(model, prompt, negative_prompt, seed, randomize_seed, width, height, guidance_scale, num_inference_steps, progress=gr.Progress(track_tqdm=True)):
|
27 |
|
28 |
if randomize_seed:
|
|
|
46 |
|
47 |
return image, seed
|
48 |
|
49 |
+
@spaces.GPU
|
50 |
def infer_i2i(model, prompt, image, strength, negative_prompt, seed, randomize_seed, width, height, guidance_scale, num_inference_steps, progress=gr.Progress(track_tqdm=True)):
|
51 |
|
52 |
if randomize_seed:
|
|
|
72 |
|
73 |
return image, seed
|
74 |
|
75 |
+
@spaces.GPU
|
76 |
def infer_ip_adapter(model, prompt, image, scale, negative_prompt, seed, randomize_seed, width, height, guidance_scale, num_inference_steps, progress=gr.Progress(track_tqdm=True)):
|
77 |
|
78 |
if randomize_seed:
|