Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -46,13 +46,15 @@ def inference(prompt, guidance, steps):
|
|
46 |
|
47 |
promptPrev = prompt
|
48 |
prompt = prompt_prefixes[current_model] + prompt
|
49 |
-
|
|
|
50 |
return image, gr.update(visible=True), gr.update(visible=True), gr.update(visible=True), gr.update(placeholder=promptPrev)
|
51 |
|
52 |
def inference_example(prompt, guidance, steps):
|
53 |
|
54 |
prompt = prompt_prefixes[current_model] + prompt
|
55 |
-
|
|
|
56 |
return image
|
57 |
|
58 |
css = """
|
|
|
46 |
|
47 |
promptPrev = prompt
|
48 |
prompt = prompt_prefixes[current_model] + prompt
|
49 |
+
results = pipe(prompt, num_inference_steps=int(steps), guidance_scale=guidance, width=512, height=512)
|
50 |
+
image = results.images[0] if not results.nsfw_content_detected[0] else Image.open("nsfw_placeholder.jpg")
|
51 |
return image, gr.update(visible=True), gr.update(visible=True), gr.update(visible=True), gr.update(placeholder=promptPrev)
|
52 |
|
53 |
def inference_example(prompt, guidance, steps):
|
54 |
|
55 |
prompt = prompt_prefixes[current_model] + prompt
|
56 |
+
results = pipe(prompt, num_inference_steps=int(steps), guidance_scale=guidance, width=512, height=512)
|
57 |
+
image = results.images[0] if not results.nsfw_content_detected[0] else Image.open("nsfw_placeholder.jpg")
|
58 |
return image
|
59 |
|
60 |
css = """
|