Mattthew commited on
Commit
f561d4d
1 Parent(s): 0b20068

added option to hide NSFW images

Browse files
artists_and_tags.js CHANGED
The diff for this file is too large to render. See raw diff
 
images/SDXL_Crystal_Clear/Hendrik_Kerstens-landscape.webp CHANGED
images/SDXL_Crystal_Clear/William-Adolphe_Bouguereau-artwork.webp CHANGED
images/SDXL_Crystal_Clear_thumbs/Hendrik_Kerstens-landscape.webp CHANGED
images/SDXL_Crystal_Clear_thumbs/William-Adolphe_Bouguereau-artwork.webp CHANGED
images/SDXL_DynaVision/Eugene_Delacroix,_an_image.webp.webp DELETED
Binary file (54.9 kB)
 
images/SDXL_DynaVision/{Eugene_Delacroix,_an_image.webp → Eugene_Delacroix-artwork.webp} RENAMED
File without changes
images/SDXL_DynaVision_thumbs/Eugene_Delacroix,_an_image.webp.webp DELETED
Binary file (14.7 kB)
 
images/SDXL_DynaVision_thumbs/{Eugene_Delacroix,_an_image.webp → Eugene_Delacroix-artwork.webp} RENAMED
File without changes
index.css CHANGED
@@ -63,10 +63,6 @@ h4 {
63
  background: linear-gradient(90deg, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 40%);
64
  }
65
 
66
- #gutter:hover {
67
- background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.1) 40%)
68
- }
69
-
70
  #gutter div {
71
  position: relative;
72
  width: 20px;
@@ -77,34 +73,34 @@ h4 {
77
  cursor: col-resize;
78
  }
79
 
80
- #gutter:hover div {
81
  border-right: 1px solid rgba(255,255,255,0.4);
 
82
  }
83
 
84
  #gutter div[data-tooltip]::before {
85
- content: attr(data-tooltip);
86
- opacity: 0;
87
- transition: opacity 0ms 0ms linear;
88
- }
89
-
90
- #gutter div[data-tooltip]:hover::before {
91
  content: attr(data-tooltip);
92
  position: absolute;
93
- top: 20px;
94
  left: 50%;
95
- transform: translateX(-40%);
96
- background-color: #555;
97
  padding: 4px 8px;
98
  border-radius: 4px;
99
  box-shadow: 0 5px 10px black;
100
  white-space: nowrap;
101
  font-size: 12px;
102
- color: white;
103
  opacity: 1;
104
- transition: opacity 100ms 500ms linear;
105
  pointer-events: none; /* Make sure the tooltip doesn't interfere with other interactions */
106
  }
107
 
 
 
 
 
 
108
  @keyframes gutter_tease {
109
  0% {
110
  transform: translateX(-40px);
@@ -149,11 +145,18 @@ h4 {
149
  box-sizing: border-box;
150
  margin-left: calc(40% + 50px);
151
  margin-top: 20px;
152
- margin-bottom: 20px;
153
  margin-right: 60px;
154
  width: 100%;
155
  }
156
 
 
 
 
 
 
 
 
 
157
  #alert {
158
  position: fixed;
159
  z-index: 1;
@@ -1130,6 +1133,10 @@ input[type="checkbox"]:checked::before {
1130
  font-size: 14px;
1131
  }
1132
 
 
 
 
 
1133
  .image-item .imgBox .img.hidden {
1134
  display: none;
1135
  }
 
63
  background: linear-gradient(90deg, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 40%);
64
  }
65
 
 
 
 
 
66
  #gutter div {
67
  position: relative;
68
  width: 20px;
 
73
  cursor: col-resize;
74
  }
75
 
76
+ #gutter div:hover {
77
  border-right: 1px solid rgba(255,255,255,0.4);
78
+ background-color: rgba(255, 255, 255, 0.1);
79
  }
80
 
81
  #gutter div[data-tooltip]::before {
 
 
 
 
 
 
82
  content: attr(data-tooltip);
83
  position: absolute;
84
+ bottom: 100px;
85
  left: 50%;
86
+ transform: translateX(-25%);
87
+ background-color: #222;
88
  padding: 4px 8px;
89
  border-radius: 4px;
90
  box-shadow: 0 5px 10px black;
91
  white-space: nowrap;
92
  font-size: 12px;
93
+ color: #777;
94
  opacity: 1;
95
+ transition: color 100ms linear, background-color 100ms linear;
96
  pointer-events: none; /* Make sure the tooltip doesn't interfere with other interactions */
97
  }
98
 
99
+ #gutter div[data-tooltip]:hover::before {
100
+ background-color: #555;
101
+ color: #fff;
102
+ }
103
+
104
  @keyframes gutter_tease {
105
  0% {
106
  transform: translateX(-40px);
 
145
  box-sizing: border-box;
146
  margin-left: calc(40% + 50px);
147
  margin-top: 20px;
 
148
  margin-right: 60px;
149
  width: 100%;
150
  }
151
 
152
+ #image-container::after {
153
+ /* makes space between the last item and the bottom of the container */
154
+ content: '';
155
+ display: block;
156
+ height: 40px;
157
+ width: 100%;
158
+ }
159
+
160
  #alert {
161
  position: fixed;
162
  z-index: 1;
 
1133
  font-size: 14px;
1134
  }
1135
 
1136
+ .image-item .img.censored {
1137
+ filter: blur(20px);
1138
+ }
1139
+
1140
  .image-item .imgBox .img.hidden {
1141
  display: none;
1142
  }
index.html CHANGED
@@ -61,12 +61,15 @@
61
  <label class="top_control">
62
  <input type="checkbox" checked="checked" name="deprecated" value="deprecated" autocomplete="off"><span>hide unknown to SDXL</span><span class="count"></span>
63
  </label>
 
 
 
64
  <div class="divider"></div>
65
  <span id="edit_most_used" class="hidden">edit these</span>
66
  <!-- JS will insert checkboxes here -->
67
  </div>
68
  <div id="gutter">
69
- <div data-tooltip="drag slowly"></div>
70
  </div>
71
  <div id="image-container">
72
  <div id="filtersHidingAll">
@@ -230,6 +233,10 @@
230
  <li>If you prompt with their names, the result will be unlike their actual style and generic, and you can achieve similar results by prompting "a painting", etc.</li>
231
  <li>They're included in the database for the record of what SDXL doesn't know</li>
232
  </ul>
 
 
 
 
233
  <h3>Important tags</h3>
234
  <ul>
235
  <li>Tap <strong>edit</strong> under the important category to add or remove tags</li>
@@ -354,7 +361,7 @@
354
  <li>Open source. Creatives Commons license. Download for free.</li>
355
  <li>I don't get nor do I want compensation for this. Getting thanks feels great!</li>
356
  <li>I'm not affiliated with Stability AI</li>
357
- <li>Use at your own risk. Contains mild nudity 🧟</li>
358
  </ul>
359
  </div>
360
  </div>
 
61
  <label class="top_control">
62
  <input type="checkbox" checked="checked" name="deprecated" value="deprecated" autocomplete="off"><span>hide unknown to SDXL</span><span class="count"></span>
63
  </label>
64
+ <label class="top_control">
65
+ <input type="checkbox" checked="checked" name="nudity" value="nudity" autocomplete="off"><span>allow risqué</span><span class="count"></span>
66
+ </label>
67
  <div class="divider"></div>
68
  <span id="edit_most_used" class="hidden">edit these</span>
69
  <!-- JS will insert checkboxes here -->
70
  </div>
71
  <div id="gutter">
72
+ <div data-tooltip=" "></div>
73
  </div>
74
  <div id="image-container">
75
  <div id="filtersHidingAll">
 
233
  <li>If you prompt with their names, the result will be unlike their actual style and generic, and you can achieve similar results by prompting "a painting", etc.</li>
234
  <li>They're included in the database for the record of what SDXL doesn't know</li>
235
  </ul>
236
+ <h3>Allow risqué</h3>
237
+ <ul>
238
+ <li>Unchecking blurs all images that don't meet extremely conservative, G-rated, 100% SFW criteria. Note that the most risqué this site gets is boobies. Even when allow risqué is checked, I've censored all below-the-waist nudity as liability protection.</li>
239
+ </ul>
240
  <h3>Important tags</h3>
241
  <ul>
242
  <li>Tap <strong>edit</strong> under the important category to add or remove tags</li>
 
361
  <li>Open source. Creatives Commons license. Download for free.</li>
362
  <li>I don't get nor do I want compensation for this. Getting thanks feels great!</li>
363
  <li>I'm not affiliated with Stability AI</li>
364
+ <li>Use at your own risk. You're responsible for your own actions.</li>
365
  </ul>
366
  </div>
367
  </div>
index.js CHANGED
@@ -65,6 +65,7 @@ async function startUp() {
65
  showHideCategories();
66
  await loadOptionsState();
67
  await loadFavoritesState();
 
68
  hideAllArtists();
69
  unhideBasedOnPermissiveSetting();
70
  sortArtists();
@@ -72,7 +73,7 @@ async function startUp() {
72
  updateArtistsImgSrc(false,false);
73
  updateTags('start');
74
  makeStyleRuleForDrag();
75
- teasePartition();
76
  promptBuilderAddArtist(true);
77
  updatePromptBuilderParts();
78
  addAllListeners();
@@ -250,7 +251,7 @@ async function loadEditedArtists() {
250
  editedArtists.delete(artistFound);
251
  } else {
252
  if (!proto.startsWith('http')) {
253
- // if this is a local file, then update artistData with the saved edits
254
  artistsData[i] = artistFound;
255
  }
256
  }
@@ -1114,8 +1115,78 @@ function checkAllInCategory(theCheckbox) {
1114
  }
1115
  }
1116
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1117
  function hideAllArtists() {
1118
- var imageItems = document.querySelectorAll('.image-item');
1119
  imageItems.forEach(function(imageItem) {
1120
  imageItem.classList.add('hidden');
1121
  });
@@ -1481,9 +1552,18 @@ function showExport() {
1481
  }
1482
  }
1483
  newTags.push(added);
1484
- // output updated artist
1485
  artist[2] = newTags.join('|');
1486
- value += '["'+artist[0]+'","'+artist[1]+'","'+artist[2]+'",'+artist[3]+'],\r\n';
 
 
 
 
 
 
 
 
 
 
1487
  }
1488
  textareaA.value = value;
1489
  }
@@ -3022,6 +3102,10 @@ function addAllListeners() {
3022
  unhideBasedOnPermissiveSetting();
3023
  updateTags('click');
3024
  });
 
 
 
 
3025
  }
3026
  }
3027
  // all checkboxes
@@ -3029,7 +3113,9 @@ function addAllListeners() {
3029
  styleLabelToCheckbox(this);
3030
  clearSelection();
3031
  storeCheckboxState(e.target);
3032
- updateArtistsImgSrc(false,false);
 
 
3033
  });
3034
  });
3035
  // information
@@ -3142,14 +3228,18 @@ function addAllListeners() {
3142
  var sortAA = document.getElementById('sortAA');
3143
  sortAA.addEventListener('click', function(e) {
3144
  sortArtistsByAlpha();
3145
- updateArtistsImgSrc(false,false);
 
 
3146
  highlightSelectedOption('sortAA');
3147
  storeOptionsState();
3148
  });
3149
  var sortAR = document.getElementById('sortAR');
3150
  sortAR.addEventListener('click', function(e) {
3151
  sortArtistsByRandom();
3152
- updateArtistsImgSrc(false,false);
 
 
3153
  highlightSelectedOption('sortAR');
3154
  storeOptionsState();
3155
  });
@@ -3157,6 +3247,7 @@ function addAllListeners() {
3157
  let secondModelSelector = document.querySelector('#second_model select');
3158
  secondModelSelector.addEventListener('change', function(e) {
3159
  setSecondModelSelected(this);
 
3160
  });
3161
 
3162
  // most used mode
@@ -3214,6 +3305,7 @@ function addAllListeners() {
3214
  });
3215
  imageItem.querySelector('.art_set').addEventListener('click', function() {
3216
  rotateModelsImages();
 
3217
  });
3218
  imageItem.getElementsByTagName('h3')[0].addEventListener('click', function(e) {
3219
  copyStuffToClipboard(this,'name');
@@ -3222,6 +3314,7 @@ function addAllListeners() {
3222
  imageItem.getElementsByTagName('h4')[0].addEventListener('click', function(e) {
3223
  if(!this.classList.contains('edit_mode')) {
3224
  copyStuffToClipboard(this, 'tags')
 
3225
  // toggleThisArtistsTags(this.textContent);
3226
  }
3227
  });
 
65
  showHideCategories();
66
  await loadOptionsState();
67
  await loadFavoritesState();
68
+ blurUnblurNudity();
69
  hideAllArtists();
70
  unhideBasedOnPermissiveSetting();
71
  sortArtists();
 
73
  updateArtistsImgSrc(false,false);
74
  updateTags('start');
75
  makeStyleRuleForDrag();
76
+ // teasePartition();
77
  promptBuilderAddArtist(true);
78
  updatePromptBuilderParts();
79
  addAllListeners();
 
251
  editedArtists.delete(artistFound);
252
  } else {
253
  if (!proto.startsWith('http')) {
254
+ // if this is a local file, then update artistsData with the saved edits
255
  artistsData[i] = artistFound;
256
  }
257
  }
 
1115
  }
1116
  }
1117
 
1118
+ function blurUnblurNudity() {
1119
+ let nudity = document.querySelector('input[name="nudity"]');
1120
+ if(nudity.checked) {
1121
+ let images = document.querySelectorAll('.img');
1122
+ images.forEach(function(img){
1123
+ img.classList.remove('censored');
1124
+ });
1125
+ } else {
1126
+ for (let i=0, il=artistsData.length; i<il; i++) {
1127
+ let artist = artistsData[i];
1128
+ for(j=0,jl=artist[4].length; j<jl; j++) {
1129
+ let blurBox = 0;
1130
+ let blurModel = artist[4][j][0];
1131
+ if(blurModel > 0) { blurBox = 1; }
1132
+ let blurImage = artist[4][j][1];
1133
+ if(blurImage == 'a') { blurImage = '.img_artwork'; }
1134
+ if(blurImage == 'p') { blurImage = '.img_portrait'; }
1135
+ if(blurImage == 'l') { blurImage = '.img_landscape'; }
1136
+ if(blurModel == secondModelSelected || blurModel == 0) {
1137
+ let imageItems = document.querySelectorAll('.image-item');
1138
+ for(k=0,kl=imageItems.length; k<kl; k++) {
1139
+ // find match in artistsData if first and last names match
1140
+ let imageItem = imageItems[k];
1141
+ let firstN = imageItem.querySelector('.firstN').textContent;
1142
+ let lastN = imageItem.querySelector('.lastN').textContent;
1143
+ if(artist[0] == lastN && artist[1] == firstN) {
1144
+ let box = imageItem.querySelector('.imgBox[data-model="' + blurBox + '"');
1145
+ let image = box.querySelector(blurImage).classList.add('censored');
1146
+ break;
1147
+ }
1148
+ }
1149
+ }
1150
+ }
1151
+ }
1152
+ }
1153
+ }
1154
+
1155
+ function toggleCensored(h4) {
1156
+ let imageItem = h4.closest('.image-item');
1157
+ let firstN = imageItem.querySelector('.firstN').textContent;
1158
+ let lastN = imageItem.querySelector('.lastN').textContent;
1159
+ for (let i=0, il=artistsData.length; i<il; i++) {
1160
+ let artist = artistsData[i];
1161
+ if(artist[0] == lastN && artist[1] == firstN) {
1162
+ let blurModel = imageItem.querySelector('.imgBox:not(.hidden)').dataset.model;
1163
+ if(blurModel == 1) { blurModel = secondModelSelected; }
1164
+ let img = imageItem.querySelector('.imgBox:not(.hidden) .img:not(.hidden)');
1165
+ let blurImage = '';
1166
+ if(img.classList.contains('img_artwork')) { blurImage = 'a'; }
1167
+ if(img.classList.contains('img_portrait')) { blurImage = 'p'; }
1168
+ if(img.classList.contains('img_landscape')) { blurImage = 'l'; }
1169
+ let blurNew = blurModel + blurImage;
1170
+ let match = false;
1171
+ for(j=0,jl=artist[4].length; j<jl; j++) {
1172
+ let blurOld = artist[4][j]
1173
+ if(blurNew == blurOld) {
1174
+ match = true;
1175
+ artist[4].splice(j,1);
1176
+ img.classList.remove('censored');
1177
+ }
1178
+ }
1179
+ if(!match) {
1180
+ artist[4].push(blurNew);
1181
+ img.classList.add('censored');
1182
+ }
1183
+ break;
1184
+ }
1185
+ }
1186
+ }
1187
+
1188
  function hideAllArtists() {
1189
+ let imageItems = document.querySelectorAll('.image-item');
1190
  imageItems.forEach(function(imageItem) {
1191
  imageItem.classList.add('hidden');
1192
  });
 
1552
  }
1553
  }
1554
  newTags.push(added);
 
1555
  artist[2] = newTags.join('|');
1556
+ // sort censored images array
1557
+ artist[4] = artist[4].sort(function(a, b) {
1558
+ return a.localeCompare(b);
1559
+ });
1560
+ let arrayStr = '';
1561
+ for (let i=0, il=artist[4].length; i<il; i++) {
1562
+ arrayStr += '"' + artist[4][i] + '",';
1563
+ }
1564
+ arrayStr = arrayStr.substring(0,arrayStr.length-1);
1565
+ // output updated artist
1566
+ value += '["'+artist[0]+'","'+artist[1]+'","'+artist[2]+'",'+artist[3]+',['+arrayStr+']],\r\n';
1567
  }
1568
  textareaA.value = value;
1569
  }
 
3102
  unhideBasedOnPermissiveSetting();
3103
  updateTags('click');
3104
  });
3105
+ } else if(checkbox.name == 'nudity') {
3106
+ checkbox.addEventListener('change', function(e) {
3107
+ blurUnblurNudity();
3108
+ });
3109
  }
3110
  }
3111
  // all checkboxes
 
3113
  styleLabelToCheckbox(this);
3114
  clearSelection();
3115
  storeCheckboxState(e.target);
3116
+ window.setTimeout(function() {
3117
+ updateArtistsImgSrc(false,false);
3118
+ })
3119
  });
3120
  });
3121
  // information
 
3228
  var sortAA = document.getElementById('sortAA');
3229
  sortAA.addEventListener('click', function(e) {
3230
  sortArtistsByAlpha();
3231
+ window.setTimeout(function() {
3232
+ updateArtistsImgSrc(false,false);
3233
+ })
3234
  highlightSelectedOption('sortAA');
3235
  storeOptionsState();
3236
  });
3237
  var sortAR = document.getElementById('sortAR');
3238
  sortAR.addEventListener('click', function(e) {
3239
  sortArtistsByRandom();
3240
+ window.setTimeout(function() {
3241
+ updateArtistsImgSrc(false,false);
3242
+ })
3243
  highlightSelectedOption('sortAR');
3244
  storeOptionsState();
3245
  });
 
3247
  let secondModelSelector = document.querySelector('#second_model select');
3248
  secondModelSelector.addEventListener('change', function(e) {
3249
  setSecondModelSelected(this);
3250
+ blurUnblurNudity();
3251
  });
3252
 
3253
  // most used mode
 
3305
  });
3306
  imageItem.querySelector('.art_set').addEventListener('click', function() {
3307
  rotateModelsImages();
3308
+ blurUnblurNudity();
3309
  });
3310
  imageItem.getElementsByTagName('h3')[0].addEventListener('click', function(e) {
3311
  copyStuffToClipboard(this,'name');
 
3314
  imageItem.getElementsByTagName('h4')[0].addEventListener('click', function(e) {
3315
  if(!this.classList.contains('edit_mode')) {
3316
  copyStuffToClipboard(this, 'tags')
3317
+ // toggleCensored(this);
3318
  // toggleThisArtistsTags(this.textContent);
3319
  }
3320
  });