Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -12,11 +12,11 @@ pipe = OVStableDiffusionPipeline.from_pretrained(model_id, compile=False)
|
|
12 |
pipe.reshape( batch_size=1, height=256, width=256, num_images_per_prompt=1)
|
13 |
pipe.compile()
|
14 |
|
15 |
-
def infer(prompt):
|
16 |
|
17 |
image = pipe(
|
18 |
prompt = prompt,
|
19 |
-
negative_prompt =
|
20 |
width = 256,
|
21 |
height = 256,
|
22 |
).images[0]
|
@@ -43,12 +43,11 @@ with gr.Blocks(css=css) as demo:
|
|
43 |
|
44 |
with gr.Column(elem_id="col-container"):
|
45 |
gr.Markdown(f"""
|
46 |
-
#
|
47 |
Currently running on {power_device}.
|
48 |
""")
|
49 |
|
50 |
with gr.Row():
|
51 |
-
|
52 |
prompt = gr.Text(
|
53 |
label="Prompt",
|
54 |
show_label=False,
|
@@ -56,7 +55,14 @@ with gr.Blocks(css=css) as demo:
|
|
56 |
placeholder="Enter your prompt",
|
57 |
container=False,
|
58 |
)
|
59 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
run_button = gr.Button("Run", scale=0)
|
61 |
|
62 |
result = gr.Image(label="Result", show_label=False)
|
@@ -68,7 +74,7 @@ with gr.Blocks(css=css) as demo:
|
|
68 |
|
69 |
run_button.click(
|
70 |
fn = infer,
|
71 |
-
inputs = [prompt],
|
72 |
outputs = [result]
|
73 |
)
|
74 |
|
|
|
12 |
pipe.reshape( batch_size=1, height=256, width=256, num_images_per_prompt=1)
|
13 |
pipe.compile()
|
14 |
|
15 |
+
def infer(prompt,negative_prompt):
|
16 |
|
17 |
image = pipe(
|
18 |
prompt = prompt,
|
19 |
+
negative_prompt = negative_prompt,
|
20 |
width = 256,
|
21 |
height = 256,
|
22 |
).images[0]
|
|
|
43 |
|
44 |
with gr.Column(elem_id="col-container"):
|
45 |
gr.Markdown(f"""
|
46 |
+
# Linaqruf-anything-v3.0-ov 256x256
|
47 |
Currently running on {power_device}.
|
48 |
""")
|
49 |
|
50 |
with gr.Row():
|
|
|
51 |
prompt = gr.Text(
|
52 |
label="Prompt",
|
53 |
show_label=False,
|
|
|
55 |
placeholder="Enter your prompt",
|
56 |
container=False,
|
57 |
)
|
58 |
+
with gr.Row():
|
59 |
+
negative_prompt = gr.Text(
|
60 |
+
label="negative_prompt",
|
61 |
+
show_label=False,
|
62 |
+
max_lines=1,
|
63 |
+
placeholder="Enter your prompt",
|
64 |
+
container=False,
|
65 |
+
)
|
66 |
run_button = gr.Button("Run", scale=0)
|
67 |
|
68 |
result = gr.Image(label="Result", show_label=False)
|
|
|
74 |
|
75 |
run_button.click(
|
76 |
fn = infer,
|
77 |
+
inputs = [prompt,negative_prompt],
|
78 |
outputs = [result]
|
79 |
)
|
80 |
|