Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -27,7 +27,7 @@ pipe = StableDiffusionXLInpaintPipeline.from_pretrained(
|
|
| 27 |
pipe = pipe.to(device)
|
| 28 |
pipe.force_zeros_for_empty_prompt = False
|
| 29 |
|
| 30 |
-
default_negative_prompt= "Logo,Watermark,Text,Ugly,Morbid,Extra fingers,Poorly drawn hands,Mutation,Blurry,Extra limbs,Gross proportions,Missing arms,Mutated hands,Long neck,Duplicate,Mutilated,Mutilated hands,Poorly drawn face,Deformed,Bad anatomy,Cloned face,Malformed limbs,Missing legs,Too many fingers"
|
| 31 |
|
| 32 |
|
| 33 |
def read_content(file_path: str) -> str:
|
|
@@ -38,7 +38,7 @@ def read_content(file_path: str) -> str:
|
|
| 38 |
|
| 39 |
return content
|
| 40 |
|
| 41 |
-
def predict(dict, prompt="", negative_prompt="", guidance_scale=
|
| 42 |
if negative_prompt == "":
|
| 43 |
negative_prompt = None
|
| 44 |
|
|
@@ -108,9 +108,9 @@ with image_blocks as demo:
|
|
| 108 |
|
| 109 |
with gr.Accordion(label="Advanced Settings", open=False):
|
| 110 |
with gr.Row(equal_height=True):
|
| 111 |
-
guidance_scale = gr.Number(value=
|
| 112 |
steps = gr.Number(value=30, minimum=20, maximum=50, step=1, label="steps")
|
| 113 |
-
strength = gr.Number(value=
|
| 114 |
negative_prompt = gr.Textbox(label="negative_prompt", value=default_negative_prompt, placeholder=default_negative_prompt, info="what you don't want to see in the image")
|
| 115 |
|
| 116 |
|
|
|
|
| 27 |
pipe = pipe.to(device)
|
| 28 |
pipe.force_zeros_for_empty_prompt = False
|
| 29 |
|
| 30 |
+
default_negative_prompt= "" #"Logo,Watermark,Text,Ugly,Morbid,Extra fingers,Poorly drawn hands,Mutation,Blurry,Extra limbs,Gross proportions,Missing arms,Mutated hands,Long neck,Duplicate,Mutilated,Mutilated hands,Poorly drawn face,Deformed,Bad anatomy,Cloned face,Malformed limbs,Missing legs,Too many fingers"
|
| 31 |
|
| 32 |
|
| 33 |
def read_content(file_path: str) -> str:
|
|
|
|
| 38 |
|
| 39 |
return content
|
| 40 |
|
| 41 |
+
def predict(dict, prompt="", negative_prompt="", guidance_scale=5, steps=30, strength=1.0, scheduler="EulerDiscreteScheduler"):
|
| 42 |
if negative_prompt == "":
|
| 43 |
negative_prompt = None
|
| 44 |
|
|
|
|
| 108 |
|
| 109 |
with gr.Accordion(label="Advanced Settings", open=False):
|
| 110 |
with gr.Row(equal_height=True):
|
| 111 |
+
guidance_scale = gr.Number(value=5, minimum=1.0, maximum=10.0, step=0.5, label="guidance_scale")
|
| 112 |
steps = gr.Number(value=30, minimum=20, maximum=50, step=1, label="steps")
|
| 113 |
+
strength = gr.Number(value=1, minimum=0.01, maximum=1.0, step=0.01, label="strength")
|
| 114 |
negative_prompt = gr.Textbox(label="negative_prompt", value=default_negative_prompt, placeholder=default_negative_prompt, info="what you don't want to see in the image")
|
| 115 |
|
| 116 |
|