保存 civitai 的 .safetensors 模型的 metadata / Save metadata of .safetensors files on civitai

详情

模型描述

.safetensors 文件的 metadata 字段可能保存了模型的训练数据,包括学习率、数据集重复次数等参数,使用本脚本可以直接从 civitai.com 的模型页面导出模型的 metadata。

这是一个简单的脚本,允许你从 civitai.com 导出 .safetensors 文件的 metadata。metadata 可能包含一些训练参数,例如学习率、数据集重复次数等,你可以将这些参数用于你的项目或任何你想要的地方。

使用方法 / Usage

1. 安装油猴扩展 / Install Tampermonkey

https://www.tampermonkey.net/

2. 从 GreasyFork 或者 Github 安装脚本 / Install my script from GreasyFork or Github

[GreasyFork]

[Github]

3. 刷新网页,进入一个模型页面 / Refresh the page and go to a model page

在按钮旁边应该有个复制按钮 / You can see there is a copying button alongside the download button

4. 点击该按钮即可导出模型的 metadata / Click the copying button and then you can export the metadata of the model

5. metadata 中可能有用的 keys / useful keys of metadata

  • "ss_learning_rate": 学习率,控制模型训练时权重更新的速度。

  • "ss_num_epochs": 训练的总 epoch 数,指定模型将对数据集进行多少次完整的训练循环。

  • "ss_num_train_images": 训练图像数,指定用于训练的图像数量。

  • "ss_text_encoder_lr": 文本编码器学习率,控制文本编码器网络在训练过程中的权重更新速度。

  • and more!

如果你觉得这个脚本对你有帮助的话可以点个 star / Please give me a star if you think this script is useful :).

👉[Github]

从其他网站读取 .safetensors 文件的元数据

参见 SafetensorsHeaderReader 类

此模型生成的图像

未找到图像。