Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -71,13 +71,7 @@ def set_text_unfinished():
|
|
71 |
def set_text_finished():
|
72 |
return gr.update(visible=True, value="<h3>Generation Finished</h3>")
|
73 |
#################################################
|
74 |
-
def get_image_path(image_path):
|
75 |
-
if os.path.exists(image_path):
|
76 |
-
return [image_path] # Return the image path in a list
|
77 |
-
else:
|
78 |
-
raise FileNotFoundError(f"Image not found: {image_path}")
|
79 |
|
80 |
-
#################################################
|
81 |
class SpatialAttnProcessor2_0(torch.nn.Module):
|
82 |
r"""
|
83 |
Attention processor for IP-Adapater for PyTorch 2.0.
|
@@ -380,10 +374,9 @@ title = r"""
|
|
380 |
|
381 |
description = r"""
|
382 |
<br>❗️❗️❗️[<b>Important</b>] Personalization steps:<br>
|
383 |
-
1
|
384 |
-
2
|
385 |
-
3
|
386 |
-
4️⃣ Click the <b>Submit</b> button to start customizing.
|
387 |
"""
|
388 |
|
389 |
article = r"""
|
@@ -391,9 +384,8 @@ article = r"""
|
|
391 |
"""
|
392 |
version = r"""
|
393 |
<h3 align="center">Ai Comic Generator</h3>
|
394 |
-
<h5 >1. Support
|
395 |
-
<h5 >2.
|
396 |
-
<h5 >3. [NC]symbol (The [NC] symbol is used as a flag to indicate that no characters should be present in the generated scene images. If you want do that, prepend the "[NC]" at the beginning of the line. For example, to generate a scene of falling leaves without any character, write: "[NC] The leaves are falling."),Currently, support is only using Textual Description</h5>
|
397 |
<h5>Tips: Not Ready Now! Just Test! It's better to use prompts to assist in controlling the character's attire. Depending on the limited code integration time, there might be some undiscovered bugs. If you find that a particular generation result is significantly poor, please email me ([email protected]) Thank you very much.</h4>
|
398 |
"""
|
399 |
#################################################
|
@@ -613,14 +605,14 @@ with gr.Blocks(css=css) as demo:
|
|
613 |
|
614 |
gr.Examples(
|
615 |
examples=[
|
616 |
-
[0, 0.5, 0.5, 2, "a
|
617 |
-
"bad anatomy, bad hands, missing fingers,
|
618 |
array2string([
|
619 |
-
"
|
620 |
-
"[NC]
|
621 |
-
"[NC]
|
622 |
-
"
|
623 |
-
"[NC]
|
624 |
]),
|
625 |
"Comic book", 768, 768],
|
626 |
],
|
|
|
71 |
def set_text_finished():
|
72 |
return gr.update(visible=True, value="<h3>Generation Finished</h3>")
|
73 |
#################################################
|
|
|
|
|
|
|
|
|
|
|
74 |
|
|
|
75 |
class SpatialAttnProcessor2_0(torch.nn.Module):
|
76 |
r"""
|
77 |
Attention processor for IP-Adapater for PyTorch 2.0.
|
|
|
374 |
|
375 |
description = r"""
|
376 |
<br>❗️❗️❗️[<b>Important</b>] Personalization steps:<br>
|
377 |
+
1: Enter the prompt array, each line corrsponds to one generated image.<br>
|
378 |
+
2: Choose your preferred style template.<br>
|
379 |
+
3: Click the <b>Submit</b> button to start customizing.
|
|
|
380 |
"""
|
381 |
|
382 |
article = r"""
|
|
|
384 |
"""
|
385 |
version = r"""
|
386 |
<h3 align="center">Ai Comic Generator</h3>
|
387 |
+
<h5 >1. Support Typesetting Style and Captioning.(By default, the prompt is used as the caption for each image. If you need to change the caption, add a # at the end of each line. Only the part after the # will be added as a caption to the image.)</h5>
|
388 |
+
<h5 >2. [NC]symbol (The [NC] symbol is used as a flag to indicate that no characters should be present in the generated scene images. If you want do that, prepend the "[NC]" at the beginning of the line. For example, to generate a scene of falling leaves without any character, write: "[NC] The leaves are falling."),Currently, support is only using Textual Description</h5>
|
|
|
389 |
<h5>Tips: Not Ready Now! Just Test! It's better to use prompts to assist in controlling the character's attire. Depending on the limited code integration time, there might be some undiscovered bugs. If you find that a particular generation result is significantly poor, please email me ([email protected]) Thank you very much.</h4>
|
390 |
"""
|
391 |
#################################################
|
|
|
605 |
|
606 |
gr.Examples(
|
607 |
examples=[
|
608 |
+
[0, 0.5, 0.5, 2, "a young girl with short hair, wearing a jacket and boots, holding a glowing amulet",
|
609 |
+
"bad anatomy, bad hands, missing fingers, extra fingers, three hands, three legs, bad arms, missing legs, missing arms, poorly drawn face, bad face, fused face, cloned face, three crus, fused feet, fused thigh, extra crus, ugly fingers, horn, cartoon, cg, 3d, unreal, animate, amputation, disconnected limbs",
|
610 |
array2string([
|
611 |
+
"sitting under a tree, reading an old map #One day, I will find the lost city",
|
612 |
+
"[NC]She finds a hidden cave in the forest #This must be it!",
|
613 |
+
"[NC]Entering the dark cave, lantern in hand #I must be careful...",
|
614 |
+
"holding the amulet, standing before a giant door #The amulet begins to glow!",
|
615 |
+
"[NC]The door opens, revealing a mystical world beyond #My adventure truly begins now!"
|
616 |
]),
|
617 |
"Comic book", 768, 768],
|
618 |
],
|