weathon commited on
Commit
6639f79
·
1 Parent(s): be95d7f

more anti-aesthetics

Browse files
Files changed (3) hide show
  1. anti_aesthetics.json +0 -0
  2. app.py +1 -1
  3. ds.ipynb +164 -0
anti_aesthetics.json CHANGED
The diff for this file is too large to render. See raw diff
 
app.py CHANGED
@@ -181,7 +181,7 @@ with gr.Blocks(title="Value Sign Flip SD3.5 Demo") as demo:
181
  with gr.Row():
182
  sample = gr.Button("Load A Sample Prompt")
183
  sample.click(fn=load_sample, inputs=[], outputs=[pos, neg])
184
- anti_aesthetic_sample = gr.Button("Load An Anti-Aesthetic Sample Prompt")
185
  anti_aesthetic_sample.click(fn=load_anti_aesthetics_sample, inputs=[], outputs=[pos, neg])
186
  abstract_sample = gr.Button("Load An Abstract Prompt")
187
  abstract_sample.click(fn=load_abstract_prompt, inputs=[], outputs=[pos, neg])
 
181
  with gr.Row():
182
  sample = gr.Button("Load A Sample Prompt")
183
  sample.click(fn=load_sample, inputs=[], outputs=[pos, neg])
184
+ anti_aesthetic_sample = gr.Button("Load An Anti-Aesthetic Sample Prompt (Could Cause Unease)")
185
  anti_aesthetic_sample.click(fn=load_anti_aesthetics_sample, inputs=[], outputs=[pos, neg])
186
  abstract_sample = gr.Button("Load An Abstract Prompt")
187
  abstract_sample.click(fn=load_abstract_prompt, inputs=[], outputs=[pos, neg])
ds.ipynb ADDED
@@ -0,0 +1,164 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "code",
5
+ "execution_count": 3,
6
+ "id": "a1e51cab",
7
+ "metadata": {},
8
+ "outputs": [
9
+ {
10
+ "data": {
11
+ "application/vnd.jupyter.widget-view+json": {
12
+ "model_id": "ea3ea81741954384b0b6ee0e2d5f8b43",
13
+ "version_major": 2,
14
+ "version_minor": 0
15
+ },
16
+ "text/plain": [
17
+ "README.md: 0%| | 0.00/670 [00:00<?, ?B/s]"
18
+ ]
19
+ },
20
+ "metadata": {},
21
+ "output_type": "display_data"
22
+ },
23
+ {
24
+ "data": {
25
+ "application/vnd.jupyter.widget-view+json": {
26
+ "model_id": "16a23106959d4f4b870ac50ada254f73",
27
+ "version_major": 2,
28
+ "version_minor": 0
29
+ },
30
+ "text/plain": [
31
+ "data/train-00000-of-00004.parquet: 0%| | 0.00/503M [00:00<?, ?B/s]"
32
+ ]
33
+ },
34
+ "metadata": {},
35
+ "output_type": "display_data"
36
+ },
37
+ {
38
+ "data": {
39
+ "application/vnd.jupyter.widget-view+json": {
40
+ "model_id": "a264fbf783704be8a18f62e7c352b1e7",
41
+ "version_major": 2,
42
+ "version_minor": 0
43
+ },
44
+ "text/plain": [
45
+ "data/train-00001-of-00004.parquet: 0%| | 0.00/503M [00:00<?, ?B/s]"
46
+ ]
47
+ },
48
+ "metadata": {},
49
+ "output_type": "display_data"
50
+ },
51
+ {
52
+ "data": {
53
+ "application/vnd.jupyter.widget-view+json": {
54
+ "model_id": "ecdb1976f88f44c3aa5aef51508643e1",
55
+ "version_major": 2,
56
+ "version_minor": 0
57
+ },
58
+ "text/plain": [
59
+ "data/train-00002-of-00004.parquet: 0%| | 0.00/477M [00:00<?, ?B/s]"
60
+ ]
61
+ },
62
+ "metadata": {},
63
+ "output_type": "display_data"
64
+ },
65
+ {
66
+ "data": {
67
+ "application/vnd.jupyter.widget-view+json": {
68
+ "model_id": "451d70b2799b4312b66d3d5a9d993726",
69
+ "version_major": 2,
70
+ "version_minor": 0
71
+ },
72
+ "text/plain": [
73
+ "data/train-00003-of-00004.parquet: 0%| | 0.00/497M [00:00<?, ?B/s]"
74
+ ]
75
+ },
76
+ "metadata": {},
77
+ "output_type": "display_data"
78
+ },
79
+ {
80
+ "data": {
81
+ "application/vnd.jupyter.widget-view+json": {
82
+ "model_id": "d93865e127a14f4a9179f3b86caa0cfe",
83
+ "version_major": 2,
84
+ "version_minor": 0
85
+ },
86
+ "text/plain": [
87
+ "Generating train split: 0%| | 0/1200 [00:00<?, ? examples/s]"
88
+ ]
89
+ },
90
+ "metadata": {},
91
+ "output_type": "display_data"
92
+ }
93
+ ],
94
+ "source": [
95
+ "from datasets import load_dataset\n",
96
+ "\n",
97
+ "# Login using e.g. `huggingface-cli login` to access this dataset\n",
98
+ "ds = load_dataset(\"weathon/nag_dataset\")"
99
+ ]
100
+ },
101
+ {
102
+ "cell_type": "code",
103
+ "execution_count": 4,
104
+ "id": "ab34f490",
105
+ "metadata": {},
106
+ "outputs": [],
107
+ "source": [
108
+ "base = [{\n",
109
+ " \"prompt\": \"A cat with weird colors is sitting on the table, looking at the TV. The whole image has clashing colors.\",\n",
110
+ " \"missing_element\": \"nature colors\"\n",
111
+ " },]"
112
+ ]
113
+ },
114
+ {
115
+ "cell_type": "code",
116
+ "execution_count": 5,
117
+ "id": "74c7ee35",
118
+ "metadata": {},
119
+ "outputs": [],
120
+ "source": [
121
+ "for sample in ds[\"train\"]:\n",
122
+ " prompt = sample[\"prompt\"]\n",
123
+ " missing_element = sample[\"negative_prompt\"]\n",
124
+ " base.append({\n",
125
+ " \"prompt\": prompt,\n",
126
+ " \"missing_element\": missing_element\n",
127
+ " })"
128
+ ]
129
+ },
130
+ {
131
+ "cell_type": "code",
132
+ "execution_count": 6,
133
+ "id": "c1aec56c",
134
+ "metadata": {},
135
+ "outputs": [],
136
+ "source": [
137
+ "import json\n",
138
+ "with open(\"anti_aesthetics.json\", \"w\") as f:\n",
139
+ " json.dump(base, f, indent=4)"
140
+ ]
141
+ }
142
+ ],
143
+ "metadata": {
144
+ "kernelspec": {
145
+ "display_name": "neg",
146
+ "language": "python",
147
+ "name": "python3"
148
+ },
149
+ "language_info": {
150
+ "codemirror_mode": {
151
+ "name": "ipython",
152
+ "version": 3
153
+ },
154
+ "file_extension": ".py",
155
+ "mimetype": "text/x-python",
156
+ "name": "python",
157
+ "nbconvert_exporter": "python",
158
+ "pygments_lexer": "ipython3",
159
+ "version": "3.10.17"
160
+ }
161
+ },
162
+ "nbformat": 4,
163
+ "nbformat_minor": 5
164
+ }