Update app.py
Browse files
app.py
CHANGED
@@ -24,7 +24,7 @@ img_pipe = StableDiffusionImg2ImgPipeline.from_pretrained("runwayml/stable-diffu
|
|
24 |
img_pipe.to(device)
|
25 |
|
26 |
source_img = gr.Image(source="upload", type="filepath", label="init_img | 512*512 px")
|
27 |
-
gallery = gr.Gallery(label="Generated images", show_label=False, elem_id="gallery").style(grid=[
|
28 |
|
29 |
def resize(value,img):
|
30 |
#baseheight = value
|
@@ -42,7 +42,7 @@ def infer(source_img, prompt, guide, steps, seed, strength):
|
|
42 |
source_image = resize(512, source_img)
|
43 |
source_image.save('source.png')
|
44 |
|
45 |
-
images_list = img_pipe([prompt] *
|
46 |
images = []
|
47 |
safe_image = Image.open(r"unsafe.png")
|
48 |
|
|
|
24 |
img_pipe.to(device)
|
25 |
|
26 |
source_img = gr.Image(source="upload", type="filepath", label="init_img | 512*512 px")
|
27 |
+
gallery = gr.Gallery(label="Generated images", show_label=False, elem_id="gallery").style(grid=[1], height="auto")
|
28 |
|
29 |
def resize(value,img):
|
30 |
#baseheight = value
|
|
|
42 |
source_image = resize(512, source_img)
|
43 |
source_image.save('source.png')
|
44 |
|
45 |
+
images_list = img_pipe([prompt] * 1, init_image=source_image, strength=strength, guidance_scale=guide, num_inference_steps=steps)
|
46 |
images = []
|
47 |
safe_image = Image.open(r"unsafe.png")
|
48 |
|