Update README.md
Browse files
README.md
CHANGED
|
@@ -35,21 +35,23 @@ This model is a fine-tuned version of the Stable Diffusion architecture, leverag
|
|
| 35 |
### Example Usages:
|
| 36 |
|
| 37 |
|
| 38 |
-
|
| 39 |
|
| 40 |
import torch
|
| 41 |
from diffusers import StableDiffusionPipeline,UNet2DConditionModel
|
| 42 |
|
| 43 |
-
pipeline
|
| 44 |
|
| 45 |
-
pipeline.load_lora_weights(
|
| 46 |
|
| 47 |
-
|
| 48 |
-
|
|
|
|
|
|
|
| 49 |
|
| 50 |
display(lora_image)
|
| 51 |
|
| 52 |
-
|
| 53 |
|
| 54 |
### Results
|
| 55 |
|
|
@@ -59,6 +61,10 @@ We use four prompts as follows:
|
|
| 59 |
- 'A girl with long blonde hair'
|
| 60 |
- 'An young man with curry hair'
|
| 61 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 62 |
|
| 63 |

|
| 64 |
|
|
|
|
| 35 |
### Example Usages:
|
| 36 |
|
| 37 |
|
| 38 |
+
```py
|
| 39 |
|
| 40 |
import torch
|
| 41 |
from diffusers import StableDiffusionPipeline,UNet2DConditionModel
|
| 42 |
|
| 43 |
+
pipeline = StableDiffusionPipeline.from_pretrained("runwayml/stable-diffusion-v1-5").to("cuda")
|
| 44 |
|
| 45 |
+
pipeline.load_lora_weights("phil329/face_lora_sd15", weight_name="pytorch_lora_weights.safetensors")
|
| 46 |
|
| 47 |
+
NEGATIVE_PROMPT = "worst quality, low quality, bad anatomy, watermark, text, blurry, cartoon, unreal"
|
| 48 |
+
text = 'A young woman with smile, wearing a purple hat.'
|
| 49 |
+
|
| 50 |
+
lora_image = pipeline(text,negative_prompt=NEGATIVE_PROMPT).images[0]
|
| 51 |
|
| 52 |
display(lora_image)
|
| 53 |
|
| 54 |
+
```
|
| 55 |
|
| 56 |
### Results
|
| 57 |
|
|
|
|
| 61 |
- 'A girl with long blonde hair'
|
| 62 |
- 'An young man with curry hair'
|
| 63 |
|
| 64 |
+
The **negative prompt** are the same as the example codes. All the results are randomly generated and **not** cherry-picked.
|
| 65 |
+
|
| 66 |
+
If the generation effect is not good, try adding a negative prompt, or try different prompts and seeds.
|
| 67 |
+
|
| 68 |
|
| 69 |

|
| 70 |
|