
Stable Video Diffusion 1.1 "Image-to-Video"ãGoogle Colabã§è©ŠãïŒ
Stability AI瀟ãã ææ°ã®åç»çæã¢ãã«ãStable Video Diffusion 1.1 Image-to-VideoãããªãªãŒã¹ãããŸããã

Stable Video Diffusion (SVD) 1.1 Image-to-Video ã¯ã鿢ç»åãæ¡ä»¶ãã¬ãŒã ãšããŠåã蟌ã¿ãããããåç»ãçæããæ¡æ£ã¢ãã«ã§ãã
ååã®åæãªãªãŒã¹ã«ã€ããŠãAICU mediaã§ã¯ Google Colabã§åäœãããµã³ãã«ãšåç»ãå
¬éããŸããã
以äžãå ¬åŒHuggingFaceã®ã¢ãã«ã«ãŒããã玹ä»ããŸã
ã¢ãã«ã®èª¬æ
(SVD 1.1) Image-to-Videoã¯ãç»åã®æ¡ä»¶ä»ãããçããããªã¯ãªãããçæããããã«åŠç¿ãããæœåšæ¡æ£ã¢ãã«ã§ãã
ãã®ã¢ãã«ã¯ãSVD Image-to-Video [25 frames]ãã埮調æŽããããåããµã€ãºã®ã³ã³ããã¹ããã¬ãŒã ãäžããããè§£å床1024x576ã®25ãã¬ãŒã ãçæããããã«èšç·ŽãããŸããã
埮調æŽã¯ããã€ããŒãã©ã¡ãŒã¿ã調æŽããããšãªãåºåã®äžè²«æ§ãåäžãããããã«ã6FPSãš ã¢ãŒã·ã§ã³ãã±ãã Id 127 ã§åºå®ãããæ¡ä»¶ã§å®è¡ãããŸããããããã®æ¡ä»¶ã¯ãŸã 調æŽå¯èœã§ãããåé€ãããŠããŸãããåºå®ã³ã³ãã£ã·ã§ãã³ã°èšå®ä»¥å€ã®ããã©ãŒãã³ã¹ã¯ãSVD 1.0ãšæ¯èŒããŠç°ãªãå ŽåããããŸãã
mkshingããã«ãããã¢ãå ¬éããã
mkshingããã®åæã«ãããã¢ãšæãããã³ãŒããå ¬éãããŠããŸã
SVD 1.1 seems to have been released ð
â mkshing (@mk1stats) February 4, 2024
HF: https://t.co/95K8npSg45
For those who can't wait for the official announcement, you can try it on this colab for free.
Colab: https://t.co/SiYDRzLxTA
1/3#SVD https://t.co/FXC3wllPdB pic.twitter.com/yPrL3SIOps
SVD1.1ããªãªãŒã¹ãããããã§ãðã
HF: http://huggingface.co/stabilityai/stable-video-diffusion-img2vid-xt-1-1
æ£åŒçºè¡šãåŸ ã¡ãããªãæ¹ã¯ããã¡ãã®ã³ã©ãã§ç¡æäœéšã§ããŸãã
ColabïŒhttp://colab.research.google.com/github/mkshing/notebooks/blob/main/stable_video_diffusion_img2vid.ipynb
1/3
I found it interesting to use img2vid for ads. The background can be motionable while the caption doesn't change much.
â mkshing (@mk1stats) February 4, 2024
*init image is taken from https://t.co/1lEe2Cs8Bg
2/3 pic.twitter.com/eGr4QscZk8
img2vidãåºåã«äœ¿ããšé¢çœãã§ãããèæ¯ã¯åããããããã£ãã·ã§ã³ã¯ããŸãå€ãããŸããã*åæç»åã¯https://cotori-sha.com/works/345ã
*init image is taken from: https://t.co/99SFCBqLu3
â mkshing (@mk1stats) February 4, 2024
3/3 pic.twitter.com/ROaa3ruQI2
AICU mediaã®ç·šééšã§ãåãçµãã§ã¿ãŸããïŒ
ã©ããªã«å¿ãããŠãæ¥ãªãªãªãŒã¹ã§ãæãåãããã°æ°ãããŸãªã ãããã¯ããCEOããã¡ã¢ãªãè¶³ããªãâïŒããšèšããªããäžž1æ¥åãçµãã§ããŸããããã€ãã«åããããšããããšã§ãæåãããããªã®ã§è§£èª¬ã§ãã
https://twitter.com/o_ob/status/1754520368222732386
SVD1.1ãããããïŒ pic.twitter.com/X2HrDv0yf6
â Dr.(Shirai)Hakase ãããã¯ãã (@o_ob) February 5, 2024
æºåãããã®
Google Colabã®ãã¢ã³ãŒã
https://colab.research.google.com/github/mkshing/notebooks/blob/main/stable_video_diffusion_img2vid.ipynb
ã䜿ãã®Googleã¢ã«ãŠã³ãã§ãOpen in ColabãããŠãã ãããä»åã¯ææçãããããããŸãã
HuggingFaceã®ã¢ã«ãŠã³ã
éäžã§HuggingFaceã¢ã¯ã»ã¹ããŒã¯ã³ãå¿
èŠã«ãªããŸã
https://huggingface.co/settings/tokens
ããååŸããŸããã

HuggingFaceã®TokenããŒãžã§ããŒã¯ã³ãã³ããŒããŠãTokenã«è²Œãä»ããLoginããæŒããŸãã

/content/generative-models/assets/test_image.png

ãã¡ãã«ãµã³ãã«ç»åããããŸãããç¡èŠããŠé²ããŠæ§ããŸããã
T4(ColabããªãŒãã©ã³)ã§ãäžå¿åãããã§ããã25ãã¬ãŒã ã®åç»çæã§çŽ10åãããããã§ãããŸãç·šéã§ã®å®éšã§ã¯çæäžã«15GBã®GPU RAMãè¶ ããããšãããã忢ããŠããŸãããšãå€ããããŸããã

ããã¯å¥®çºããŠA100ã§å®éšããŠã¿ãŸãã


A100ã®å Žåã¯ã ããã1åçšåºŠã§çæã§ããŠããŸãã
ã¡ãªã¿ã«A100ã䜿ããšã1ã¶æã®ã³ã³ãã¥ãŒãã£ã³ã°ãŠãããã®å²åœã13æéçšåºŠã§äœ¿ããã£ãŠããŸããŸãã®ã§ç·åŒµæããããŸãïŒ

çµæã¯âŠïŒ
YouTubeã§ãéãããŸãïŒ
Stable Video Diffusion 1.1 first trial
https://youtu.be/xgeRSi1PdEo
ãæ°è»œã«ã·ã§ã¢ã©ãã
å
šäœçã«å®å®æ§ãå¢ããŠããå°è±¡ã§ãã
mkshingããã®ãææã«ãããšãããããŽã®ãããªãã®ã¯å®å
šã«å®å®ããŠããŸããå¥ã®ã¬ã€ã€ãŒãšããŠæ±ãããŠãããããªæãã§ããããã
ãŸãååã¯ã¢ãã¡ã£ãœãããžã¿ã«ã€ã©ã¹ãã¬ãŒã·ã§ã³ã¯ãã³ã®ã¿ã«ãªã£ãŠããŸã£ãããšèŠæãªå°è±¡ã§ããããSVD1.1ã¯2-3åçæãããšæã
äžæã«çæãããŠããŸããåãå
¥åã§ãäœåºŠã詊ããŠã¿ãã®ãè¯ãããã§ãã
ãã¡ããSVDåçã«ããçæçµæã§ã
è¬èŸïŒäŸ¡å€ãããœãŒã¹ã³ãŒããå
¬éããŠããã ããMkshingããã«æè¬ã§ã
è£è¶³ïŒãœãŒã¹ã³ãŒãã®è§£èª¬
def sample(
input_path: str = "assets/test_image.png", # Can either be image file or folder with image files
resize_image: bool = False,
num_frames: Optional[int] = None,
num_steps: Optional[int] = None,
fps_id: int = 6,
motion_bucket_id: int = 127,
cond_aug: float = 0.02,
seed: int = 23,
decoding_t: int = 14, # Number of frames decoded at a time! This eats most VRAM. Reduce if necessary.
device: str = "cuda",
output_folder: Optional[str] = "/content/outputs",
skip_filter: bool = False,
):
"""
Simple script to generate a single sample conditioned on an image `input_path` or multiple images, one for each
image file in folder `input_path`. If you run out of VRAM, try decreasing `decoding_t`.
"""ã©ãããdecoding_t ãæžããã°VRAMã®æ¶è²»ã¯æããããããã§ãã
ã¢ãŒã·ã§ã³ãã±ããIDãFPSã«ã€ããŠãèšèŒããããŸãã
if resize_image and image.size != (1024, 576):
print(f"Resizing {image.size} to (1024, 576)")
image = TF.resize(TF.resize(image, 1024), (576, 1024))ç»åãµã€ãºã¯1024x576ã«ãªãµã€ãºãããŸãã64ã®åæ°ã§ããããšãæ±ããããŸãã
èŠåïŒæäŸãããã³ã³ãã£ã·ã§ãã³ã°ãã¬ãŒã ã¯576x1024ã§ã¯ãããŸãããããã¯ã¢ãã«ã576x1024ã§ãããã¬ãŒãã³ã°ãããŠããªããããæé©ãªããã©ãŒãã³ã¹ã§ã¯ãããŸãããcond_augãå¢ããããšãæ€èšããŠãã ããã
ã¢ãã«èªäœã1024x576ã§ãã¬ãŒãã³ã°ãããŠããããã§ãã
ãã©ã¡ãŒã¿ã¯Advanced Optionsã§æž¡ããŸãã

ã©ã³ãã ã·ãŒããæå®ã§ããã®ã§ãå®å®ãããããã°åºå®ããã°ãããããããŸããã
GPUãT4ã«ããŠãã£ããæ¢çŽ¢ããŠãããŸãããïŒ