import gradio as gr with gr.Blocks() as demo: init_img = gr.Image() def create_example(input_list): return gr.Examples( examples=input_list, inputs=[ init_img, ], ) create_example( [ [ './__assets__/image_animation/yiming/yiming.jpeg', './__assets__/image_animation/yiming/yiming.mp4', '1boy in Christmas suit, lift a Christmas gift', 'wrong white balance, dark, sketches,worst quality,low quality, deformed, distorted, disfigured, bad eyes, wrong lips,weird mouth, bad teeth, mutated hands and fingers, bad anatomy,wrong anatomy, amputation, extra limb, missing limb, floating,limbs, disconnected limbs, mutation, ugly, disgusting, bad_pictures, negative_hand-neg', '3d_cartoon', 2, ], [ './__assets__/image_animation/yanhong/yanhong.png', './__assets__/image_animation/yanhong/yanhong.mp4', '1girl lift a Christmas gift', 'wrong white balance, dark, sketches,worst quality,low quality, deformed, distorted, disfigured, bad eyes, wrong lips,weird mouth, bad teeth, mutated hands and fingers, bad anatomy,wrong anatomy, amputation, extra limb, missing limb, floating,limbs, disconnected limbs, mutation, ugly, disgusting, bad_pictures, negative_hand-neg', '3d_cartoon', 2, ], ], ) # with gr.Accordion('More Examples for Style Transfer', open=False): # create_example([ # [ # './__assets__/image_animation/style_transfer/anya/anya.jpg', # './__assets__/image_animation/style_transfer/anya/2.mp4', # '1girl open mouth ', # 'wrong white balance, dark, sketches,worst quality,low quality, deformed, distorted, disfigured, bad eyes, wrong lips,weird mouth, bad teeth, mutated hands and fingers, bad anatomy,wrong anatomy, amputation, extra limb, missing limb, floating,limbs, disconnected limbs, mutation, ugly, disgusting, bad_pictures, negative_hand-neg', # '3d_cartoon', # 3, # ], # [ # './__assets__/image_animation/magnitude/genshin/genshin.jpg', # './__assets__/image_animation/magnitude/genshin/3.mp4', # 'cherry blossoms in the wind, raidenshogundef, yaemikodef, best quality, 4k', # 'wrong white balance, dark, sketches,worst quality,low quality, deformed, distorted, disfigured, bad eyes, wrong lips,weird mouth, bad teeth, mutated hands and fingers, bad anatomy,wrong anatomy, amputation, extra limb, missing limb, floating,limbs, disconnected limbs, mutation, ugly, disgusting, bad_pictures, negative_hand-neg', # '3d_cartoon', # 3, # ], # ]) # with gr.Accordion('More Examples for Prompt Changing', open=False): # create_example( # [ # [ # './__assets__/image_animation/real/lighthouse.jpg', # './__assets__/image_animation/real/1.mp4', # 'lightning, lighthouse', # 'wrong white balance, dark, sketches,worst quality,low quality, deformed, distorted, disfigured, bad eyes, wrong lips,weird mouth, bad teeth, mutated hands and fingers, bad anatomy,wrong anatomy, amputation, extra limb, missing limb, floating,limbs, disconnected limbs, mutation, ugly, disgusting, bad_pictures, negative_hand-neg', # 'realistic', # 1, # ], # [ # './__assets__/image_animation/real/lighthouse.jpg', # './__assets__/image_animation/real/2.mp4', # 'sun rising, lighthouse', # 'wrong white balance, dark, sketches,worst quality,low quality, deformed, distorted, disfigured, bad eyes, wrong lips,weird mouth, bad teeth, mutated hands and fingers, bad anatomy,wrong anatomy, amputation, extra limb, missing limb, floating,limbs, disconnected limbs, mutation, ugly, disgusting, bad_pictures, negative_hand-neg', # 'realistic', # 1, # ], # [ # './__assets__/image_animation/real/lighthouse.jpg', # './__assets__/image_animation/real/3.mp4', # 'fireworks, lighthouse', # 'wrong white balance, dark, sketches,worst quality,low quality, deformed, distorted, disfigured, bad eyes, wrong lips,weird mouth, bad teeth, mutated hands and fingers, bad anatomy,wrong anatomy, amputation, extra limb, missing limb, floating,limbs, disconnected limbs, mutation, ugly, disgusting, bad_pictures, negative_hand-neg', # 'realistic', # 1, # ], # [ # './__assets__/image_animation/rcnz/harry.png', # './__assets__/image_animation/rcnz/1.mp4', # '1boy smiling', # 'wrong white balance, dark, sketches,worst quality,low quality, deformed, distorted, disfigured, bad eyes, wrong lips,weird mouth, bad teeth, mutated hands and fingers, bad anatomy,wrong anatomy, amputation, extra limb, missing limb, floating,limbs, disconnected limbs, mutation, ugly, disgusting, bad_pictures, negative_hand-neg', # '3d_cartoon', # 2 # ], # [ # './__assets__/image_animation/rcnz/harry.png', # './__assets__/image_animation/rcnz/2.mp4', # '1boy playing magic fire', # 'wrong white balance, dark, sketches,worst quality,low quality, deformed, distorted, disfigured, bad eyes, wrong lips,weird mouth, bad teeth, mutated hands and fingers, bad anatomy,wrong anatomy, amputation, extra limb, missing limb, floating,limbs, disconnected limbs, mutation, ugly, disgusting, bad_pictures, negative_hand-neg', # '3d_cartoon', # 2 # ], # [ # './__assets__/image_animation/rcnz/harry.png', # './__assets__/image_animation/rcnz/3.mp4', # '1boy is waving hands', # 'wrong white balance, dark, sketches,worst quality,low quality, deformed, distorted, disfigured, bad eyes, wrong lips,weird mouth, bad teeth, mutated hands and fingers, bad anatomy,wrong anatomy, amputation, extra limb, missing limb, floating,limbs, disconnected limbs, mutation, ugly, disgusting, bad_pictures, negative_hand-neg', # '3d_cartoon', # 2 # ] # ]) with gr.Accordion('Examples for Motion Magnitude', open=False): create_example( [ [ './__assets__/image_animation/magnitude/labrador.png', './__assets__/image_animation/magnitude/1.mp4', 'cherry blossoms in the wind, raidenshogundef, yaemikodef, best quality, 4k', 'wrong white balance, dark, sketches,worst quality,low quality, deformed, distorted, disfigured, bad eyes, wrong lips,weird mouth, bad teeth, mutated hands and fingers, bad anatomy,wrong anatomy, amputation, extra limb, missing limb, floating,limbs, disconnected limbs, mutation, ugly, disgusting, bad_pictures, negative_hand-neg', '3d_cartoon', 1, ], [ './__assets__/image_animation/magnitude/labrador.png', './__assets__/image_animation/magnitude/2.mp4', 'cherry blossoms in the wind, raidenshogundef, yaemikodef, best quality, 4k', 'wrong white balance, dark, sketches,worst quality,low quality, deformed, distorted, disfigured, bad eyes, wrong lips,weird mouth, bad teeth, mutated hands and fingers, bad anatomy,wrong anatomy, amputation, extra limb, missing limb, floating,limbs, disconnected limbs, mutation, ugly, disgusting, bad_pictures, negative_hand-neg', '3d_cartoon', 2, ], [ './__assets__/image_animation/magnitude/labrador.png', './__assets__/image_animation/magnitude/3.mp4', 'cherry blossoms in the wind, raidenshogundef, yaemikodef, best quality, 4k', 'wrong white balance, dark, sketches,worst quality,low quality, deformed, distorted, disfigured, bad eyes, wrong lips,weird mouth, bad teeth, mutated hands and fingers, bad anatomy,wrong anatomy, amputation, extra limb, missing limb, floating,limbs, disconnected limbs, mutation, ugly, disgusting, bad_pictures, negative_hand-neg', '3d_cartoon', 3, ] ]) demo.launch()