Spaces:
Runtime error
Runtime error
Commit
·
9f23c08
1
Parent(s):
2b2d98d
Upload folder using huggingface_hub
Browse files- .ipynb_checkpoints/app-checkpoint.py +5 -5
- .ipynb_checkpoints/constants-checkpoint.py +1 -1
- app.py +5 -5
- constants.py +1 -1
.ipynb_checkpoints/app-checkpoint.py
CHANGED
@@ -25,7 +25,7 @@ magic_model.decoder.compile(jit_compile=True)
|
|
25 |
magic_model.text_encoder.compile(jit_compile=True)
|
26 |
|
27 |
# Warm-up the model
|
28 |
-
_ = magic_model.text_to_image("flying dragons", batch_size=num_images_to_gen)
|
29 |
|
30 |
def generate_image_fn(prompt: str, steps: int) -> list:
|
31 |
start_time = time.time()
|
@@ -43,7 +43,7 @@ def generate_image_fn(prompt: str, steps: int) -> list:
|
|
43 |
return [image for image in images]
|
44 |
|
45 |
|
46 |
-
description = "This Space demonstrates a fine-tuned Stable Diffusion model. You can use it for generating custom Magic the Gathering cards. To get started, either enter a prompt or pick one from the examples below. For details on the fine-tuning procedure, refer to [this
|
47 |
article = "We use mixed-precision and XLA to speed up the inference latency."
|
48 |
gr.Interface(
|
49 |
generate_image_fn,
|
@@ -53,12 +53,12 @@ gr.Interface(
|
|
53 |
max_lines=1,
|
54 |
placeholder="Jedi",
|
55 |
),
|
56 |
-
gr.Slider(value=
|
57 |
],
|
58 |
-
outputs=gr.Gallery().style(
|
59 |
title="Generate custom magic the gathering cards",
|
60 |
description=description,
|
61 |
article=article,
|
62 |
-
examples=[["Yoda",
|
63 |
allow_flagging=False,
|
64 |
).launch(enable_queue=True)
|
|
|
25 |
magic_model.text_encoder.compile(jit_compile=True)
|
26 |
|
27 |
# Warm-up the model
|
28 |
+
_ = magic_model.text_to_image("flying dragons", batch_size=num_images_to_gen, num_steps=15)
|
29 |
|
30 |
def generate_image_fn(prompt: str, steps: int) -> list:
|
31 |
start_time = time.time()
|
|
|
43 |
return [image for image in images]
|
44 |
|
45 |
|
46 |
+
description = "This Space demonstrates a fine-tuned Stable Diffusion model. You can use it for generating custom Magic the Gathering cards. To get started, either enter a prompt or pick one from the examples below. For details on the fine-tuning procedure, refer to [this tutorial](https://gpuopen.com/)."
|
47 |
article = "We use mixed-precision and XLA to speed up the inference latency."
|
48 |
gr.Interface(
|
49 |
generate_image_fn,
|
|
|
53 |
max_lines=1,
|
54 |
placeholder="Jedi",
|
55 |
),
|
56 |
+
gr.Slider(value=30, minimum=10, maximum=100, step=1),
|
57 |
],
|
58 |
+
outputs=gr.Gallery().style(height="auto"),
|
59 |
title="Generate custom magic the gathering cards",
|
60 |
description=description,
|
61 |
article=article,
|
62 |
+
examples=[["Yoda", 30], ["Lisa Su", 30]],
|
63 |
allow_flagging=False,
|
64 |
).launch(enable_queue=True)
|
.ipynb_checkpoints/constants-checkpoint.py
CHANGED
@@ -122,7 +122,7 @@ css = """
|
|
122 |
.image_duplication{position: absolute; width: 100px; left: 50px}
|
123 |
"""
|
124 |
|
125 |
-
num_images_to_gen =
|
126 |
unconditional_guidance_scale = 30
|
127 |
img_height = 512
|
128 |
img_width = 512
|
|
|
122 |
.image_duplication{position: absolute; width: 100px; left: 50px}
|
123 |
"""
|
124 |
|
125 |
+
num_images_to_gen = 1
|
126 |
unconditional_guidance_scale = 30
|
127 |
img_height = 512
|
128 |
img_width = 512
|
app.py
CHANGED
@@ -25,7 +25,7 @@ magic_model.decoder.compile(jit_compile=True)
|
|
25 |
magic_model.text_encoder.compile(jit_compile=True)
|
26 |
|
27 |
# Warm-up the model
|
28 |
-
_ = magic_model.text_to_image("flying dragons", batch_size=num_images_to_gen)
|
29 |
|
30 |
def generate_image_fn(prompt: str, steps: int) -> list:
|
31 |
start_time = time.time()
|
@@ -43,7 +43,7 @@ def generate_image_fn(prompt: str, steps: int) -> list:
|
|
43 |
return [image for image in images]
|
44 |
|
45 |
|
46 |
-
description = "This Space demonstrates a fine-tuned Stable Diffusion model. You can use it for generating custom Magic the Gathering cards. To get started, either enter a prompt or pick one from the examples below. For details on the fine-tuning procedure, refer to [this
|
47 |
article = "We use mixed-precision and XLA to speed up the inference latency."
|
48 |
gr.Interface(
|
49 |
generate_image_fn,
|
@@ -53,12 +53,12 @@ gr.Interface(
|
|
53 |
max_lines=1,
|
54 |
placeholder="Jedi",
|
55 |
),
|
56 |
-
gr.Slider(value=
|
57 |
],
|
58 |
-
outputs=gr.Gallery().style(
|
59 |
title="Generate custom magic the gathering cards",
|
60 |
description=description,
|
61 |
article=article,
|
62 |
-
examples=[["Yoda",
|
63 |
allow_flagging=False,
|
64 |
).launch(enable_queue=True)
|
|
|
25 |
magic_model.text_encoder.compile(jit_compile=True)
|
26 |
|
27 |
# Warm-up the model
|
28 |
+
_ = magic_model.text_to_image("flying dragons", batch_size=num_images_to_gen, num_steps=15)
|
29 |
|
30 |
def generate_image_fn(prompt: str, steps: int) -> list:
|
31 |
start_time = time.time()
|
|
|
43 |
return [image for image in images]
|
44 |
|
45 |
|
46 |
+
description = "This Space demonstrates a fine-tuned Stable Diffusion model. You can use it for generating custom Magic the Gathering cards. To get started, either enter a prompt or pick one from the examples below. For details on the fine-tuning procedure, refer to [this tutorial](https://gpuopen.com/)."
|
47 |
article = "We use mixed-precision and XLA to speed up the inference latency."
|
48 |
gr.Interface(
|
49 |
generate_image_fn,
|
|
|
53 |
max_lines=1,
|
54 |
placeholder="Jedi",
|
55 |
),
|
56 |
+
gr.Slider(value=30, minimum=10, maximum=100, step=1),
|
57 |
],
|
58 |
+
outputs=gr.Gallery().style(height="auto"),
|
59 |
title="Generate custom magic the gathering cards",
|
60 |
description=description,
|
61 |
article=article,
|
62 |
+
examples=[["Yoda", 30], ["Lisa Su", 30]],
|
63 |
allow_flagging=False,
|
64 |
).launch(enable_queue=True)
|
constants.py
CHANGED
@@ -122,7 +122,7 @@ css = """
|
|
122 |
.image_duplication{position: absolute; width: 100px; left: 50px}
|
123 |
"""
|
124 |
|
125 |
-
num_images_to_gen =
|
126 |
unconditional_guidance_scale = 30
|
127 |
img_height = 512
|
128 |
img_width = 512
|
|
|
122 |
.image_duplication{position: absolute; width: 100px; left: 50px}
|
123 |
"""
|
124 |
|
125 |
+
num_images_to_gen = 1
|
126 |
unconditional_guidance_scale = 30
|
127 |
img_height = 512
|
128 |
img_width = 512
|