Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -9,6 +9,48 @@ import spaces
|
|
| 9 |
import torch
|
| 10 |
from diffusers import StableDiffusionXLPipeline, EulerAncestralDiscreteScheduler
|
| 11 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
css = '''
|
| 13 |
.gradio-container {
|
| 14 |
max-width: 100%;
|
|
@@ -102,7 +144,7 @@ def generate(
|
|
| 102 |
image_paths = [save_image(img) for img in images]
|
| 103 |
return image_paths, seed
|
| 104 |
|
| 105 |
-
with gr.Blocks(theme=
|
| 106 |
gr.Markdown("## STABLE HAMSTER")
|
| 107 |
|
| 108 |
with gr.Row():
|
|
|
|
| 9 |
import torch
|
| 10 |
from diffusers import StableDiffusionXLPipeline, EulerAncestralDiscreteScheduler
|
| 11 |
|
| 12 |
+
from gradio.themes.base import Base
|
| 13 |
+
from gradio.themes.utils import colors, fonts, sizes
|
| 14 |
+
from typing import Iterable
|
| 15 |
+
|
| 16 |
+
class Seafoam(Base):
|
| 17 |
+
def __init__(
|
| 18 |
+
self,
|
| 19 |
+
*,
|
| 20 |
+
primary_hue: colors.Color | str = colors.emerald,
|
| 21 |
+
secondary_hue: colors.Color | str = colors.blue,
|
| 22 |
+
neutral_hue: colors.Color | str = colors.gray,
|
| 23 |
+
spacing_size: sizes.Size | str = sizes.spacing_md,
|
| 24 |
+
radius_size: sizes.Size | str = sizes.radius_md,
|
| 25 |
+
text_size: sizes.Size | str = sizes.text_lg,
|
| 26 |
+
font: fonts.Font
|
| 27 |
+
| str
|
| 28 |
+
| Iterable[fonts.Font | str] = (
|
| 29 |
+
fonts.GoogleFont("Quicksand"),
|
| 30 |
+
"ui-sans-serif",
|
| 31 |
+
"sans-serif",
|
| 32 |
+
),
|
| 33 |
+
font_mono: fonts.Font
|
| 34 |
+
| str
|
| 35 |
+
| Iterable[fonts.Font | str] = (
|
| 36 |
+
fonts.GoogleFont("IBM Plex Mono"),
|
| 37 |
+
"ui-monospace",
|
| 38 |
+
"monospace",
|
| 39 |
+
),
|
| 40 |
+
):
|
| 41 |
+
super().__init__(
|
| 42 |
+
primary_hue=primary_hue,
|
| 43 |
+
secondary_hue=secondary_hue,
|
| 44 |
+
neutral_hue=neutral_hue,
|
| 45 |
+
spacing_size=spacing_size,
|
| 46 |
+
radius_size=radius_size,
|
| 47 |
+
text_size=text_size,
|
| 48 |
+
font=font,
|
| 49 |
+
font_mono=font_mono,
|
| 50 |
+
)
|
| 51 |
+
|
| 52 |
+
seafoam = Seafoam()
|
| 53 |
+
|
| 54 |
css = '''
|
| 55 |
.gradio-container {
|
| 56 |
max-width: 100%;
|
|
|
|
| 144 |
image_paths = [save_image(img) for img in images]
|
| 145 |
return image_paths, seed
|
| 146 |
|
| 147 |
+
with gr.Blocks(theme=seafoam, css=css) as demo:
|
| 148 |
gr.Markdown("## STABLE HAMSTER")
|
| 149 |
|
| 150 |
with gr.Row():
|