added python snippet
Browse files
README.md
CHANGED
@@ -10,3 +10,15 @@ inference: true
|
|
10 |
Readers of the Wall Street Journal (WSJ) are familiar with the distinctive style used to create portaits of their writers and subjects. This is a fine-tuned stable
|
11 |
diffusion model that can be used to create hedcut-styled images using the prompt **_wsj hedcut of \<subject\>_**. This model can also be used in a DreamBooth environment
|
12 |
to train a face or other subject for custom and unique hedcuts.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
Readers of the Wall Street Journal (WSJ) are familiar with the distinctive style used to create portaits of their writers and subjects. This is a fine-tuned stable
|
11 |
diffusion model that can be used to create hedcut-styled images using the prompt **_wsj hedcut of \<subject\>_**. This model can also be used in a DreamBooth environment
|
12 |
to train a face or other subject for custom and unique hedcuts.
|
13 |
+
|
14 |
+
```python
|
15 |
+
#!pip install diffusers transformers scipy torch
|
16 |
+
from diffusers import StableDiffusionPipeline
|
17 |
+
import torch
|
18 |
+
model_id = "dmillar/wsj-hedcut-v1"
|
19 |
+
pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16)
|
20 |
+
pipe = pipe.to("cuda")
|
21 |
+
prompt = "wsj hedcut of a woman"
|
22 |
+
image = pipe(prompt).images[0]
|
23 |
+
image.save("./woman_hedcut.png")
|
24 |
+
```
|