Spaces:
Build error
Build error
change the default resolution from 512x512 to 768x768 for the SD 2.0-based model
#1
by
kabachuha
- opened
app.py
CHANGED
@@ -26,7 +26,7 @@ def error_str(error, title="Error"):
|
|
26 |
return f"""#### {title}
|
27 |
{error}""" if error else ""
|
28 |
|
29 |
-
def inference(prompt, guidance, steps, width=
|
30 |
|
31 |
generator = torch.Generator('cuda').manual_seed(seed) if seed != 0 else None
|
32 |
prompt = f"{prefix} {prompt}" if auto_prefix else prompt
|
@@ -95,7 +95,7 @@ with gr.Blocks(css=css) as demo:
|
|
95 |
prompt = gr.Textbox(label="Prompt", show_label=False, max_lines=2,placeholder=f"{prefix} [your prompt]").style(container=False)
|
96 |
generate = gr.Button(value="Generate").style(rounded=(False, True, True, False))
|
97 |
|
98 |
-
image_out = gr.Image(height=
|
99 |
error_output = gr.Markdown()
|
100 |
|
101 |
with gr.Column(scale=45):
|
@@ -109,8 +109,8 @@ with gr.Blocks(css=css) as demo:
|
|
109 |
steps = gr.Slider(label="Steps", value=25, minimum=2, maximum=75, step=1)
|
110 |
|
111 |
with gr.Row():
|
112 |
-
width = gr.Slider(label="Width", value=
|
113 |
-
height = gr.Slider(label="Height", value=
|
114 |
|
115 |
seed = gr.Slider(0, 2147483647, label='Seed (0 = random)', value=0, step=1)
|
116 |
|
|
|
26 |
return f"""#### {title}
|
27 |
{error}""" if error else ""
|
28 |
|
29 |
+
def inference(prompt, guidance, steps, width=768, height=768, seed=0, img=None, strength=0.5, neg_prompt="", auto_prefix=False):
|
30 |
|
31 |
generator = torch.Generator('cuda').manual_seed(seed) if seed != 0 else None
|
32 |
prompt = f"{prefix} {prompt}" if auto_prefix else prompt
|
|
|
95 |
prompt = gr.Textbox(label="Prompt", show_label=False, max_lines=2,placeholder=f"{prefix} [your prompt]").style(container=False)
|
96 |
generate = gr.Button(value="Generate").style(rounded=(False, True, True, False))
|
97 |
|
98 |
+
image_out = gr.Image(height=768)
|
99 |
error_output = gr.Markdown()
|
100 |
|
101 |
with gr.Column(scale=45):
|
|
|
109 |
steps = gr.Slider(label="Steps", value=25, minimum=2, maximum=75, step=1)
|
110 |
|
111 |
with gr.Row():
|
112 |
+
width = gr.Slider(label="Width", value=768, minimum=64, maximum=1024, step=8)
|
113 |
+
height = gr.Slider(label="Height", value=768, minimum=64, maximum=1024, step=8)
|
114 |
|
115 |
seed = gr.Slider(0, 2147483647, label='Seed (0 = random)', value=0, step=1)
|
116 |
|