Update app.py
Browse files169 unmodified lines17017117217317417517617717817918018118218318418518618718818928 unmodified lines218219220221222223224225226227228169 unmodified linesreturn gr.Dropdown.update()def resize_image(input_path, output_path, new_width, new_height):# Open the imageimage = Image.open(input_path)# Resize the image while maintaining the aspect ratioimage.resize((new_width, new_height), Image.LANCZOS)# Save the resized image to the specified output pathimage.save(output_path)print("Image resized and saved successfully.")return output_pathdef animate(28 unmodified linesgenerator.manual_seed(seed)init_image = self.resize_image(init_image, 'resized.png', 512, 512)sample = pipeline(prompt_textbox,init_image = init_image,negative_prompt = negative_prompt_textbox,num_inference_steps = 25,guidance_scale = 8.,169 unmodified lines17017117217317417517628 unmodified lines205206207208209210211212213214215216217218219220221222169 unmodified linesreturn gr.Dropdown.update()def animate(28 unmodified linesgenerator.manual_seed(seed)# Open the imageimage = Image.open(init_image)# Resize the image while maintaining the aspect ratioimage.resize((new_width, new_height), Image.LANCZOS)# Save the resized image to the specified output pathimage.save("resized.png")sample = pipeline(prompt_textbox,init_image = "resized.png",negative_prompt = negative_prompt_textbox,num_inference_steps = 25,guidance_scale = 8.,
app.py+10-16