ValueError: unet/hotshot_xl.py 在 hotshotco/Hotshot-XL 中不存在

我正在考虑创建一个集成了Hotshot的AI视频生成应用程序。然而,直接从GitHub克隆的inference.py可以正常工作,但在我在构建的应用程序中导入修改后的inference.py时,会出现以下错误。ValueError: unet/hotshot_xl.py 如在 model_index.json 中定义的,在 hotshotco/Hotshot-XL 中不存在,也不是 'diffusers/pipelines' 中的模块。

修改后的 inference.py

def main(pretrained_path='hotshotco/Hotshot-XL',         xformers=False,         spatial_unet_base=None,         lora=None,         output='output_scuba.gif',         steps=30,         prompt='Sasquatch scuba diving, anime style',         negative_prompt='blurry',         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,         scheduler='EulerAncestralDiscreteScheduler',         control_type=None,          controlnet_conditioning_scale=0.7,         control_guidance_start=0.0,         control_guidance_end=1.0,         gif=None,         precision='f16',         autocast=None):        args = argparse.Namespace(        pretrained_path=pretrained_path,        xformers=xformers,        spatial_unet_base=spatial_unet_base,        lora=lora,        output=output,        steps=steps,        prompt=prompt,        negative_prompt=negative_prompt,        seed=seed,        width=width,        height=height,        target_width=target_width,        target_height=target_height,        og_width=og_width,        og_height=og_height,        video_length=video_length,        video_duration=video_duration,        low_vram_mode=low_vram_mode,        scheduler=scheduler,        control_type=control_type,        controlnet_conditioning_scale=controlnet_conditioning_scale,        control_guidance_start=control_guidance_start,        control_guidance_end=control_guidance_end,        gif=gif,        precision=precision,        autocast=autocast    )# 以下与 inference.py 相同

我的应用程序的一些Python代码

if generate_value == 4:            main(pretrained_path='hotshotco/Hotshot-XL',                 xformers=False,                 spatial_unet_base=None,                 lora=None,                 output=filename_vid,                 steps=steps,                 prompt=prompt,                 negative_prompt=negative_prompt,                 seed=455,                 width=width,                 height=height,                 target_width=width,                 target_height=height,                 og_width=width,                 og_height=height,                 video_length=video_length,                 video_duration=1000,                 low_vram_mode=False,                 scheduler='EulerAncestralDiscreteScheduler',                 control_type=None,                 controlnet_conditioning_scale=0.7,                 control_guidance_start=0.0,                 control_guidance_end=1.0,                 gif=None,                 precision=precision,                 autocast=None                )

(这些都是通过DeepL从日文翻译过来的)

我希望在我的应用程序中使用带有提示、负提示、生成视频的长度、精度、宽度和高度作为参数的主函数,然后基于这些参数创建一个gif文件,但出现了错误。


回答:

我找到了这个问题的起因。是运行在py还是python的区别。

# 成功示例:python main.py# 失败示例:py main.py.```

Related Posts

使用LSTM在Python中预测未来值

这段代码可以预测指定股票的当前日期之前的值,但不能预测…

如何在gensim的word2vec模型中查找双词组的相似性

我有一个word2vec模型,假设我使用的是googl…

dask_xgboost.predict 可以工作但无法显示 – 数据必须是一维的

我试图使用 XGBoost 创建模型。 看起来我成功地…

ML Tuning – Cross Validation in Spark

我在https://spark.apache.org/…

如何在React JS中使用fetch从REST API获取预测

我正在开发一个应用程序,其中Flask REST AP…

如何分析ML.NET中多类分类预测得分数组?

我在ML.NET中创建了一个多类分类项目。该项目可以对…

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注