Spaces:
Running
on
Zero
Running
on
Zero
feat: 使用GPU
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 DiffusionPipeline
|
6 |
import torch
|
7 |
|
@@ -19,7 +19,7 @@ pipe = pipe.to(device)
|
|
19 |
MAX_SEED = np.iinfo(np.int32).max
|
20 |
MAX_IMAGE_SIZE = 1024
|
21 |
|
22 |
-
|
23 |
def infer(prompt, negative_prompt, seed, randomize_seed, width, height, guidance_scale, num_inference_steps, progress=gr.Progress(track_tqdm=True)):
|
24 |
|
25 |
if randomize_seed:
|
|
|
1 |
import gradio as gr
|
2 |
import numpy as np
|
3 |
import random
|
4 |
+
import spaces #[uncomment to use ZeroGPU]
|
5 |
from diffusers import DiffusionPipeline
|
6 |
import torch
|
7 |
|
|
|
19 |
MAX_SEED = np.iinfo(np.int32).max
|
20 |
MAX_IMAGE_SIZE = 1024
|
21 |
|
22 |
+
@spaces.GPU #[uncomment to use ZeroGPU]
|
23 |
def infer(prompt, negative_prompt, seed, randomize_seed, width, height, guidance_scale, num_inference_steps, progress=gr.Progress(track_tqdm=True)):
|
24 |
|
25 |
if randomize_seed:
|