matteopilotto commited on
Commit
e879e05
•
1 Parent(s): cc0eae8

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +71 -6
README.md CHANGED
@@ -10,26 +10,91 @@ tags:
10
  - wildcard
11
  ---
12
 
13
- # DreamBooth model for the person concept trained by matteopilotto on the matteopilotto/kratos dataset.
14
 
15
- This is a Stable Diffusion model fine-tuned on the person concept with DreamBooth. It can be used by modifying the `instance_prompt`: **a photo of krts person**
 
 
16
 
17
  This model was created as part of the DreamBooth Hackathon 🔥. Visit the [organisation page](https://huggingface.co/dreambooth-hackathon) for instructions on how to take part!
18
 
19
  ## Description
20
 
 
 
21
 
22
- This is a Stable Diffusion model fine-tuned on imagaes of Kratos from God of War for the wildcard theme using `CompVis/stable-diffusion-v1-4` pre-trained model.
23
 
 
24
 
 
 
 
 
 
 
 
 
25
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
26
 
27
  ## Usage
28
 
29
  ```python
 
30
  from diffusers import StableDiffusionPipeline
31
 
32
- pipeline = StableDiffusionPipeline.from_pretrained('matteopilotto/kratos-sd-v1-4-dreambooth')
33
- image = pipeline().images[0]
34
- image
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
  ```
 
10
  - wildcard
11
  ---
12
 
13
+ # DreamBooth model of Kratos from God of War
14
 
15
+ This is a Stable Diffusion model fine-tuned on the person concept with DreamBooth. It can be used by adding the string `krts person` to any prompt.
16
+
17
+ Check out the information below ☟ to see a few practical examples on how to use it.
18
 
19
  This model was created as part of the DreamBooth Hackathon 🔥. Visit the [organisation page](https://huggingface.co/dreambooth-hackathon) for instructions on how to take part!
20
 
21
  ## Description
22
 
23
+ This is a Stable Diffusion model fine-tuned on [`matteopilotto/kratos`](https://huggingface.co/datasets/matteopilotto/kratos) dataset containing 10 images of **Kratos** 🪓 from **God of War** for the wildcard theme using [`CompVis/stable-diffusion-v1-4`](https://huggingface.co/CompVis/stable-diffusion-v1-4) pre-trained model.
24
+
25
 
26
+ ## Example Output
27
 
28
+ <img src="https://huggingface.co/matteopilotto/kratos-sd-v1-4-dreambooth/resolve/main/sample_outputs/245581956f83dc275e5d.png">
29
 
30
+ **Prompt:** "An illustration of **krts** **person** punk playing electric guitar, tristan eaton, victo ngai, artgerm, rhads, ross draws"\
31
+ **Negative prompt:** "low contrast, blurry, low resolution, warped"\
32
+ **Resolution:** 512 x 512\
33
+ **Guidance Scale:** 7\
34
+ **Inference steps:** 50\
35
+ **Seeds:** [556850, 459286, 768745, 594109]
36
+
37
+ ---
38
 
39
+ <img src="https://huggingface.co/matteopilotto/kratos-sd-v1-4-dreambooth/resolve/main/sample_outputs/4c4a87edbc0d5f03469a.png">
40
+
41
+ **Prompt:** "a drawing of **krts** **person** wearing a Spider-man costume in the style of Marvel comics"\
42
+ **Negative prompt:** "low contrast, blurry, low resolution, warped"\
43
+ **Resolution:** 512 x 512\
44
+ **Guidance Scale:** 7\
45
+ **Inference steps:** 50\
46
+ **Seeds:** [553766, 537908, 147395, 343240]
47
+
48
+ ---
49
+
50
+ <img src="https://huggingface.co/matteopilotto/kratos-sd-v1-4-dreambooth/resolve/main/sample_outputs/4dae428d30bddcc70967.png">
51
+
52
+ **Prompt:** "an illustration of **krts** **person** sitting in a movie theater eating popcorn watching a movie, unreal engine, cozy indoor lighting, artstation, detailed, digital painting, cinematic, character design by mark ryden and pixar and hayao miyazaki, unreal 5, daz, hyperrealistic, octane render"\
53
+ **Negative prompt:** "low contrast, blurry, low resolution, warped"\
54
+ **Resolution:** 512 x 512\
55
+ **Guidance Scale:** 7\
56
+ **Inference steps:** 50\
57
+ **Seeds:** [737986, 488711, 799063, 121111]
58
 
59
  ## Usage
60
 
61
  ```python
62
+ import torch
63
  from diffusers import StableDiffusionPipeline
64
 
65
+ # set device-agnostic code
66
+ device = (
67
+ 'mps' if torch.backends.mps.is_available()
68
+ else 'cuda' if torch.cuda.is_available()
69
+ else 'cpu'
70
+ )
71
+
72
+ # load pre-trained model
73
+ pretrained_ckpt = 'matteopilotto/kratos-sd-v1-4-dreambooth'
74
+ pipeline = StableDiffusionPipeline.from_pretrained(pretrained_ckpt).to(device)
75
+
76
+ # stable diffusion hyperparameters
77
+ unique_token = 'krts'
78
+ class_type = 'person'
79
+ prompt = f'An illustration of {unique_token} {class_type} punk playing electric guitar, tristan eaton, victo ngai, artgerm, rhads, ross draws'
80
+ negative_prompt = 'low contrast, blurry, low resolution, warped'
81
+ guidance_scale = 7
82
+ h = 512
83
+ w = 512
84
+ inference_steps = 50
85
+ seed = 594109
86
+
87
+ # set generator for reproducibility
88
+ generator = torch.Generator(device=device).manual_seed(seed)
89
+
90
+ # generate image
91
+ image = pipeline(
92
+ prompt,
93
+ negative_prompt=negative_prompt,
94
+ guidance_scale=guidance_scale,
95
+ height=h,
96
+ width=w,
97
+ num_inference_steps=inference_steps,
98
+ generator=generator
99
+ ).images[0]
100
  ```