Spaces:
Running
on
Zero
Running
on
Zero
Use gr.on
Browse files- app_stylization.py +8 -49
- app_zero_shot.py +8 -49
app_stylization.py
CHANGED
|
@@ -120,55 +120,14 @@ with gr.Blocks() as demo:
|
|
| 120 |
guidance_scale,
|
| 121 |
num_inference_steps,
|
| 122 |
]
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
inputs=inputs,
|
| 132 |
-
outputs=result,
|
| 133 |
-
api_name=False,
|
| 134 |
-
)
|
| 135 |
-
style_subject.submit(
|
| 136 |
-
fn=randomize_seed_fn,
|
| 137 |
-
inputs=[seed, randomize_seed],
|
| 138 |
-
outputs=seed,
|
| 139 |
-
queue=False,
|
| 140 |
-
api_name=False,
|
| 141 |
-
).then(
|
| 142 |
-
fn=run,
|
| 143 |
-
inputs=inputs,
|
| 144 |
-
outputs=result,
|
| 145 |
-
api_name=False,
|
| 146 |
-
)
|
| 147 |
-
prompt.submit(
|
| 148 |
-
fn=randomize_seed_fn,
|
| 149 |
-
inputs=[seed, randomize_seed],
|
| 150 |
-
outputs=seed,
|
| 151 |
-
queue=False,
|
| 152 |
-
api_name=False,
|
| 153 |
-
).then(
|
| 154 |
-
fn=run,
|
| 155 |
-
inputs=inputs,
|
| 156 |
-
outputs=result,
|
| 157 |
-
api_name=False,
|
| 158 |
-
)
|
| 159 |
-
negative_prompt.submit(
|
| 160 |
-
fn=randomize_seed_fn,
|
| 161 |
-
inputs=[seed, randomize_seed],
|
| 162 |
-
outputs=seed,
|
| 163 |
-
queue=False,
|
| 164 |
-
api_name=False,
|
| 165 |
-
).then(
|
| 166 |
-
fn=run,
|
| 167 |
-
inputs=inputs,
|
| 168 |
-
outputs=result,
|
| 169 |
-
api_name=False,
|
| 170 |
-
)
|
| 171 |
-
run_button.click(
|
| 172 |
fn=randomize_seed_fn,
|
| 173 |
inputs=[seed, randomize_seed],
|
| 174 |
outputs=seed,
|
|
|
|
| 120 |
guidance_scale,
|
| 121 |
num_inference_steps,
|
| 122 |
]
|
| 123 |
+
gr.on(
|
| 124 |
+
triggers=[
|
| 125 |
+
condition_subject.submit,
|
| 126 |
+
style_subject.submit,
|
| 127 |
+
prompt.submit,
|
| 128 |
+
negative_prompt.submit,
|
| 129 |
+
run_button.click,
|
| 130 |
+
],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 131 |
fn=randomize_seed_fn,
|
| 132 |
inputs=[seed, randomize_seed],
|
| 133 |
outputs=seed,
|
app_zero_shot.py
CHANGED
|
@@ -109,55 +109,14 @@ with gr.Blocks() as demo:
|
|
| 109 |
guidance_scale,
|
| 110 |
num_inference_steps,
|
| 111 |
]
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
inputs=inputs,
|
| 121 |
-
outputs=result,
|
| 122 |
-
api_name=False,
|
| 123 |
-
)
|
| 124 |
-
target_subject.submit(
|
| 125 |
-
fn=randomize_seed_fn,
|
| 126 |
-
inputs=[seed, randomize_seed],
|
| 127 |
-
outputs=seed,
|
| 128 |
-
queue=False,
|
| 129 |
-
api_name=False,
|
| 130 |
-
).then(
|
| 131 |
-
fn=run,
|
| 132 |
-
inputs=inputs,
|
| 133 |
-
outputs=result,
|
| 134 |
-
api_name=False,
|
| 135 |
-
)
|
| 136 |
-
prompt.submit(
|
| 137 |
-
fn=randomize_seed_fn,
|
| 138 |
-
inputs=[seed, randomize_seed],
|
| 139 |
-
outputs=seed,
|
| 140 |
-
queue=False,
|
| 141 |
-
api_name=False,
|
| 142 |
-
).then(
|
| 143 |
-
fn=run,
|
| 144 |
-
inputs=inputs,
|
| 145 |
-
outputs=result,
|
| 146 |
-
api_name=False,
|
| 147 |
-
)
|
| 148 |
-
negative_prompt.submit(
|
| 149 |
-
fn=randomize_seed_fn,
|
| 150 |
-
inputs=[seed, randomize_seed],
|
| 151 |
-
outputs=seed,
|
| 152 |
-
queue=False,
|
| 153 |
-
api_name=False,
|
| 154 |
-
).then(
|
| 155 |
-
fn=run,
|
| 156 |
-
inputs=inputs,
|
| 157 |
-
outputs=result,
|
| 158 |
-
api_name=False,
|
| 159 |
-
)
|
| 160 |
-
run_button.click(
|
| 161 |
fn=randomize_seed_fn,
|
| 162 |
inputs=[seed, randomize_seed],
|
| 163 |
outputs=seed,
|
|
|
|
| 109 |
guidance_scale,
|
| 110 |
num_inference_steps,
|
| 111 |
]
|
| 112 |
+
gr.on(
|
| 113 |
+
triggers=[
|
| 114 |
+
condition_subject.submit,
|
| 115 |
+
target_subject.submit,
|
| 116 |
+
prompt.submit,
|
| 117 |
+
negative_prompt.submit,
|
| 118 |
+
run_button.click,
|
| 119 |
+
],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 120 |
fn=randomize_seed_fn,
|
| 121 |
inputs=[seed, randomize_seed],
|
| 122 |
outputs=seed,
|