updated debugging messages
Browse files
app.py
CHANGED
|
@@ -47,13 +47,18 @@ def chat(image_in, in_steps, in_guidance_scale, in_img_guidance_scale, image_hid
|
|
| 47 |
#image_in = Image.open(img_name) #("edited_image.png") #(img_nm)
|
| 48 |
edited_image = pipe(prompt, image=image_hid, num_inference_steps=int(in_steps), guidance_scale=float(in_guidance_scale), image_guidance_scale=float(in_img_guidance_scale)).images[0]
|
| 49 |
if os.path.exists(img_name):
|
|
|
|
| 50 |
os.remove(img_name)
|
| 51 |
edited_image.save(img_name) #, overwrite=True)
|
|
|
|
| 52 |
else:
|
| 53 |
print("FIRST PASS")
|
| 54 |
seed = random.randint(0, 1000000)
|
| 55 |
img_name = f"./edited_image_{seed}.png"
|
| 56 |
edited_image = pipe(prompt, image=image_in, num_inference_steps=int(in_steps), guidance_scale=float(in_guidance_scale), image_guidance_scale=float(in_img_guidance_scale)).images[0]
|
|
|
|
|
|
|
|
|
|
| 57 |
edited_image.save(img_name) #, overwrite=True) #("/tmp/edited_image.png") #(img_nm)
|
| 58 |
counter_out += 1
|
| 59 |
history = history or []
|
|
|
|
| 47 |
#image_in = Image.open(img_name) #("edited_image.png") #(img_nm)
|
| 48 |
edited_image = pipe(prompt, image=image_hid, num_inference_steps=int(in_steps), guidance_scale=float(in_guidance_scale), image_guidance_scale=float(in_img_guidance_scale)).images[0]
|
| 49 |
if os.path.exists(img_name):
|
| 50 |
+
print("***Image exists and will be deleted***")
|
| 51 |
os.remove(img_name)
|
| 52 |
edited_image.save(img_name) #, overwrite=True)
|
| 53 |
+
counter_out += 1
|
| 54 |
else:
|
| 55 |
print("FIRST PASS")
|
| 56 |
seed = random.randint(0, 1000000)
|
| 57 |
img_name = f"./edited_image_{seed}.png"
|
| 58 |
edited_image = pipe(prompt, image=image_in, num_inference_steps=int(in_steps), guidance_scale=float(in_guidance_scale), image_guidance_scale=float(in_img_guidance_scale)).images[0]
|
| 59 |
+
if os.path.exists(img_name):
|
| 60 |
+
print("***First PASS:Image exists and will be deleted***")
|
| 61 |
+
os.remove(img_name)
|
| 62 |
edited_image.save(img_name) #, overwrite=True) #("/tmp/edited_image.png") #(img_nm)
|
| 63 |
counter_out += 1
|
| 64 |
history = history or []
|