Spaces:
Running
on
Zero
Running
on
Zero
gradio==4.1.1
Browse files- README.md +1 -1
- app_stylization.py +9 -8
- app_zero_shot.py +8 -7
- requirements.txt +6 -6
README.md
CHANGED
@@ -4,7 +4,7 @@ emoji: 🔥
|
|
4 |
colorFrom: yellow
|
5 |
colorTo: indigo
|
6 |
sdk: gradio
|
7 |
-
sdk_version:
|
8 |
app_file: app.py
|
9 |
pinned: false
|
10 |
suggested_hardware: t4-small
|
|
|
4 |
colorFrom: yellow
|
5 |
colorTo: indigo
|
6 |
sdk: gradio
|
7 |
+
sdk_version: 4.1.1
|
8 |
app_file: app.py
|
9 |
pinned: false
|
10 |
suggested_hardware: t4-small
|
app_stylization.py
CHANGED
@@ -53,13 +53,12 @@ def run(
|
|
53 |
with gr.Blocks() as demo:
|
54 |
with gr.Row():
|
55 |
with gr.Column():
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
run_button = gr.Button()
|
63 |
with gr.Accordion(label="Advanced options", open=False):
|
64 |
negative_prompt = gr.Textbox(label="Negative Prompt", value=DEFAULT_NEGATIVE_PROMPT)
|
65 |
seed = gr.Slider(
|
@@ -131,13 +130,15 @@ with gr.Blocks() as demo:
|
|
131 |
fn=randomize_seed_fn,
|
132 |
inputs=[seed, randomize_seed],
|
133 |
outputs=seed,
|
134 |
-
queue=False,
|
135 |
api_name=False,
|
|
|
136 |
).then(
|
137 |
fn=run,
|
138 |
inputs=inputs,
|
139 |
outputs=result,
|
140 |
api_name="run-stylization",
|
|
|
|
|
141 |
)
|
142 |
|
143 |
if __name__ == "__main__":
|
|
|
53 |
with gr.Blocks() as demo:
|
54 |
with gr.Row():
|
55 |
with gr.Column():
|
56 |
+
condition_image = gr.Image(label="Condition Image")
|
57 |
+
style_image = gr.Image(label="Style Image")
|
58 |
+
condition_subject = gr.Textbox(label="Condition Subject")
|
59 |
+
style_subject = gr.Textbox(label="Style Subject")
|
60 |
+
prompt = gr.Textbox(label="Prompt")
|
61 |
+
run_button = gr.Button()
|
|
|
62 |
with gr.Accordion(label="Advanced options", open=False):
|
63 |
negative_prompt = gr.Textbox(label="Negative Prompt", value=DEFAULT_NEGATIVE_PROMPT)
|
64 |
seed = gr.Slider(
|
|
|
130 |
fn=randomize_seed_fn,
|
131 |
inputs=[seed, randomize_seed],
|
132 |
outputs=seed,
|
|
|
133 |
api_name=False,
|
134 |
+
concurrency_limit=None,
|
135 |
).then(
|
136 |
fn=run,
|
137 |
inputs=inputs,
|
138 |
outputs=result,
|
139 |
api_name="run-stylization",
|
140 |
+
concurrency_id="gpu",
|
141 |
+
concurrency_limit=1,
|
142 |
)
|
143 |
|
144 |
if __name__ == "__main__":
|
app_zero_shot.py
CHANGED
@@ -46,12 +46,11 @@ def run(
|
|
46 |
with gr.Blocks() as demo:
|
47 |
with gr.Row():
|
48 |
with gr.Column():
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
run_button = gr.Button()
|
55 |
with gr.Accordion(label="Advanced options", open=False):
|
56 |
negative_prompt = gr.Textbox(label="Negative Prompt", value=DEFAULT_NEGATIVE_PROMPT)
|
57 |
seed = gr.Slider(
|
@@ -120,13 +119,15 @@ with gr.Blocks() as demo:
|
|
120 |
fn=randomize_seed_fn,
|
121 |
inputs=[seed, randomize_seed],
|
122 |
outputs=seed,
|
123 |
-
queue=False,
|
124 |
api_name=False,
|
|
|
125 |
).then(
|
126 |
fn=run,
|
127 |
inputs=inputs,
|
128 |
outputs=result,
|
129 |
api_name="run-zero-shot",
|
|
|
|
|
130 |
)
|
131 |
|
132 |
if __name__ == "__main__":
|
|
|
46 |
with gr.Blocks() as demo:
|
47 |
with gr.Row():
|
48 |
with gr.Column():
|
49 |
+
condition_image = gr.Image(label="Condition Image")
|
50 |
+
condition_subject = gr.Textbox(label="Condition Subject")
|
51 |
+
target_subject = gr.Textbox(label="Target Subject")
|
52 |
+
prompt = gr.Textbox(label="Prompt")
|
53 |
+
run_button = gr.Button()
|
|
|
54 |
with gr.Accordion(label="Advanced options", open=False):
|
55 |
negative_prompt = gr.Textbox(label="Negative Prompt", value=DEFAULT_NEGATIVE_PROMPT)
|
56 |
seed = gr.Slider(
|
|
|
119 |
fn=randomize_seed_fn,
|
120 |
inputs=[seed, randomize_seed],
|
121 |
outputs=seed,
|
|
|
122 |
api_name=False,
|
123 |
+
concurrency_limit=None,
|
124 |
).then(
|
125 |
fn=run,
|
126 |
inputs=inputs,
|
127 |
outputs=result,
|
128 |
api_name="run-zero-shot",
|
129 |
+
concurrency_id="gpu",
|
130 |
+
concurrency_limit=1,
|
131 |
)
|
132 |
|
133 |
if __name__ == "__main__":
|
requirements.txt
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
-
accelerate==0.
|
2 |
controlnet_aux==0.0.7
|
3 |
-
git+https://github.com/huggingface/diffusers@
|
4 |
-
gradio==
|
5 |
-
Pillow==10.0
|
6 |
-
spaces==0.
|
7 |
torch==2.0.0
|
8 |
torchvision==0.15.1
|
9 |
-
transformers==4.
|
|
|
1 |
+
accelerate==0.24.1
|
2 |
controlnet_aux==0.0.7
|
3 |
+
git+https://github.com/huggingface/diffusers@dd9a5ca
|
4 |
+
gradio==4.1.1
|
5 |
+
Pillow==10.1.0
|
6 |
+
spaces==0.18.0
|
7 |
torch==2.0.0
|
8 |
torchvision==0.15.1
|
9 |
+
transformers==4.35.0
|