Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -8,6 +8,8 @@ import re
|
|
| 8 |
hf_token = os.environ.get("HF_TOKEN")
|
| 9 |
from gradio_client import Client
|
| 10 |
|
|
|
|
|
|
|
| 11 |
|
| 12 |
def safety_check(user_prompt):
|
| 13 |
|
|
@@ -102,18 +104,32 @@ css="""
|
|
| 102 |
"""
|
| 103 |
with gr.Blocks(css=css) as app:
|
| 104 |
with gr.Column(elem_id="col-container"):
|
| 105 |
-
gr.
|
| 106 |
-
|
| 107 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 108 |
""")
|
| 109 |
|
| 110 |
with gr.Row():
|
| 111 |
with gr.Column(scale=2):
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 117 |
|
| 118 |
subject = gr.Image(
|
| 119 |
label="Subject", type="filepath"
|
|
|
|
| 8 |
hf_token = os.environ.get("HF_TOKEN")
|
| 9 |
from gradio_client import Client
|
| 10 |
|
| 11 |
+
is_shared_ui = True if "fffiloni/consistent-character" in os.environ['SPACE_ID'] else False
|
| 12 |
+
|
| 13 |
|
| 14 |
def safety_check(user_prompt):
|
| 15 |
|
|
|
|
| 104 |
"""
|
| 105 |
with gr.Blocks(css=css) as app:
|
| 106 |
with gr.Column(elem_id="col-container"):
|
| 107 |
+
gr.Markdown("# Consistent Character Workflow")
|
| 108 |
+
gr.Markdown("### Create images of a given character in different poses • running cog image by fofr")
|
| 109 |
+
|
| 110 |
+
gr.HTML("""
|
| 111 |
+
<div style="display:flex;column-gap:4px;">
|
| 112 |
+
<a href="https://huggingface.co/spaces/fffiloni/DimensionX?duplicate=true">
|
| 113 |
+
<img src="https://huggingface.co/datasets/huggingface/badges/resolve/main/duplicate-this-space-sm.svg" alt="Duplicate this Space">
|
| 114 |
+
</a>
|
| 115 |
+
<p> to skip the queue and use custom prompts
|
| 116 |
+
</div>
|
| 117 |
""")
|
| 118 |
|
| 119 |
with gr.Row():
|
| 120 |
with gr.Column(scale=2):
|
| 121 |
+
if is_shared_ui:
|
| 122 |
+
prompt = gr.Textbox(
|
| 123 |
+
label="Prompt", info='''Duplicate the space to you personal account for custom prompt''',
|
| 124 |
+
value="a person, darkblue suit, black tie, white pocket",
|
| 125 |
+
interactive=False
|
| 126 |
+
)
|
| 127 |
+
else:
|
| 128 |
+
prompt = gr.Textbox(
|
| 129 |
+
label="Prompt", info='''Describe the subject. Include clothes and hairstyle for more consistency.''',
|
| 130 |
+
value="a person, darkblue suit, black tie, white pocket",
|
| 131 |
+
interactive=True
|
| 132 |
+
)
|
| 133 |
|
| 134 |
subject = gr.Image(
|
| 135 |
label="Subject", type="filepath"
|