p1atdev commited on
Commit
c900b60
1 Parent(s): 5c9dfed

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +48 -1
README.md CHANGED
@@ -98,4 +98,51 @@ Steps: 20, Sampler: Euler a, CFG scale: 7, Seed: 2425583782, Size: 768x512, Mode
98
  anime, watercolor of 1girl,
99
  Negative prompt: nsfw, worst quality, low quality, bad aesthetic, oldest, blurry,
100
  Steps: 20, Sampler: Euler a, CFG scale: 7, Seed: 3429871130, Size: 512x768, Model hash: eb9ce3842e, Model: realgar-v1-fp16, Clip skip: 2, Version: v1.2.1
101
- ```
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
98
  anime, watercolor of 1girl,
99
  Negative prompt: nsfw, worst quality, low quality, bad aesthetic, oldest, blurry,
100
  Steps: 20, Sampler: Euler a, CFG scale: 7, Seed: 3429871130, Size: 512x768, Model hash: eb9ce3842e, Model: realgar-v1-fp16, Clip skip: 2, Version: v1.2.1
101
+ ```
102
+
103
+ ## 🧨 Diffusers
104
+
105
+ [![open in colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/#fileId=https://huggingface.co/p1atdev/Realgar-v1/blob/main/diffusers.ipynb)
106
+
107
+
108
+ ```bash
109
+ pip install diffusers transformers accelerate scipy safetensors
110
+ pip install xformers
111
+ ```
112
+
113
+ ```py
114
+ import torch
115
+ from diffusers import DiffusionPipeline, EulerAncestralDiscreteScheduler
116
+
117
+ model_id = "p1atdev/Realgar-v1"
118
+ pipe = DiffusionPipeline.from_pretrained(
119
+ model_id,
120
+ torch_dtype=torch.float16,
121
+ custom_pipeline="lpw_stable_diffusion"
122
+ )
123
+ pipe.scheduler = EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config)
124
+
125
+ pipe = pipe.to("cuda")
126
+ pipe.enable_attention_slicing()
127
+ pipe.enable_xformers_memory_efficient_attention() # required
128
+
129
+ prompt = """
130
+ anime, 1girl, blue hair, cat ears, sweater vest,
131
+ """
132
+ negative_prompt = "nsfw, nude, worst quality, low quality, bad aesthetic, oldest, bad anatomy"
133
+
134
+ width = 512
135
+ height = 768
136
+
137
+ image = pipe(
138
+ prompt,
139
+ negative_prompt=negative_prompt,
140
+ guidance_scale=7.0,
141
+ num_inference_steps=20,
142
+ width=width,
143
+ height=height,
144
+ ).images[0]
145
+
146
+ display(image) # for notebooks
147
+ # image.save("girl.png")
148
+ ```