模型描述 (Model Description)
Hotshot-XL是一种基于Stable Diffusion XL的文本转GIF模型,详情可参考来源
运行环境 (Operating environment)
Dependencies and Installation
# git clone the original repository
git clone https://github.com/hotshotco/Hotshot-XL.git
cd Hotshot-XL
# Create a conda environment and activate it
conda create -n hotshotxl python=3.9
conda activate hotshotxl
# Install from requirements.txt
pip install -r requirements.txt
代码范例 (Code example)
from modelscope.models import Model
from modelscope.pipelines import pipeline
input = {
'output': 'output.gif',
'prompt': 'a bulldog in the captains chair of a spaceship, hd, high quality',
'negative_prompt': 'blurry',
'steps': 30,
'seed': 455,
'width': 672,
'height': 384,
'target_width': 512,
'target_height': 512,
'og_width': 1920,
'og_height': 1080,
'video_length': 8,
'video_duration': 1000,
'low_vram_mode': False,
'controlnet_conditioning_scale': 0.7,
'control_guidance_start': 0.0,
'control_guidance_end': 1.0,
'gif': None,
}
model = Model.from_pretrained('zcmaas/cv_hotshot-xl_text-to-gif_base',
control_type=None,
spatial_unet_base=None,
lora=None,
scheduler='EulerAncestralDiscreteScheduler',
precision='f16')
inference = pipeline('hotshotxl-task', model=model)
output = inference(input)
print(f'The result is saved as {output}.')
评论