Spaces:
Runtime error
Runtime error
Contrebande Labs
commited on
Commit
·
3bbce21
1
Parent(s):
236f801
app.py cleanup
Browse files
app.py
CHANGED
|
@@ -1,28 +1,36 @@
|
|
| 1 |
import gradio as gr
|
|
|
|
| 2 |
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
description = "This is a demo of the CHARRED character-aware stable diffusion model for you to enjoy at your own leisure, risk and peril"
|
| 6 |
|
| 7 |
def infer_charred(prompt):
|
| 8 |
-
# your inference function for charr stable difusion control
|
| 9 |
return None
|
| 10 |
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
|
|
|
| 14 |
|
| 15 |
with gr.Tab("Journal"):
|
| 16 |
-
gr.Markdown(
|
|
|
|
|
|
|
| 17 |
|
| 18 |
with gr.Tab("☢️ DEMO ☢️"):
|
|
|
|
|
|
|
|
|
|
| 19 |
prompt_input_charr = gr.Textbox(label="Prompt")
|
| 20 |
-
|
| 21 |
-
submit_btn = gr.Button(value
|
| 22 |
-
|
| 23 |
-
submit_btn.click(
|
| 24 |
-
|
| 25 |
-
|
|
|
|
|
|
|
| 26 |
|
| 27 |
|
| 28 |
-
demo.launch()
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
import jax
|
| 3 |
|
| 4 |
+
print(f"JAX devices: {jax.devices()}")
|
| 5 |
+
print(f"JAX device type: {jax.devices()[0].device_kind}")
|
|
|
|
| 6 |
|
| 7 |
def infer_charred(prompt):
|
| 8 |
+
# your inference function for charr stable difusion control
|
| 9 |
return None
|
| 10 |
|
| 11 |
+
|
| 12 |
+
with gr.Blocks(theme="gradio/soft") as demo:
|
| 13 |
+
|
| 14 |
+
gr.Markdown("# Character-Aware Stable Diffusion (CHARRED)")
|
| 15 |
|
| 16 |
with gr.Tab("Journal"):
|
| 17 |
+
gr.Markdown(
|
| 18 |
+
"## On How Four Crazy Fellow Embarked on Training a U-Net from Scratch in Five Days and Almost Died in the End."
|
| 19 |
+
)
|
| 20 |
|
| 21 |
with gr.Tab("☢️ DEMO ☢️"):
|
| 22 |
+
gr.Markdown(
|
| 23 |
+
"## This is a demo of the CHARRED character-aware stable diffusion model for you to enjoy at your own leisure, risk and peril"
|
| 24 |
+
)
|
| 25 |
prompt_input_charr = gr.Textbox(label="Prompt")
|
| 26 |
+
charred_output = gr.Image(label="Output Image")
|
| 27 |
+
submit_btn = gr.Button(value="Submit")
|
| 28 |
+
charred_inputs = [prompt_input_charr]
|
| 29 |
+
submit_btn.click(
|
| 30 |
+
fn=infer_charred, inputs=charred_inputs, outputs=[charred_output]
|
| 31 |
+
)
|
| 32 |
+
# examples = [["postage stamp from california", "low quality", "charr_output.png", "charr_output.png" ]]
|
| 33 |
+
# gr.Examples(fn = infer_sd, inputs = ["text", "text", "image", "image"], examples=examples, cache_examples=True)
|
| 34 |
|
| 35 |
|
| 36 |
+
demo.launch()
|