Skip to content

fix: 修复 Anima 模型下载脚本创建嵌套目录的问题#23

Merged
wochenlong merged 1 commit into
wochenlong:mainfrom
niangao2331:fix/anima-model-download-path
May 21, 2026
Merged

fix: 修复 Anima 模型下载脚本创建嵌套目录的问题#23
wochenlong merged 1 commit into
wochenlong:mainfrom
niangao2331:fix/anima-model-download-path

Conversation

@niangao2331
Copy link
Copy Markdown
Collaborator

Fixes #22

发现

反馈 Download-Anima-Model.bat 在下载 Anima 模型时,会在训练器目录内再次创建一层 SD-Trainer,形成类似 SD-Trainer-v2.3.0\SD-Trainer\SD-Trainer 的套娃目录。

排查后发现,脚本原先固定使用 %~dp0SD-Trainer\sd-models\anima 作为模型保存目录。当 bat 文件本身已经位于 SD-Trainer 目录内时,这个固定拼接会把路径变成 SD-Trainer\SD-Trainer\sd-models\anima

改动

  • 下载脚本启动时先判断自身所在位置。
  • 如果当前目录存在 gui.py,则认为当前目录就是训练器目录。
  • 如果当前目录存在 SD-Trainer\gui.py,则认为当前目录是整合包根目录。
  • 找不到训练器目录时直接报错退出,避免静默创建错误目录。
  • 保留下载的三个 Anima 模型文件和 WebUI 中填写的相对路径提示。

预期效果

无论用户从整合包根目录运行 Download-Anima-Model.bat,还是把它放在 SD-Trainer 目录内运行,模型都会下载到正确的 sd-models\anima 目录,不会再生成 SD-Trainer\SD-Trainer 嵌套目录。

Copy link
Copy Markdown
Owner

@wochenlong wochenlong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

修复思路正确:根据 bat 所在位置解析训练器根目录,避免固定拼接 SD-Trainer 导致套娃路径。已确认改动范围只影响 Download-Anima-Model.bat 模板,和当前启动脚本拆分无冲突。后续可再补回中英双语提示,但不阻塞合并。

@wochenlong wochenlong merged commit eff0373 into wochenlong:main May 21, 2026
wochenlong added a commit that referenced this pull request May 22, 2026
- Prefetch wd14-convnextv2-v2 on install-cn, run_gui_source, and portable build/launch
- Add install_preflight.ps1; portable launchers under scripts/portable/
- Move legacy CLI/notebooks; autodl scripts under scripts/autodl/; docs layout cleanup
- CONTRIBUTORS: credit niangao2331 for Download-Anima-Model.bat fix (#23)

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Download-Anima-Model.bat 会生成嵌套 SD-Trainer 目录

2 participants