Spaces:
Running
on
Zero
Running
on
Zero
Richard Neuschulz
commited on
Commit
•
919da7e
1
Parent(s):
0f20da3
fixed gradio issue
Browse files
app.py
CHANGED
@@ -40,7 +40,7 @@ pipe = StableDiffusionXLPipeline.from_pretrained(
|
|
40 |
ip_model = ipown.IPAdapterFaceIDXL(pipe, ip_ckpt, device)
|
41 |
|
42 |
@spaces.GPU(enable_queue=True)
|
43 |
-
def generate_image(images, prompt, negative_prompt,
|
44 |
pipe.to(device)
|
45 |
app = FaceAnalysis(name="buffalo_l", providers=['CUDAExecutionProvider', 'CPUExecutionProvider'])
|
46 |
app.prepare(ctx_id=0, det_size=(640, 640))
|
@@ -93,7 +93,6 @@ with gr.Blocks(css=css) as demo:
|
|
93 |
style = "Photorealistic"
|
94 |
submit = gr.Button("Submit")
|
95 |
with gr.Accordion(open=True, label="Advanced Options"):
|
96 |
-
preserve = False
|
97 |
face_strength = gr.Slider(label="Face Structure strength", info="Only applied if preserve face structure is checked", value=1.3, step=0.1, minimum=0, maximum=3)
|
98 |
likeness_strength = gr.Slider(label="Face Embed strength", value=1.0, step=0.1, minimum=0, maximum=5)
|
99 |
nfaa_negative_prompts = gr.Textbox(label="Appended Negative Prompts", info="Negative prompts to steer generations towards safe for all audiences outputs", value="low quality, worst quality")
|
@@ -102,7 +101,7 @@ with gr.Blocks(css=css) as demo:
|
|
102 |
files.upload(fn=swap_to_gallery, inputs=files, outputs=[uploaded_files, clear_button, files])
|
103 |
remove_and_reupload.click(fn=remove_back_to_files, outputs=[uploaded_files, clear_button, files])
|
104 |
submit.click(fn=generate_image,
|
105 |
-
inputs=[files,prompt,negative_prompt,
|
106 |
outputs=gallery)
|
107 |
|
108 |
# 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.")
|
|
|
40 |
ip_model = ipown.IPAdapterFaceIDXL(pipe, ip_ckpt, device)
|
41 |
|
42 |
@spaces.GPU(enable_queue=True)
|
43 |
+
def generate_image(images, prompt, negative_prompt, face_strength, likeness_strength, progress=gr.Progress(track_tqdm=True)):
|
44 |
pipe.to(device)
|
45 |
app = FaceAnalysis(name="buffalo_l", providers=['CUDAExecutionProvider', 'CPUExecutionProvider'])
|
46 |
app.prepare(ctx_id=0, det_size=(640, 640))
|
|
|
93 |
style = "Photorealistic"
|
94 |
submit = gr.Button("Submit")
|
95 |
with gr.Accordion(open=True, label="Advanced Options"):
|
|
|
96 |
face_strength = gr.Slider(label="Face Structure strength", info="Only applied if preserve face structure is checked", value=1.3, step=0.1, minimum=0, maximum=3)
|
97 |
likeness_strength = gr.Slider(label="Face Embed strength", value=1.0, step=0.1, minimum=0, maximum=5)
|
98 |
nfaa_negative_prompts = gr.Textbox(label="Appended Negative Prompts", info="Negative prompts to steer generations towards safe for all audiences outputs", value="low quality, worst quality")
|
|
|
101 |
files.upload(fn=swap_to_gallery, inputs=files, outputs=[uploaded_files, clear_button, files])
|
102 |
remove_and_reupload.click(fn=remove_back_to_files, outputs=[uploaded_files, clear_button, files])
|
103 |
submit.click(fn=generate_image,
|
104 |
+
inputs=[files,prompt,negative_prompt, face_strength, likeness_strength, nfaa_negative_prompts],
|
105 |
outputs=gallery)
|
106 |
|
107 |
# 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.")
|