Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -18,7 +18,7 @@ device = "cuda"
|
|
18 |
cv2.setNumThreads(1)
|
19 |
|
20 |
@spaces.GPU(enable_queue=True)
|
21 |
-
def generate_image(images, prompt, negative_prompt,stylecode,strength,additional_prompt,
|
22 |
|
23 |
|
24 |
full_prompt=prompt + additional_prompt
|
@@ -31,7 +31,7 @@ def generate_image(images, prompt, negative_prompt,stylecode,strength,additional
|
|
31 |
# Calculate new width and height
|
32 |
|
33 |
|
34 |
-
image = use_stylecode(ip_ckpt,image_path="",prompt=prompt,negative_prompt=negative_prompt,num_inference_steps=20,image=image,stylecode=stylecode)
|
35 |
|
36 |
yield image
|
37 |
|
@@ -74,7 +74,7 @@ with gr.Blocks(css=css) as demo:
|
|
74 |
with gr.Accordion(open=False, label="Advanced Options"):
|
75 |
strength = gr.Slider(label="strength", value=0.9, step=0.05, minimum=0, maximum=1)
|
76 |
additional_prompt = gr.Textbox(label="additional prompt",placeholder ="highly detailed ,simple background")
|
77 |
-
|
78 |
|
79 |
|
80 |
submit = gr.Button("Use stylecode")
|
@@ -84,7 +84,7 @@ with gr.Blocks(css=css) as demo:
|
|
84 |
stylecode_gen.click(fn=make_stylecode_gui,inputs=[files],outputs=stylecode)
|
85 |
|
86 |
submit.click(fn=generate_image,
|
87 |
-
inputs=[files, prompt, negative_prompt,stylecode,strength,additional_prompt],
|
88 |
outputs=gallery)
|
89 |
|
90 |
gr.Markdown("This demo includes extra features to mitigate the implicit bias of the model and prevent explicit usage of it to generate content with faces of people, including third parties, that is not safe for all audiences, including naked or semi-naked people.")
|
|
|
18 |
cv2.setNumThreads(1)
|
19 |
|
20 |
@spaces.GPU(enable_queue=True)
|
21 |
+
def generate_image(images, prompt, negative_prompt,stylecode,strength,additional_prompt, seed, progress=gr.Progress(track_tqdm=True)):
|
22 |
|
23 |
|
24 |
full_prompt=prompt + additional_prompt
|
|
|
31 |
# Calculate new width and height
|
32 |
|
33 |
|
34 |
+
image = use_stylecode(ip_ckpt,image_path="",prompt=prompt,negative_prompt=negative_prompt,num_inference_steps=20,image=image,stylecode=stylecode,seed=seed)
|
35 |
|
36 |
yield image
|
37 |
|
|
|
74 |
with gr.Accordion(open=False, label="Advanced Options"):
|
75 |
strength = gr.Slider(label="strength", value=0.9, step=0.05, minimum=0, maximum=1)
|
76 |
additional_prompt = gr.Textbox(label="additional prompt",placeholder ="highly detailed ,simple background")
|
77 |
+
seed = gr.Number(label="seed",placeholder = -1)
|
78 |
|
79 |
|
80 |
submit = gr.Button("Use stylecode")
|
|
|
84 |
stylecode_gen.click(fn=make_stylecode_gui,inputs=[files],outputs=stylecode)
|
85 |
|
86 |
submit.click(fn=generate_image,
|
87 |
+
inputs=[files, prompt, negative_prompt,stylecode,strength,additional_prompt,seed],
|
88 |
outputs=gallery)
|
89 |
|
90 |
gr.Markdown("This demo includes extra features to mitigate the implicit bias of the model and prevent explicit usage of it to generate content with faces of people, including third parties, that is not safe for all audiences, including naked or semi-naked people.")
|