support for longer prompt and weighting using custom_pipeline
#29
by
skytnt
- opened
README.md
CHANGED
@@ -44,19 +44,20 @@ This model can be used for entertainment purposes and as a generative art assist
|
|
44 |
## Example Code
|
45 |
|
46 |
```python
|
|
|
47 |
import torch
|
48 |
-
from torch import autocast
|
49 |
-
from diffusers import StableDiffusionPipeline
|
50 |
|
51 |
-
pipe =
|
52 |
'hakurei/waifu-diffusion',
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
|
|
|
|
60 |
image.save("test.png")
|
61 |
```
|
62 |
|
|
|
44 |
## Example Code
|
45 |
|
46 |
```python
|
47 |
+
from diffusers import DiffusionPipeline
|
48 |
import torch
|
|
|
|
|
49 |
|
50 |
+
pipe = DiffusionPipeline.from_pretrained(
|
51 |
'hakurei/waifu-diffusion',
|
52 |
+
custom_pipeline="waifu-research-department/long-prompt-weighting-pipeline",
|
53 |
+
revision="fp16",
|
54 |
+
torch_dtype=torch.float16
|
55 |
+
)
|
56 |
+
pipe=pipe.to("cuda")
|
57 |
+
|
58 |
+
prompt = "best quality, masterpiece, 1girl, aqua eyes, baseball cap, blonde hair, closed mouth, earrings, green background, hat, hoop earrings, jewelry, looking at viewer, shirt, short hair, simple background, solo, upper body, yellow shirt"
|
59 |
+
neg_prompt = "lowres, bad anatomy, error body, error hair, error arm, error hands, bad hands, error fingers, bad fingers, missing fingers, error legs, bad legs, multiple legs, missing legs, error lighting, error shadow, error reflection, text, error, extra digit, fewer digits, cropped, worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry"
|
60 |
+
image = pipe.text2img(prompt, neg_prompt, guidance_scale=6).images[0]
|
61 |
image.save("test.png")
|
62 |
```
|
63 |
|