pva22
commited on
Commit
·
776aaec
1
Parent(s):
6c307e5
new lora and app
Browse files
app.py
CHANGED
|
@@ -119,6 +119,9 @@ def infer(
|
|
| 119 |
'height': height,
|
| 120 |
'generator': generator,
|
| 121 |
}
|
|
|
|
|
|
|
|
|
|
| 122 |
|
| 123 |
return pipe(**params).images[0], seed
|
| 124 |
|
|
@@ -139,6 +142,7 @@ css = """
|
|
| 139 |
|
| 140 |
with gr.Blocks(css=css) as demo:
|
| 141 |
with gr.Column(elem_id="col-container"):
|
|
|
|
| 142 |
gr.Markdown(" # Text-to-Image")
|
| 143 |
|
| 144 |
with gr.Row():
|
|
@@ -182,7 +186,25 @@ with gr.Blocks(css=css) as demo:
|
|
| 182 |
|
| 183 |
randomize_seed = gr.Checkbox(label="Randomize seed", value=False)
|
| 184 |
|
| 185 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 186 |
gr.on(
|
| 187 |
triggers=[run_button.click, prompt.submit],
|
| 188 |
fn=infer,
|
|
@@ -190,12 +212,13 @@ with gr.Blocks(css=css) as demo:
|
|
| 190 |
prompt,
|
| 191 |
negative_prompt,
|
| 192 |
randomize_seed,
|
|
|
|
|
|
|
| 193 |
model_repo_id,
|
| 194 |
seed
|
| 195 |
],
|
| 196 |
outputs=[result, seed],
|
| 197 |
)
|
| 198 |
|
| 199 |
-
|
| 200 |
if __name__ == "__main__":
|
| 201 |
-
demo.launch()
|
|
|
|
| 119 |
'height': height,
|
| 120 |
'generator': generator,
|
| 121 |
}
|
| 122 |
+
|
| 123 |
+
print(width)
|
| 124 |
+
print(height)
|
| 125 |
|
| 126 |
return pipe(**params).images[0], seed
|
| 127 |
|
|
|
|
| 142 |
|
| 143 |
with gr.Blocks(css=css) as demo:
|
| 144 |
with gr.Column(elem_id="col-container"):
|
| 145 |
+
|
| 146 |
gr.Markdown(" # Text-to-Image")
|
| 147 |
|
| 148 |
with gr.Row():
|
|
|
|
| 186 |
|
| 187 |
randomize_seed = gr.Checkbox(label="Randomize seed", value=False)
|
| 188 |
|
| 189 |
+
with gr.Row():
|
| 190 |
+
|
| 191 |
+
width = gr.Slider(
|
| 192 |
+
label="Width",
|
| 193 |
+
minimum=256,
|
| 194 |
+
maximum=MAX_IMAGE_SIZE,
|
| 195 |
+
step=32,
|
| 196 |
+
value=512, # Replace with defaults that work for your model
|
| 197 |
+
)
|
| 198 |
+
|
| 199 |
+
height = gr.Slider(
|
| 200 |
+
label="Height",
|
| 201 |
+
minimum=256,
|
| 202 |
+
maximum=MAX_IMAGE_SIZE,
|
| 203 |
+
step=32,
|
| 204 |
+
value=512, # Replace with defaults that work for your model
|
| 205 |
+
)
|
| 206 |
+
|
| 207 |
+
gr.Examples(examples=examples, inputs=[prompt])
|
| 208 |
gr.on(
|
| 209 |
triggers=[run_button.click, prompt.submit],
|
| 210 |
fn=infer,
|
|
|
|
| 212 |
prompt,
|
| 213 |
negative_prompt,
|
| 214 |
randomize_seed,
|
| 215 |
+
width,
|
| 216 |
+
height,
|
| 217 |
model_repo_id,
|
| 218 |
seed
|
| 219 |
],
|
| 220 |
outputs=[result, seed],
|
| 221 |
)
|
| 222 |
|
|
|
|
| 223 |
if __name__ == "__main__":
|
| 224 |
+
demo.launch()
|