---
title: novelai-v1-model
canonical_url: "https://www.modelscope.cn/models/licyks/novelai-v1-model"
md_url: "https://www.modelscope.cn/models/licyks/novelai-v1-model.md"
repository: licyks/novelai-v1-model
last_updated: 2024-08-23
license: creativeml-openrail-m
pipeline_tag: text-to-image-synthesis
tasks:
  - text-to-image-synthesis
parameters: 7.5B
tensor_type:
  - F32
  - I64
  - I32
  - F16
library_name:
  - safetensors
  - pytorch
frameworks:
  - Pytorch
downloads: 732
stars: 0
---

# novelai-v1-model

> novelai-v1-model - licyks 在 ModelScope 开源的模型。NovelAI Diffusion V1 将 NovelAI 官方公布的 V1 版本的模型从 diffusers 格式转换成 checkpoint 格式。

licyks/novelai-v1-model 是 ModelScope 魔搭社区上的 7.5B 参数text-to-image-synthesis模型，采用 creativeml-openrail-m 许可。

- **Repository**: licyks/novelai-v1-model
- **License**: creativeml-openrail-m
- **Tasks**: text-to-image-synthesis
- **Parameters**: 7.5B
- **Downloads**: 732
- **Stars**: 0
- **Last updated**: 2024-08-23

Source: https://www.modelscope.cn/models/licyks/novelai-v1-model

---

# NovelAI Diffusion V1
将 NovelAI 官方公布的 V1 版本的模型从 diffusers 格式转换成 checkpoint 格式。


## 模型类型
- [nai-anime-v1-curated](https://huggingface.co/NovelAI/nai-anime-v1-full)
- [nai-furry-beta-v1.3](https://huggingface.co/NovelAI/nai-furry-beta-v1.3)
- [nai-anime-v1-curated](https://huggingface.co/NovelAI/nai-anime-v1-curated)


## 转换模型
使用了 [HCP-Diffusion](https://github.com/IrisRainbowNeko/HCP-Diffusion) 进行模型转换。


### 安装依赖
```bash
pip install torch==2.3.0+cu118 torchvision==0.18.0+cu118 torchaudio==2.3.0+cu118 --find-links https://download.pytorch.org/whl/torch_stable.html
pip install hcpdiff huggingface_hub
```


### 下载模型
```python
import os
import shutil
from huggingface_hub import hf_hub_download, snapshot_download


local_path = os.getcwd()

snapshot_download(
    repo_id = "NovelAI/nai-anime-v1-full",
    local_dir = os.path.join(local_path, "nai-full")
)
snapshot_download(
    repo_id = "NovelAI/nai-furry-beta-v1.3",
    local_dir = os.path.join(local_path, "nai-curated")
)
snapshot_download(
    repo_id = "NovelAI/nai-anime-v1-curated",
    local_dir = os.path.join(local_path, "nai-beta")
)

hf_hub_download(
    repo_id = "CompVis/stable-diffusion-v1-4",
    filename = "text_encoder/model.safetensors",
    local_dir = os.path.join(local_path, "nai-full", "text_encoder")
)

os.makedirs(os.path.join(local_path, "nai-curated", "text_encoder"), exist_ok = True)
os.makedirs(os.path.join(local_path, "nai-beta", "text_encoder"), exist_ok = True)

shutil.copyfile(os.path.join(local_path, "nai-full", "text_encoder", "model.safetensors"), os.path.join(local_path, "nai-curated", "text_encoder", "model.safetensors"))
shutil.copyfile(os.path.join(local_path, "nai-full", "text_encoder", "model.safetensors"), os.path.join(local_path, "nai-beta", "text_encoder", "model.safetensors"))
```


### 转换模型
```bash
# FP32
python -m hcpdiff.tools.diffusers2sd --use_safetensors --model_path ./nai-beta --save_path ./nai-furry-beta-v1.3-fp32.safetensors
python -m hcpdiff.tools.diffusers2sd --use_safetensors --model_path ./nai-full --save_path ./nai-anime-v1-full-fp32.safetensors
python -m hcpdiff.tools.diffusers2sd --use_safetensors --model_path ./nai-curated --save_path ./nai-anime-v1-curated-fp32.safetensors

# FP16
python -m hcpdiff.tools.diffusers2sd --half --use_safetensors --model_path ./nai-beta --save_path ./nai-furry-beta-v1.3-fp16.safetensors
python -m hcpdiff.tools.diffusers2sd --half --use_safetensors --model_path ./nai-full --save_path ./nai-anime-v1-full-fp16.safetensors
python -m hcpdiff.tools.diffusers2sd --half --use_safetensors --model_path ./nai-curated --save_path ./nai-anime-v1-curated-fp16.safetensors
```
