IDKiro commited on
Commit
52e7b97
1 Parent(s): c141576

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +34 -1
README.md CHANGED
@@ -13,9 +13,42 @@ SDXS is a model that can generate high-resolution images in real-time based on p
13
  For more information, please refer to our research paper: [SDXS: Real-Time One-Step Latent Diffusion Models with Image Conditions](https://arxiv.org/abs/2403.16627).
14
  We open-source the model as part of the research.
15
 
16
- SDXS-512-DreamShaper-Anime is the anime-style LoRA for [SDXS-512-DreamShaper](https://huggingface.co/IDKiro/sdxs-512-dreamshaper).
17
  Watch [our repo](https://github.com/IDKiro/sdxs) for any updates.
18
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  ## Cite Our Work
20
 
21
  ```
 
13
  For more information, please refer to our research paper: [SDXS: Real-Time One-Step Latent Diffusion Models with Image Conditions](https://arxiv.org/abs/2403.16627).
14
  We open-source the model as part of the research.
15
 
16
+ SDXS-512-DreamShaper-Anime is the anime-style **LoRA** for [SDXS-512-DreamShaper](https://huggingface.co/IDKiro/sdxs-512-dreamshaper).
17
  Watch [our repo](https://github.com/IDKiro/sdxs) for any updates.
18
 
19
+
20
+ ## Diffusers Usage
21
+
22
+ ![](output.png)
23
+
24
+ ```python
25
+ import torch
26
+ from diffusers import StableDiffusionPipeline
27
+ import peft
28
+
29
+ repo = "IDKiro/sdxs-512-dreamshaper"
30
+ lora_repo = "IDKiro/sdxs-512-dreamshaper-anime"
31
+ seed = 42
32
+ weight_type = torch.float16 # or float32
33
+
34
+ # Load model.
35
+ pipe = StableDiffusionPipeline.from_pretrained(repo, torch_dtype=weight_type)
36
+ pipe.unet = PeftModel.from_pretrained(pipe.unet, lora_repo)
37
+ pipe.to("cuda")
38
+
39
+ prompt = "a close-up picture of an old man standing in the rain"
40
+
41
+ # Ensure using 1 inference step and CFG set to 0.
42
+ image = pipe(
43
+ prompt,
44
+ num_inference_steps=1,
45
+ guidance_scale=0,
46
+ generator=torch.Generator(device="cuda").manual_seed(seed)
47
+ ).images[0]
48
+
49
+ image.save("output.png")
50
+ ```
51
+
52
  ## Cite Our Work
53
 
54
  ```