Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -21,7 +21,7 @@ device = "cuda"
|
|
21 |
cv2.setNumThreads(1)
|
22 |
|
23 |
@spaces.GPU(enable_queue=True)
|
24 |
-
def generate_image(images, prompt, negative_prompt,stylecode, progress=gr.Progress(track_tqdm=True)):
|
25 |
|
26 |
|
27 |
|
@@ -55,7 +55,7 @@ h1{margin-bottom: 0 !important}
|
|
55 |
'''
|
56 |
with gr.Blocks(css=css) as demo:
|
57 |
gr.Markdown("# IP-Adapter-Instruct demo")
|
58 |
-
gr.Markdown("Demo for the [CiaraRowles/
|
59 |
with gr.Row():
|
60 |
with gr.Column():
|
61 |
files = gr.Image(
|
@@ -70,6 +70,8 @@ with gr.Blocks(css=css) as demo:
|
|
70 |
placeholder="A photo of a [man/woman/person]...")
|
71 |
|
72 |
negative_prompt = gr.Textbox(label="Negative Prompt", placeholder="low quality")
|
|
|
|
|
73 |
stylecode_gen = gr.Button("Make stylecode")
|
74 |
stylecode = gr.Textbox(label="stylecode")
|
75 |
submit = gr.Button("Use stylecode")
|
@@ -79,7 +81,7 @@ with gr.Blocks(css=css) as demo:
|
|
79 |
stylecode_gen.click(fn=make_stylecode_gui,inputs=[files],outputs=stylecode)
|
80 |
|
81 |
submit.click(fn=generate_image,
|
82 |
-
inputs=[files, prompt, negative_prompt,stylecode],
|
83 |
outputs=gallery)
|
84 |
|
85 |
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.")
|
|
|
21 |
cv2.setNumThreads(1)
|
22 |
|
23 |
@spaces.GPU(enable_queue=True)
|
24 |
+
def generate_image(images, prompt, negative_prompt,stylecode,strength, progress=gr.Progress(track_tqdm=True)):
|
25 |
|
26 |
|
27 |
|
|
|
55 |
'''
|
56 |
with gr.Blocks(css=css) as demo:
|
57 |
gr.Markdown("# IP-Adapter-Instruct demo")
|
58 |
+
gr.Markdown("Demo for the [CiaraRowles/stylecodes model](https://huggingface.co/CiaraRowles/stylecodes)")
|
59 |
with gr.Row():
|
60 |
with gr.Column():
|
61 |
files = gr.Image(
|
|
|
70 |
placeholder="A photo of a [man/woman/person]...")
|
71 |
|
72 |
negative_prompt = gr.Textbox(label="Negative Prompt", placeholder="low quality")
|
73 |
+
with gr.Accordion(open=False, label="Advanced Options"):
|
74 |
+
strength = gr.Slider(label="strength", value=0.8, step=0.05, minimum=0, maximum=1)
|
75 |
stylecode_gen = gr.Button("Make stylecode")
|
76 |
stylecode = gr.Textbox(label="stylecode")
|
77 |
submit = gr.Button("Use stylecode")
|
|
|
81 |
stylecode_gen.click(fn=make_stylecode_gui,inputs=[files],outputs=stylecode)
|
82 |
|
83 |
submit.click(fn=generate_image,
|
84 |
+
inputs=[files, prompt, negative_prompt,stylecode,strength],
|
85 |
outputs=gallery)
|
86 |
|
87 |
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.")
|