File size: 1,735 Bytes
7204f03
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ac28bdf
7204f03
ac28bdf
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
---
license: creativeml-openrail-m
base_model: gsdf/Counterfeit-V2.5
tags:
  - stable-diffusion
  - stable-diffusion-diffusers
  - text-to-image
  - diffusers
  - lora
  - civitai
  - a1111
---

This repository contains a LoRA model downloaded from [CivitAI](https://civitai.com/models/13239/light-and-shadow).

You can load this checkpoint in 🧨 diffusers and perform like so:

```python
import torch
from diffusers import StableDiffusionPipeline, DPMSolverMultistepScheduler

pipeline = StableDiffusionPipeline.from_pretrained(
    "gsdf/Counterfeit-V2.5", torch_dtype=torch.float16, safety_checker=None
).to("cuda")
pipeline.scheduler = DPMSolverMultistepScheduler.from_config(
    pipeline.scheduler.config, use_karras_sigmas=True
)

pipeline.load_lora_weights(
    "sayakpaul/civitai-light-shadow-lora", weight_name="light_and_shadow.safetensors"
)
prompt = "masterpiece, best quality, 1girl, at dusk"
negative_prompt = ("(low quality, worst quality:1.4), (bad anatomy), (inaccurate limb:1.2), "
                   "bad composition, inaccurate eyes, extra digit, fewer digits, (extra arms:1.2), large breasts")

image = pipeline(prompt=prompt, 
    negative_prompt=negative_prompt, 
    width=512, 
    height=768, 
    num_inference_steps=15, 
    generator=torch.manual_seed(0)
).images[0]
image.save("image.png")
```

Below is a comparison between the LoRA and the non-LoRA results:

<div align="center">
<img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/lora_non_lora_comparison.png" width=850/>
</div>

If you're interested to know how the CivitAI interoperability support was enabled in Diffusers, please follow [this PR](https://github.com/huggingface/diffusers/pull/3437).