File size: 4,724 Bytes
206f83f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b20ceb0
206f83f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
---
library_name: diffusers
license: apache-2.0
language:
- ja
pipeline_tag: image-to-image
tags:
- stable-diffusion
---
# ๐ŸŸ Evo-Nishikie-v1

๐Ÿค— [Models](https://huggingface.co/SakanaAI) | ๐Ÿ“ [Blog](https://sakana.ai/evo-ukiyoe/) | ๐Ÿฆ [Twitter](https://twitter.com/SakanaAILabs)


**Evo-Nishikie-v1** is an experimental education-purpose Ukiyoe colorization model. The model is a ControlNet trained with [Evo-Ukiyoe](https://huggingface.co/SakanaAI/Evo-Ukiyoe-v1/). 
The dataset used to train the model came from Ukiyoe images belonged to [Ritsumeikan University, Art Research Center](https://www.arc.ritsumei.ac.jp/). The sample data is belonged to the [Pre-Modern Japanese Text dataset](http://codh.rois.ac.jp/pmjt/), 
owned by [National Institute of Japanese Literature](https://www.nijl.ac.jp/en/) and curated by [ROIS-DS Center for Open Data in the Humanities](http://codh.rois.ac.jp/).


Please refer to our [blog](https://sakana.ai/evo-ukiyoe/) for more details. 



## Usage

Use the code below to get started with the model.


<details>
<summary> Click to expand </summary>

1. Git clone this model card
   ```
   git clone https://huggingface.co/SakanaAI/Evo-Nishikie-v1
   ```
2. Install git-lfs if you don't have it yet.
   ```
   sudo apt install git-lfs
   git lfs install
   ```
3. Create conda env
   ```
   conda create -n evo-nishikie python=3.11
   conda activate evo-nishikie
   ```
4. Install packages
   ```
   cd Evo-Nishikie-v1
   pip install -r requirements.txt
   ```
5. Run
   ```python
   import torch
   from io import BytesIO
   from PIL import Image
   import requests
   from evo_nishikie_v1 import load_evo_nishikie
   
   #Get image from URL
   #url = "https://huggingface.co/spaces/SakanaAI/Evo-Nishikie/resolve/main/sample2.jpg"
   #original_image = Image.open(BytesIO(requests.get(url).content))
   
   #Use local image
   original_image = Image.open('test.jpg')
   
   # Generate
   device = "cuda"
   pipe, processor = load_evo_nishikie(device)
   images = pipe(
        prompt="็€็‰ฉใ‚’็€ใŸๅฅณๆ€งใŒใ€่ตคใ‚“ๅŠใ‚’ๆŠฑใˆใ€ใ‚‚ใ†ไธ€ไบบใฎๅญใฉใ‚‚ใŒๆ‰‹ๆŠผใ—่ปŠใ‚’ๅผ•ใ„ใฆใ„ใพใ™ใ€‚่ƒŒๆ™ฏใซใฏๆœจใŒใ‚ใ‚Šใพใ™ใ€‚ๆœ€้ซ˜ๅ“่ณชใฎ่ผปใฎๆตฎไธ–็ตตใ€‚่ถ…่ฉณ็ดฐใ€‚",
        negative_prompt="ๆš—ใ„",
        image=processor(original_image),
        guidance_scale=7.0,
        controlnet_conditioning_scale=0.8,
        num_inference_steps=35,
        num_images_per_prompt=1,
        output_type="pil",
   ).images
   images[0].save("out.png")

   ```

</details>


 
## Model Details

<!-- Provide a longer summary of what this model is. -->

- **Developed by:** [Sakana AI](https://sakana.ai/)
- **Model type:** Diffusion-based image-to-image generative model
- **Language(s):** Japanese
- **Blog:** https://sakana.ai/evo-ukiyoe


## License
The Python script included in this repository is licensed under the [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0).
Please note that the license for the model/pipeline generated by this script is inherited from the source models. 
The sample images used in the code has CC BY SA 4.0 license and is belonged to the Pre-Modern Japanese Text dataset, owned by National Institute of Japanese Literature and curated by ROIS-DS Center for Open Data in the Humanities.

## Uses
This model is provided for research and development purposes only and should be considered as an experimental prototype. 
It is not intended for commercial use or deployment in mission-critical environments. 
Use of this model is at the user's own risk, and its performance and outcomes are not guaranteed. 
Sakana AI shall not be liable for any direct, indirect, special, incidental, or consequential damages, or any loss arising from the use of this model, regardless of the results obtained. 
Users must fully understand the risks associated with the use of this model and use it at their own discretion.


## Acknowledgement

Evo-Nishikie was trained based on Evo-Ukiyoe and Evo-Ukiyoe was trained based on Evo-SDXL-JP. We would like to thank the developers of Evo-SDXL-JP source models for their contributions and for making their work available.
- [SDXL](https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0)
- [Juggernaut-XL-v9](https://huggingface.co/RunDiffusion/Juggernaut-XL-v9)
- [SDXL-DPO](https://huggingface.co/mhdang/dpo-sdxl-text2image-v1)
- [JSDXL](https://huggingface.co/stabilityai/japanese-stable-diffusion-xl)


## Citation

    @misc{Evo-Ukiyoe, 
    url    = {[https://huggingface.co/SakanaAI/Evo-Nishikie-v1](https://huggingface.co/SakanaAI/Evo-Nishikie-v1)}, 
    title  = {Evo-Nishikie}, 
    author = {Clanuwat, Tarin and Shing, Makoto and Imajuku, Yuki and Kitamoto, Asanobu and Akama, Ryo}
    }