Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -49,6 +49,7 @@ def generate(
|
|
| 49 |
height: int = 1024,
|
| 50 |
guidance_scale_base: float = 5.0,
|
| 51 |
num_inference_steps_base: int = 25,
|
|
|
|
| 52 |
use_vae: bool = False,
|
| 53 |
use_lora: bool = False,
|
| 54 |
model = 'stabilityai/stable-diffusion-xl-base-1.0',
|
|
@@ -117,7 +118,7 @@ def generate(
|
|
| 117 |
images = pipe(
|
| 118 |
prompt=prompt,
|
| 119 |
image=init_image,
|
| 120 |
-
strength=
|
| 121 |
negative_prompt=negative_prompt,
|
| 122 |
prompt_2=prompt_2,
|
| 123 |
negative_prompt_2=negative_prompt_2,
|
|
@@ -232,6 +233,15 @@ with gr.Blocks(theme=gr.themes.Soft(), css="style.css") as demo:
|
|
| 232 |
step=1,
|
| 233 |
value=25,
|
| 234 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 235 |
|
| 236 |
gr.Examples(
|
| 237 |
examples=examples,
|
|
@@ -312,6 +322,7 @@ with gr.Blocks(theme=gr.themes.Soft(), css="style.css") as demo:
|
|
| 312 |
height,
|
| 313 |
guidance_scale_base,
|
| 314 |
num_inference_steps_base,
|
|
|
|
| 315 |
use_vae,
|
| 316 |
use_lora,
|
| 317 |
model,
|
|
|
|
| 49 |
height: int = 1024,
|
| 50 |
guidance_scale_base: float = 5.0,
|
| 51 |
num_inference_steps_base: int = 25,
|
| 52 |
+
strength_img2img: float = 0.7
|
| 53 |
use_vae: bool = False,
|
| 54 |
use_lora: bool = False,
|
| 55 |
model = 'stabilityai/stable-diffusion-xl-base-1.0',
|
|
|
|
| 118 |
images = pipe(
|
| 119 |
prompt=prompt,
|
| 120 |
image=init_image,
|
| 121 |
+
strength=strength_img2img,
|
| 122 |
negative_prompt=negative_prompt,
|
| 123 |
prompt_2=prompt_2,
|
| 124 |
negative_prompt_2=negative_prompt_2,
|
|
|
|
| 233 |
step=1,
|
| 234 |
value=25,
|
| 235 |
)
|
| 236 |
+
with gr.Row():
|
| 237 |
+
strength_img2img = gr.Slider(
|
| 238 |
+
info="Strength for Img2Img",
|
| 239 |
+
label="Strength",
|
| 240 |
+
minimum=0,
|
| 241 |
+
maximum=1,
|
| 242 |
+
step=0.01,
|
| 243 |
+
value=0.7,
|
| 244 |
+
)
|
| 245 |
|
| 246 |
gr.Examples(
|
| 247 |
examples=examples,
|
|
|
|
| 322 |
height,
|
| 323 |
guidance_scale_base,
|
| 324 |
num_inference_steps_base,
|
| 325 |
+
strength_img2img,
|
| 326 |
use_vae,
|
| 327 |
use_lora,
|
| 328 |
model,
|