ritwikraha
commited on
chore: update README
Browse files
README.md
CHANGED
@@ -1,3 +1,69 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
license: mit
|
3 |
library_name: diffusers
|
|
|
1 |
+
# Khabib Sketch SDXL LoRA
|
2 |
+
|
3 |
+
A LoRA adaptation of SDXL to produce sketches of the MMA fighter and G.O.A.T Khabib.
|
4 |
+
|
5 |
+
<figure>
|
6 |
+
<img src="https://i.imgur.com/eIn5oqJ.png" alt="Khabib" width="256" height="256">
|
7 |
+
<figcaption>Sketch of Khabib fighting a Bengal Tiger</figcaption>
|
8 |
+
</figure>
|
9 |
+
|
10 |
+
|
11 |
+
These are LoRA adaption weights for `stabilityai/stable-diffusion-xl-base-1.0`.
|
12 |
+
The weights were trained on sketches of Khabib by [ritwikraha](https://www.ritwikraha.com/) using [DreamBooth](https://dreambooth.github.io/).
|
13 |
+
You can find some example images in the following.
|
14 |
+
|
15 |
+
Special VAE used for training: madebyollin/sdxl-vae-fp16-fix.
|
16 |
+
|
17 |
+
DataSet: custom hand-drawn sketches by [ritwikraha](https://www.ritwikraha.com/)
|
18 |
+
|
19 |
+
## Usage
|
20 |
+
|
21 |
+
```
|
22 |
+
!pip install diffusers accelerate -q
|
23 |
+
import torch
|
24 |
+
from PIL import Image
|
25 |
+
from diffusers import DiffusionPipeline, AutoencoderKL
|
26 |
+
|
27 |
+
vae = AutoencoderKL.from_pretrained("madebyollin/sdxl-vae-fp16-fix", torch_dtype=torch.float16)
|
28 |
+
pipe = DiffusionPipeline.from_pretrained(
|
29 |
+
"stabilityai/stable-diffusion-xl-base-1.0",
|
30 |
+
vae=vae,
|
31 |
+
torch_dtype=torch.float16,
|
32 |
+
variant="fp16",
|
33 |
+
use_safetensors=True
|
34 |
+
)
|
35 |
+
pipe.load_lora_weights('ritwikraha/khabib_sketch_LoRA')
|
36 |
+
_ = pipe.to("cuda")
|
37 |
+
|
38 |
+
prompt = "a sketch of TOK khabib pointing at another khabib like the spiderman meme, monchrome, pen sketch"
|
39 |
+
negative_prompt ="ugly face, multiple bodies, bad anatomy, disfigured, extra fingers"
|
40 |
+
image = pipe(prompt=prompt,
|
41 |
+
negative_prompt=negative_prompt,
|
42 |
+
guidance_scale=3,
|
43 |
+
num_inference_steps=50).images[0]
|
44 |
+
image
|
45 |
+
```
|
46 |
+
|
47 |
+
|
48 |
+
## Examples
|
49 |
+
|
50 |
+
| Image 1 | Image 2 |
|
51 |
+
|---|---|
|
52 |
+
| ![khabib sketch example 1](./1.png) | ![khabib sketch example 2](./2.png) |
|
53 |
+
| Image 3 | Image 4 |
|
54 |
+
|---|---|
|
55 |
+
| ![khabib sketch example 3](./3.png) | ![sks dog sample 4](./4.png) |
|
56 |
+
|
57 |
+
|
58 |
+
|
59 |
+
|
60 |
+
## Tips
|
61 |
+
|
62 |
+
- The examples are all sketches created in Procreate so prompts with words like sketch, and monochrome work best
|
63 |
+
- Use a negative prompt and guidance scale for the model
|
64 |
+
- Images at 1024X1024 will be better than other dimensions
|
65 |
+
|
66 |
+
|
67 |
---
|
68 |
license: mit
|
69 |
library_name: diffusers
|