RichardErkhov
commited on
Commit
•
baf89ab
1
Parent(s):
ac0c272
uploaded readme
Browse files
README.md
ADDED
@@ -0,0 +1,108 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Quantization made by Richard Erkhov.
|
2 |
+
|
3 |
+
[Github](https://github.com/RichardErkhov)
|
4 |
+
|
5 |
+
[Discord](https://discord.gg/pvy7H8DZMG)
|
6 |
+
|
7 |
+
[Request more models](https://github.com/RichardErkhov/quant_request)
|
8 |
+
|
9 |
+
|
10 |
+
distilgpt2-stable-diffusion - GGUF
|
11 |
+
- Model creator: https://huggingface.co/FredZhang7/
|
12 |
+
- Original model: https://huggingface.co/FredZhang7/distilgpt2-stable-diffusion/
|
13 |
+
|
14 |
+
|
15 |
+
| Name | Quant method | Size |
|
16 |
+
| ---- | ---- | ---- |
|
17 |
+
| [distilgpt2-stable-diffusion.Q2_K.gguf](https://huggingface.co/RichardErkhov/FredZhang7_-_distilgpt2-stable-diffusion-gguf/blob/main/distilgpt2-stable-diffusion.Q2_K.gguf) | Q2_K | 0.06GB |
|
18 |
+
| [distilgpt2-stable-diffusion.IQ3_XS.gguf](https://huggingface.co/RichardErkhov/FredZhang7_-_distilgpt2-stable-diffusion-gguf/blob/main/distilgpt2-stable-diffusion.IQ3_XS.gguf) | IQ3_XS | 0.07GB |
|
19 |
+
| [distilgpt2-stable-diffusion.IQ3_S.gguf](https://huggingface.co/RichardErkhov/FredZhang7_-_distilgpt2-stable-diffusion-gguf/blob/main/distilgpt2-stable-diffusion.IQ3_S.gguf) | IQ3_S | 0.07GB |
|
20 |
+
| [distilgpt2-stable-diffusion.Q3_K_S.gguf](https://huggingface.co/RichardErkhov/FredZhang7_-_distilgpt2-stable-diffusion-gguf/blob/main/distilgpt2-stable-diffusion.Q3_K_S.gguf) | Q3_K_S | 0.07GB |
|
21 |
+
| [distilgpt2-stable-diffusion.IQ3_M.gguf](https://huggingface.co/RichardErkhov/FredZhang7_-_distilgpt2-stable-diffusion-gguf/blob/main/distilgpt2-stable-diffusion.IQ3_M.gguf) | IQ3_M | 0.07GB |
|
22 |
+
| [distilgpt2-stable-diffusion.Q3_K.gguf](https://huggingface.co/RichardErkhov/FredZhang7_-_distilgpt2-stable-diffusion-gguf/blob/main/distilgpt2-stable-diffusion.Q3_K.gguf) | Q3_K | 0.07GB |
|
23 |
+
| [distilgpt2-stable-diffusion.Q3_K_M.gguf](https://huggingface.co/RichardErkhov/FredZhang7_-_distilgpt2-stable-diffusion-gguf/blob/main/distilgpt2-stable-diffusion.Q3_K_M.gguf) | Q3_K_M | 0.07GB |
|
24 |
+
| [distilgpt2-stable-diffusion.Q3_K_L.gguf](https://huggingface.co/RichardErkhov/FredZhang7_-_distilgpt2-stable-diffusion-gguf/blob/main/distilgpt2-stable-diffusion.Q3_K_L.gguf) | Q3_K_L | 0.07GB |
|
25 |
+
| [distilgpt2-stable-diffusion.IQ4_XS.gguf](https://huggingface.co/RichardErkhov/FredZhang7_-_distilgpt2-stable-diffusion-gguf/blob/main/distilgpt2-stable-diffusion.IQ4_XS.gguf) | IQ4_XS | 0.07GB |
|
26 |
+
| [distilgpt2-stable-diffusion.Q4_0.gguf](https://huggingface.co/RichardErkhov/FredZhang7_-_distilgpt2-stable-diffusion-gguf/blob/main/distilgpt2-stable-diffusion.Q4_0.gguf) | Q4_0 | 0.08GB |
|
27 |
+
| [distilgpt2-stable-diffusion.IQ4_NL.gguf](https://huggingface.co/RichardErkhov/FredZhang7_-_distilgpt2-stable-diffusion-gguf/blob/main/distilgpt2-stable-diffusion.IQ4_NL.gguf) | IQ4_NL | 0.08GB |
|
28 |
+
| [distilgpt2-stable-diffusion.Q4_K_S.gguf](https://huggingface.co/RichardErkhov/FredZhang7_-_distilgpt2-stable-diffusion-gguf/blob/main/distilgpt2-stable-diffusion.Q4_K_S.gguf) | Q4_K_S | 0.08GB |
|
29 |
+
| [distilgpt2-stable-diffusion.Q4_K.gguf](https://huggingface.co/RichardErkhov/FredZhang7_-_distilgpt2-stable-diffusion-gguf/blob/main/distilgpt2-stable-diffusion.Q4_K.gguf) | Q4_K | 0.08GB |
|
30 |
+
| [distilgpt2-stable-diffusion.Q4_K_M.gguf](https://huggingface.co/RichardErkhov/FredZhang7_-_distilgpt2-stable-diffusion-gguf/blob/main/distilgpt2-stable-diffusion.Q4_K_M.gguf) | Q4_K_M | 0.08GB |
|
31 |
+
| [distilgpt2-stable-diffusion.Q4_1.gguf](https://huggingface.co/RichardErkhov/FredZhang7_-_distilgpt2-stable-diffusion-gguf/blob/main/distilgpt2-stable-diffusion.Q4_1.gguf) | Q4_1 | 0.08GB |
|
32 |
+
| [distilgpt2-stable-diffusion.Q5_0.gguf](https://huggingface.co/RichardErkhov/FredZhang7_-_distilgpt2-stable-diffusion-gguf/blob/main/distilgpt2-stable-diffusion.Q5_0.gguf) | Q5_0 | 0.09GB |
|
33 |
+
| [distilgpt2-stable-diffusion.Q5_K_S.gguf](https://huggingface.co/RichardErkhov/FredZhang7_-_distilgpt2-stable-diffusion-gguf/blob/main/distilgpt2-stable-diffusion.Q5_K_S.gguf) | Q5_K_S | 0.09GB |
|
34 |
+
| [distilgpt2-stable-diffusion.Q5_K.gguf](https://huggingface.co/RichardErkhov/FredZhang7_-_distilgpt2-stable-diffusion-gguf/blob/main/distilgpt2-stable-diffusion.Q5_K.gguf) | Q5_K | 0.09GB |
|
35 |
+
| [distilgpt2-stable-diffusion.Q5_K_M.gguf](https://huggingface.co/RichardErkhov/FredZhang7_-_distilgpt2-stable-diffusion-gguf/blob/main/distilgpt2-stable-diffusion.Q5_K_M.gguf) | Q5_K_M | 0.09GB |
|
36 |
+
| [distilgpt2-stable-diffusion.Q5_1.gguf](https://huggingface.co/RichardErkhov/FredZhang7_-_distilgpt2-stable-diffusion-gguf/blob/main/distilgpt2-stable-diffusion.Q5_1.gguf) | Q5_1 | 0.09GB |
|
37 |
+
| [distilgpt2-stable-diffusion.Q6_K.gguf](https://huggingface.co/RichardErkhov/FredZhang7_-_distilgpt2-stable-diffusion-gguf/blob/main/distilgpt2-stable-diffusion.Q6_K.gguf) | Q6_K | 0.1GB |
|
38 |
+
| [distilgpt2-stable-diffusion.Q8_0.gguf](https://huggingface.co/RichardErkhov/FredZhang7_-_distilgpt2-stable-diffusion-gguf/blob/main/distilgpt2-stable-diffusion.Q8_0.gguf) | Q8_0 | 0.12GB |
|
39 |
+
|
40 |
+
|
41 |
+
|
42 |
+
|
43 |
+
Original model description:
|
44 |
+
---
|
45 |
+
license: creativeml-openrail-m
|
46 |
+
tags:
|
47 |
+
- stable-diffusion
|
48 |
+
- prompt-generator
|
49 |
+
- distilgpt2
|
50 |
+
datasets:
|
51 |
+
- FredZhang7/krea-ai-prompts
|
52 |
+
- Gustavosta/Stable-Diffusion-Prompts
|
53 |
+
- bartman081523/stable-diffusion-discord-prompts
|
54 |
+
widget:
|
55 |
+
- text: "amazing"
|
56 |
+
- text: "a photo of"
|
57 |
+
- text: "a sci-fi"
|
58 |
+
- text: "a portrait of"
|
59 |
+
- text: "a person standing"
|
60 |
+
- text: "a boy watching"
|
61 |
+
---
|
62 |
+
# DistilGPT2 Stable Diffusion Model Card
|
63 |
+
|
64 |
+
|
65 |
+
<a href="https://huggingface.co/FredZhang7/distilgpt2-stable-diffusion-v2"> <font size="4"> <bold> Version 2 is here! </bold> </font> </a>
|
66 |
+
|
67 |
+
|
68 |
+
DistilGPT2 Stable Diffusion is a text generation model used to generate creative and coherent prompts for text-to-image models, given any text.
|
69 |
+
This model was finetuned on 2.03 million descriptive stable diffusion prompts from [Stable Diffusion discord](https://huggingface.co/datasets/bartman081523/stable-diffusion-discord-prompts), [Lexica.art](https://huggingface.co/datasets/Gustavosta/Stable-Diffusion-Prompts), and (my hand-picked) [Krea.ai](https://huggingface.co/datasets/FredZhang7/krea-ai-prompts). I filtered the hand-picked prompts based on the output results from Stable Diffusion v1.4.
|
70 |
+
|
71 |
+
Compared to other prompt generation models using GPT2, this one runs with 50% faster forwardpropagation and 40% less disk space & RAM.
|
72 |
+
|
73 |
+
|
74 |
+
### PyTorch
|
75 |
+
|
76 |
+
```bash
|
77 |
+
pip install --upgrade transformers
|
78 |
+
```
|
79 |
+
|
80 |
+
```python
|
81 |
+
from transformers import GPT2Tokenizer, GPT2LMHeadModel
|
82 |
+
|
83 |
+
# load the pretrained tokenizer
|
84 |
+
tokenizer = GPT2Tokenizer.from_pretrained('distilgpt2')
|
85 |
+
tokenizer.add_special_tokens({'pad_token': '[PAD]'})
|
86 |
+
tokenizer.max_len = 512
|
87 |
+
|
88 |
+
# load the fine-tuned model
|
89 |
+
model = GPT2LMHeadModel.from_pretrained('FredZhang7/distilgpt2-stable-diffusion')
|
90 |
+
|
91 |
+
# generate text using fine-tuned model
|
92 |
+
from transformers import pipeline
|
93 |
+
nlp = pipeline('text-generation', model=model, tokenizer=tokenizer)
|
94 |
+
ins = "a beautiful city"
|
95 |
+
|
96 |
+
# generate 10 samples
|
97 |
+
outs = nlp(ins, max_length=80, num_return_sequences=10)
|
98 |
+
|
99 |
+
# print the 10 samples
|
100 |
+
for i in range(len(outs)):
|
101 |
+
outs[i] = str(outs[i]['generated_text']).replace(' ', '')
|
102 |
+
print('\033[96m' + ins + '\033[0m')
|
103 |
+
print('\033[93m' + '\n\n'.join(outs) + '\033[0m')
|
104 |
+
```
|
105 |
+
|
106 |
+
Example Output:
|
107 |
+
![Example Output](./prompt-examples.png)
|
108 |
+
|