Spaces:
Running
on
Zero
Running
on
Zero
update example
Browse files- .gitattributes +2 -1
- app.py +15 -0
- assets/ilovehere.jpg +3 -0
.gitattributes
CHANGED
@@ -32,4 +32,5 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
32 |
*.xz filter=lfs diff=lfs merge=lfs -text
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
-
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
32 |
*.xz filter=lfs diff=lfs merge=lfs -text
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
+
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
36 |
+
*.jpg filter=lfs diff=lfs merge=lfs -text
|
app.py
CHANGED
@@ -31,7 +31,14 @@ class SamplingOptions:
|
|
31 |
re_init: bool = False
|
32 |
attn_mask: bool = False
|
33 |
attn_scale_value: float = 0.0
|
|
|
34 |
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
def resize_image(image_array, max_width=512, max_height=512):
|
36 |
# 将numpy数组转换为PIL图像
|
37 |
if image_array.shape[-1] == 4:
|
@@ -275,6 +282,14 @@ def create_demo(model_name: str):
|
|
275 |
],
|
276 |
outputs=[output_image]
|
277 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
278 |
return demo
|
279 |
|
280 |
|
|
|
31 |
re_init: bool = False
|
32 |
attn_mask: bool = False
|
33 |
attn_scale_value: float = 0.0
|
34 |
+
EXAMPLES = [
|
35 |
|
36 |
+
[
|
37 |
+
Image.open("assets/ilovehere.jpg").convert("RGBA"),
|
38 |
+
"In a cluttered wooden cabin, a workbench holds a green neon sign that reads 'I love here'",
|
39 |
+
"In a cluttered wooden cabin, a workbench holds a green neon sign that reads 'I love nana'",
|
40 |
+
],
|
41 |
+
]
|
42 |
def resize_image(image_array, max_width=512, max_height=512):
|
43 |
# 将numpy数组转换为PIL图像
|
44 |
if image_array.shape[-1] == 4:
|
|
|
282 |
],
|
283 |
outputs=[output_image]
|
284 |
)
|
285 |
+
with gr.Row():
|
286 |
+
example = gr.Examples(
|
287 |
+
label="Quick Example",
|
288 |
+
examples=EXAMPLES,
|
289 |
+
inputs=[brush_canvas, source_prompt, target_prompt],
|
290 |
+
examples_per_page=10,
|
291 |
+
cache_examples=False,
|
292 |
+
)
|
293 |
return demo
|
294 |
|
295 |
|
assets/ilovehere.jpg
ADDED
![]() |
Git LFS Details
|