Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language:
|
| 3 |
+
- en
|
| 4 |
+
library_name: diffusers
|
| 5 |
+
tags:
|
| 6 |
+
- stable-diffusion
|
| 7 |
+
- lora
|
| 8 |
+
---
|
| 9 |
+
|
| 10 |
+
# Model Card for svjack/concept-caption-3m-sd-lora-en
|
| 11 |
+
|
| 12 |
+
## Installation
|
| 13 |
+
```bash
|
| 14 |
+
pip install -U diffusers
|
| 15 |
+
pip install transformers
|
| 16 |
+
```
|
| 17 |
+
|
| 18 |
+
## Usage
|
| 19 |
+
```python
|
| 20 |
+
from diffusers import StableDiffusionPipeline
|
| 21 |
+
import torch
|
| 22 |
+
|
| 23 |
+
pipe = StableDiffusionPipeline.from_pretrained("CompVis/stable-diffusion-v1-2", torch_dtype=torch.float16)
|
| 24 |
+
model_path = "svjack/concept-caption-3m-sd-lora-en"
|
| 25 |
+
|
| 26 |
+
pipe.unet.load_attn_procs(model_path)
|
| 27 |
+
pipe.to("cuda")
|
| 28 |
+
pipe.safety_checker = lambda images, clip_input: (images, False)
|
| 29 |
+
print("have_load")
|
| 30 |
+
|
| 31 |
+
prompt = "A Happpy dog"
|
| 32 |
+
image = pipe(prompt, num_inference_steps=50, guidance_scale=7.5).images[0]
|
| 33 |
+
image
|
| 34 |
+
```
|
| 35 |
+
|
| 36 |
+

|