Spaces:
Running
on
Zero
Running
on
Zero
add zerogpu support
Browse files
app.py
CHANGED
@@ -38,6 +38,7 @@ import torch
|
|
38 |
|
39 |
import gradio as gr
|
40 |
from huggingface_hub import snapshot_download
|
|
|
41 |
|
42 |
from model import StableMultiDiffusionSDXLPipeline
|
43 |
from util import seed_everything
|
@@ -302,6 +303,7 @@ def import_state(state, json_text):
|
|
302 |
|
303 |
### Main worker
|
304 |
|
|
|
305 |
def generate(state, *args, **kwargs):
|
306 |
return models[state.model_id](*args, **kwargs)
|
307 |
|
|
|
38 |
|
39 |
import gradio as gr
|
40 |
from huggingface_hub import snapshot_download
|
41 |
+
import spaces
|
42 |
|
43 |
from model import StableMultiDiffusionSDXLPipeline
|
44 |
from util import seed_everything
|
|
|
303 |
|
304 |
### Main worker
|
305 |
|
306 |
+
@spaces.GPU
|
307 |
def generate(state, *args, **kwargs):
|
308 |
return models[state.model_id](*args, **kwargs)
|
309 |
|