File size: 2,197 Bytes
f7edcff
 
 
 
 
 
 
 
 
2f51866
 
0b954a7
 
bbd6360
48129f5
 
0b954a7
ff40572
 
d4b33f5
 
4c4e1b7
45d9e55
4c4e1b7
d4b33f5
4407962
45d9e55
8820992
45d9e55
8820992
e791b34
8820992
4407962
45d9e55
b302b2d
2f51866
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b302b2d
 
 
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
---
license: other
license_name: hippojabe1.0
license_link: LICENSE
base_model: runwayml/stable-diffusion-v1-5
pipeline_tag: text-to-image
tags:
- art
- hippo
---

# hippojabe_style_image_generator

- Github: [yizhennn/hippojabe-generator](https://github.com/yizhennn/hippojabe-generator)
- Docs: [https://medium.com/@izzysde](https://medium.com/@izzysde/只用24張圖複製我妹的畫風-dreambooth-微調stable-diffusion-v1-5-實作教學-3c3318362ebb)

  
# 使用 hippojabe 的風格生成卡通畫風圖片

- **模型名稱**:hippojabe_style_image_generator
- **基礎模型**:基於 runwayml/stable-diffusion-v1-5
- **訓練圖像**:[小河馬實用貼圖--手繪風](https://store.line.me/stickershop/product/27243710/zh-Hant?from=sticker)
- **微調方法**:使用 [DreamBooth](https://huggingface.co/docs/diffusers/training/dreambooth) 方法進行文本到圖像的微調
- **微調做法**:[只用24張圖複製我妹的畫風 - DreamBooth 微調 Stable Diffusion v1-5 實作教學](https://medium.com/@izzysde/只用24張圖複製我妹的畫風-dreambooth-微調stable-diffusion-v1-5-實作教學-3c3318362ebb)


# 模型使用方法:

## 1. 安裝 diffusers, accelerate, cuda版torch
```bash
pip install diffusers, accelerate, torch==2.0.1+cu118 torchvision==0.15.2+cu118 torchaudio==2.0.2+cu118 -f https://download.pytorch.org/whl/cu118/torch_stable.html
```

## 2. 生成圖片
```python
from diffusers import DiffusionPipeline
import torch

# 加載模型
pipeline = DiffusionPipeline.from_pretrained("izzysde/hippojabe_style_image_generator")

# 如果有 GPU,將模型移到 CUDA
if torch.cuda.is_available():
pipeline.to("cuda")
else:
pipeline.to("cpu")

# 定義生成圖像的參數
prompt = "show a cute bird in the style of hippojabe" # 用英文寫描述一定要用in the style of hippojabe結尾
num_inference_steps = 100 # 控制生成質量和速度的步驟數
guidance_scale = 9 # 控制生成圖像與文本提示的一致性

# 生成圖片
with torch.no_grad():
image = pipeline(prompt, num_inference_steps=num_inference_steps, guidance_scale=guidance_scale)["images"][0]

# 保存或顯示圖像
image.save("generated_image.png")
image.show()

```