🚀 AnimateLCM
AnimateLCMは、テキストを入力すると動画を生成することができるモデルです。
🚀 クイックスタート
AnimateLCMをDiffusersと共に使用する方法を説明します。
💻 使用例
基本的な使用法
import torch, torch_xla, diffusers
motion_adapter = diffusers.MotionAdapter.from_pretrained('chaowenguo/AnimateLCM', torch_dtype=torch.bfloat16, variant='fp16', use_safetensors=True)
vae = diffusers.AutoencoderKL.from_single_file('https://huggingface.co/chaowenguo/pal/blob/main/vae-ft-mse-840000-ema-pruned.safetensors', torch_dtype=torch.bfloat16, use_safetensors=True)
pipe = diffusers.AnimateDiffPipeline.from_single_file('https://huggingface.co/chaowenguo/pal/blob/main/chilloutMix-Ni.safetensors', config='chaowenguo/stable-diffusion-v1-5', safety_checker=None, use_safetensors=True, torch_dtype=torch.bfloat16, motion_adapter=motion_adapter, vae=vae).to(torch_xla.core.xla_model.xla_device())
pipe.scheduler = diffusers.LCMScheduler.from_config(pipe.scheduler.config, beta_schedule='linear')
pipe.load_lora_weights('chaowenguo/AnimateLCM', weight_name='AnimateLCM_sd15_t2v_lora.safetensors')
pipe.enable_vae_slicing()
output = pipe(prompt="A full body gorgeous smiling slim young cleavage robust boob japanese girl, wearing white deep V bandeau pantie, lying on back on white bed, befautiful face, hands with five fingers, best quality, extremely detailed, HD, ultra-realistic, 8K, HQ, masterpiece, trending on artstation, art, smooth", negative_prompt="nipple, dudou, shirt, shawl, hat, sock, sleeve, monochrome, dark background, longbody, lowres, bad anatomy, bad hands, fused fingers, missing fingers, too many fingers, extra digit, fewer difits, cropped, worst quality, low quality, deformed body, bloated, ugly, unrealistic, extra hands and arms", height=912, num_frames=16, guidance_scale=3, num_inference_steps=8, generator=torch.manual_seed(0), context_frames=8)
diffuser.utils.export_to_video(output.frames[0], "animatelcm.mp4")
高度な使用法
import torch, torch_xla, diffusers
motion_adapter = diffusers.MotionAdapter.from_pretrained('chaowenguo/AnimateLCM', torch_dtype=torch.bfloat16, variant='fp16', use_safetensors=True)
vae = diffusers.AutoencoderKL.from_single_file('https://huggingface.co/chaowenguo/pal/blob/main/vae-ft-mse-840000-ema-pruned.safetensors', torch_dtype=torch.bfloat16, use_safetensors=True)
pipe = diffusers.AnimateDiffPipeline.from_single_file('https://huggingface.co/chaowenguo/pal/blob/main/chilloutMix-Ni.safetensors', config='chaowenguo/stable-diffusion-v1-5', safety_checker=None, use_safetensors=True, torch_dtype=torch.bfloat16, motion_adapter=motion_adapter, vae=vae).to(torch_xla.core.xla_model.xla_device())
pipe.scheduler = diffusers.LCMScheduler.from_config(pipe.scheduler.config, beta_schedule='linear')
pipe.load_lora_weights('chaowenguo/AnimateLCM', weight_name='AnimateLCM_sd15_t2v_lora.safetensors')
pipe.enable_vae_slicing()
output = pipe(prompt="A full body gorgeous smiling slim young cleavage robust boob japanese girl, wearing white deep V bandeau pantie, lying on back on white bed, befautiful face, hands with five fingers, best quality, extremely detailed, HD, ultra-realistic, 8K, HQ, masterpiece, trending on artstation, art, smooth", negative_prompt="nipple, dudou, shirt, shawl, hat, sock, sleeve, monochrome, dark background, longbody, lowres, bad anatomy, bad hands, fused fingers, missing fingers, too many fingers, extra digit, fewer difits, cropped, worst quality, low quality, deformed body, bloated, ugly, unrealistic, extra hands and arms", height=1024, num_frames=24, guidance_scale=4, num_inference_steps=12, generator=torch.manual_seed(1), context_frames=12)
diffuser.utils.export_to_video(output.frames[0], "animatelcm_advanced.mp4")