Alexander Bagus
commited on
Commit
·
356ed08
1
Parent(s):
ef36217
22
Browse files- app.py +3 -8
- static/data.json +6 -0
- static/header.html +1 -1
app.py
CHANGED
|
@@ -1,10 +1,8 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
import numpy as np
|
| 3 |
-
import random
|
| 4 |
-
import spaces
|
| 5 |
from diffusers import DiffusionPipeline
|
| 6 |
from diffusers import AutoencoderKL, FlowMatchEulerDiscreteScheduler
|
| 7 |
-
import torch
|
| 8 |
|
| 9 |
MODEL_REPO = "Tongyi-MAI/Z-Image-Turbo"
|
| 10 |
MAX_SEED = np.iinfo(np.int32).max
|
|
@@ -71,11 +69,8 @@ css = """
|
|
| 71 |
}
|
| 72 |
"""
|
| 73 |
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
"An astronaut riding a green horse",
|
| 77 |
-
"A delicious ceviche cheesecake slice",
|
| 78 |
-
]
|
| 79 |
|
| 80 |
with gr.Blocks() as demo:
|
| 81 |
with gr.Column():
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import numpy as np
|
| 3 |
+
import random, json, spaces, torch
|
|
|
|
| 4 |
from diffusers import DiffusionPipeline
|
| 5 |
from diffusers import AutoencoderKL, FlowMatchEulerDiscreteScheduler
|
|
|
|
| 6 |
|
| 7 |
MODEL_REPO = "Tongyi-MAI/Z-Image-Turbo"
|
| 8 |
MAX_SEED = np.iinfo(np.int32).max
|
|
|
|
| 69 |
}
|
| 70 |
"""
|
| 71 |
|
| 72 |
+
data = json.load(read_file("static/data.json"))
|
| 73 |
+
examples = data['examples']
|
|
|
|
|
|
|
|
|
|
| 74 |
|
| 75 |
with gr.Blocks() as demo:
|
| 76 |
with gr.Column():
|
static/data.json
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"examples": [
|
| 3 |
+
"A dramatic, cinematic japanese-action scene in a edo era Kyoto city. A woman named Harley Quinn from the movie 'Birds of Prey' in colorful, punk-inspired comic-villain attire walks confidently while holding the arm of a serious-looking man named John Wick played by Keanu Reeves from the fantastic film John Wick 2 in a black suit, her t-shirt says 'Birds of Prey', the characters are capture in a postcard held by a hand in front of a beautiful realistic city at sunset and there is cursive writing that says 'ZImage, Now in HuggingFace'"
|
| 4 |
+
]
|
| 5 |
+
|
| 6 |
+
}
|
static/header.html
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
<div style="text-align: center; max-width: 600px; margin: 0 auto;">
|
| 2 |
<h1>
|
| 3 |
-
Z Image Turbo: Fast & Versatile Image Generation
|
| 4 |
</h1>
|
| 5 |
<div class="grid-container" >
|
| 6 |
<p>
|
|
|
|
| 1 |
<div style="text-align: center; max-width: 600px; margin: 0 auto;">
|
| 2 |
<h1>
|
| 3 |
+
Z Image Turbo (ZIT): Fast & Versatile Image Generation
|
| 4 |
</h1>
|
| 5 |
<div class="grid-container" >
|
| 6 |
<p>
|