Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -1,12 +1,55 @@
|
|
1 |
import gradio as gr
|
2 |
import numpy as np
|
3 |
import random
|
|
|
4 |
|
5 |
import spaces
|
6 |
from diffusers import DiffusionPipeline
|
7 |
import torch
|
8 |
from PIL import Image
|
9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
# Device and model setup
|
11 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
12 |
model_repo_id = "stabilityai/stable-diffusion-3.5-large-turbo"
|
@@ -119,7 +162,7 @@ h1 { text-align: center; }
|
|
119 |
footer { visibility: hidden; }
|
120 |
'''
|
121 |
|
122 |
-
with gr.Blocks(theme=
|
123 |
gr.Markdown("## T2I SD3.5")
|
124 |
|
125 |
with gr.Row():
|
@@ -187,5 +230,4 @@ with gr.Blocks(theme="YTheme/Minecraft", css=css) as demo:
|
|
187 |
)
|
188 |
|
189 |
if __name__ == "__main__":
|
190 |
-
|
191 |
-
demo.launch()
|
|
|
1 |
import gradio as gr
|
2 |
import numpy as np
|
3 |
import random
|
4 |
+
import time
|
5 |
|
6 |
import spaces
|
7 |
from diffusers import DiffusionPipeline
|
8 |
import torch
|
9 |
from PIL import Image
|
10 |
|
11 |
+
from gradio.themes.base import Base
|
12 |
+
from gradio.themes.utils import colors, fonts, sizes
|
13 |
+
from typing import Iterable
|
14 |
+
|
15 |
+
class Seafoam(Base):
|
16 |
+
def __init__(
|
17 |
+
self,
|
18 |
+
*,
|
19 |
+
primary_hue: colors.Color | str = colors.emerald,
|
20 |
+
secondary_hue: colors.Color | str = colors.blue,
|
21 |
+
neutral_hue: colors.Color | str = colors.gray,
|
22 |
+
spacing_size: sizes.Size | str = sizes.spacing_md,
|
23 |
+
radius_size: sizes.Size | str = sizes.radius_md,
|
24 |
+
text_size: sizes.Size | str = sizes.text_lg,
|
25 |
+
font: fonts.Font
|
26 |
+
| str
|
27 |
+
| Iterable[fonts.Font | str] = (
|
28 |
+
fonts.GoogleFont("Quicksand"),
|
29 |
+
"ui-sans-serif",
|
30 |
+
"sans-serif",
|
31 |
+
),
|
32 |
+
font_mono: fonts.Font
|
33 |
+
| str
|
34 |
+
| Iterable[fonts.Font | str] = (
|
35 |
+
fonts.GoogleFont("IBM Plex Mono"),
|
36 |
+
"ui-monospace",
|
37 |
+
"monospace",
|
38 |
+
),
|
39 |
+
):
|
40 |
+
super().__init__(
|
41 |
+
primary_hue=primary_hue,
|
42 |
+
secondary_hue=secondary_hue,
|
43 |
+
neutral_hue=neutral_hue,
|
44 |
+
spacing_size=spacing_size,
|
45 |
+
radius_size=radius_size,
|
46 |
+
text_size=text_size,
|
47 |
+
font=font,
|
48 |
+
font_mono=font_mono,
|
49 |
+
)
|
50 |
+
|
51 |
+
seafoam = Seafoam()
|
52 |
+
|
53 |
# Device and model setup
|
54 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
55 |
model_repo_id = "stabilityai/stable-diffusion-3.5-large-turbo"
|
|
|
162 |
footer { visibility: hidden; }
|
163 |
'''
|
164 |
|
165 |
+
with gr.Blocks(theme=seafoam, css=css) as demo:
|
166 |
gr.Markdown("## T2I SD3.5")
|
167 |
|
168 |
with gr.Row():
|
|
|
230 |
)
|
231 |
|
232 |
if __name__ == "__main__":
|
233 |
+
demo.launch(ssr_mode=False)
|
|