Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -51,7 +51,7 @@ def inference(prompt, negPrompt, guidance, steps, width_input, height_input):
|
|
51 |
prompt = prompt_prefixes[current_model] + prompt
|
52 |
results = pipe(prompt, negative_prompt = negPrompt, num_inference_steps=int(steps), guidance_scale=guidance, width=width_input, height=height_input)
|
53 |
image = results.images[0] if not results.nsfw_content_detected[0] else Image.open("nsfw_placeholder.jpg")
|
54 |
-
return image, gr.update(visible=True), gr.update(visible=True), gr.update(visible=True)
|
55 |
|
56 |
def inference_example(prompt, negPrompt, guidance, steps, width_input, height_input):
|
57 |
|
@@ -148,7 +148,7 @@ with gr.Blocks(css=css) as demo:
|
|
148 |
share_button = gr.Button("Share to community", elem_id="share-btn", visible=False)
|
149 |
|
150 |
model.change(on_model_change, inputs=model, outputs=[])
|
151 |
-
run.click(inference, inputs=[prompt, negPrompt, guidance, steps, width_input, height_input], outputs=[image_out, share_button, community_icon, loading_icon
|
152 |
|
153 |
share_button.click(None, [], [], _js=share_js)
|
154 |
|
|
|
51 |
prompt = prompt_prefixes[current_model] + prompt
|
52 |
results = pipe(prompt, negative_prompt = negPrompt, num_inference_steps=int(steps), guidance_scale=guidance, width=width_input, height=height_input)
|
53 |
image = results.images[0] if not results.nsfw_content_detected[0] else Image.open("nsfw_placeholder.jpg")
|
54 |
+
return image, gr.update(visible=True), gr.update(visible=True), gr.update(visible=True)
|
55 |
|
56 |
def inference_example(prompt, negPrompt, guidance, steps, width_input, height_input):
|
57 |
|
|
|
148 |
share_button = gr.Button("Share to community", elem_id="share-btn", visible=False)
|
149 |
|
150 |
model.change(on_model_change, inputs=model, outputs=[])
|
151 |
+
run.click(inference, inputs=[prompt, negPrompt, guidance, steps, width_input, height_input], outputs=[image_out, share_button, community_icon, loading_icon])
|
152 |
|
153 |
share_button.click(None, [], [], _js=share_js)
|
154 |
|