Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -11,7 +11,7 @@ dataset = load_dataset("Gustavosta/Stable-Diffusion-Prompts")
|
|
| 11 |
prompt_df = dataset["train"].to_pandas()
|
| 12 |
|
| 13 |
def get_samples():
|
| 14 |
-
prompt_list = prompt_df.sample(n = 5)["Prompt"].map(lambda x: x).values.tolist()
|
| 15 |
return prompt_list
|
| 16 |
|
| 17 |
def get_params(request: gr.Request):
|
|
@@ -241,6 +241,7 @@ with gr.Blocks(css=css) as demo:
|
|
| 241 |
|
| 242 |
with gr.Row():
|
| 243 |
with gr.Column():
|
|
|
|
| 244 |
exps = gr.Examples(
|
| 245 |
get_samples(),
|
| 246 |
inputs = text_prompt,
|
|
@@ -253,11 +254,10 @@ with gr.Blocks(css=css) as demo:
|
|
| 253 |
label="Prompt Examples",
|
| 254 |
samples=exps_l,
|
| 255 |
)
|
| 256 |
-
exp_refresh = gr.Button(value="Click Refresh to get newly prompt examples")
|
| 257 |
-
exp_refresh.click(get_samples, None, exps)
|
| 258 |
exps.select(lambda x: x[0], exps, text_prompt)
|
| 259 |
-
|
| 260 |
-
|
| 261 |
text_button.click(generate_txt2img, inputs=[current_model, text_prompt, negative_prompt, image_style], outputs=image_output)
|
| 262 |
demo.load(get_params, None, [current_model, exps])
|
| 263 |
|
|
|
|
| 11 |
prompt_df = dataset["train"].to_pandas()
|
| 12 |
|
| 13 |
def get_samples():
|
| 14 |
+
prompt_list = prompt_df.sample(n = 5)["Prompt"].map(lambda x: [x]).values.tolist()
|
| 15 |
return prompt_list
|
| 16 |
|
| 17 |
def get_params(request: gr.Request):
|
|
|
|
| 241 |
|
| 242 |
with gr.Row():
|
| 243 |
with gr.Column():
|
| 244 |
+
'''
|
| 245 |
exps = gr.Examples(
|
| 246 |
get_samples(),
|
| 247 |
inputs = text_prompt,
|
|
|
|
| 254 |
label="Prompt Examples",
|
| 255 |
samples=exps_l,
|
| 256 |
)
|
| 257 |
+
#exp_refresh = gr.Button(value="Click Refresh to get newly prompt examples")
|
| 258 |
+
#exp_refresh.click(get_samples, None, exps)
|
| 259 |
exps.select(lambda x: x[0], exps, text_prompt)
|
| 260 |
+
|
|
|
|
| 261 |
text_button.click(generate_txt2img, inputs=[current_model, text_prompt, negative_prompt, image_style], outputs=image_output)
|
| 262 |
demo.load(get_params, None, [current_model, exps])
|
| 263 |
|