radames HF staff commited on
Commit
ad0e260
1 Parent(s): b0a0133
Files changed (1) hide show
  1. index.html +80 -20
index.html CHANGED
@@ -5,23 +5,53 @@
5
  <meta name="viewport" content="width=device-width" />
6
 
7
  <title>Diffusers gallery</title>
8
- <meta name="description" content="Discover all difussion models on the Hugging Face hub." />
 
 
 
9
 
10
- <meta property="og:url" content="https://huggingface-projects-diffusers-gallery.hf.space/" />
 
 
 
11
  <meta property="og:type" content="website" />
12
- <meta property="og:title" content="Hugging Face - Diffusers Models Gallery" />
13
- <meta property="og:description" content="Discover all difussion models on the Hugging Face hub." />
14
- <meta property="og:image" content="https://huggingface-projects-diffusers-gallery.hf.space/Fo6vR6JX0AEjbw1.jpeg" />
 
 
 
 
 
 
 
 
 
15
 
16
  <meta name="twitter:card" content="player" />
17
- <meta property="twitter:url" content="https://huggingface-projects-diffusers-gallery.hf.space/" />
18
- <meta name="twitter:description" content="Discover all difussion models on the Hugging Face hub." />
 
 
 
 
 
 
19
 
20
  <meta name="twitter:site" content="@huggingface" />
21
- <meta name="twitter:title" content="Hugging Face - Diffusers Models Gallery" />
 
 
 
22
 
23
- <meta name="twitter:image" content="https://huggingface-projects-diffusers-gallery.hf.space/Fo6vR6JX0AEjbw1.jpeg" />
24
- <meta name="twitter:player" content="https://huggingface-projects-diffusers-gallery.hf.space/index.html" />
 
 
 
 
 
 
25
  <meta name="twitter:player:width" content="100%" />
26
  <meta name="twitter:player:height" content="600" />
27
 
@@ -66,17 +96,21 @@
66
  this.totalPages = data.totalPages;
67
  },
68
  async getModels(page, sort, style) {
69
- // const res = await fetch(`http://localhost:8000/api/models?page=${page}&sort=${sort}&style=${style}`)
70
  const res = await fetch(
71
- `https://huggingface-projects-diffusers-gallery-bot.hf.space/api/models?page=${page}&sort=${sort}&style=${style}`
72
  );
 
 
 
73
  const data = await res.json();
74
  const models = data.models.map((model) => ({
75
  id: model.id,
76
  likes: model.likes,
77
  class: model.class,
78
  isNFSW: model.isNFSW,
79
- images: model.images.filter((image) => image && image.endsWith(".jpg")),
 
 
80
  }));
81
 
82
  return {
@@ -87,7 +121,11 @@
87
  async nextPage() {
88
  if (this.page < this.totalPages) {
89
  this.page += 1;
90
- const data = await this.getModels(this.page, this.sort, this.filter);
 
 
 
 
91
  this.models = this.models.concat(data.models);
92
  this.totalPages = data.totalPages;
93
  }
@@ -103,12 +141,18 @@
103
  x-data="modelsData"
104
  >
105
  <div class="col-span-2 lg:col-span-1 flex flex-col gap-2 row-start">
106
- <h1 class="text-lg font-semibold dark:text-white whitespace-nowrap">Diffusers Models Gallery</h1>
 
 
107
  </div>
108
 
109
- <div class="col-span-2 md:col-span-3 flex items-center gap-4 flex flex-wrap lg-auto lg:ml-auto text-sm">
 
 
110
  <div class="flex gap-2">
111
- <span class="md:px-3 py-1 dark:text-white text-gray-400">sort by</span>
 
 
112
  <button
113
  :class="buttonClass('sort', 'trending')"
114
  class="px-2 md:px-3 py-1 rounded-full text"
@@ -161,6 +205,13 @@
161
  >
162
  Realistic
163
  </button>
 
 
 
 
 
 
 
164
  </div>
165
  </div>
166
 
@@ -174,7 +225,9 @@
174
  <div
175
  class="absolute bottom-0 p-4 bg-gradient-to-t text-white pt-10 from-black/90 via-black/70 to-transparent w-full z-10"
176
  >
177
- <div class="text-sm flex items-center group-hover:translate-x-0.5 transition">
 
 
178
  <svg
179
  class="mr-1.5 text-white/70"
180
  xmlns="http://www.w3.org/2000/svg"
@@ -199,7 +252,10 @@
199
  class="text-sm md:text-lg lg:text-xl font-semibold group-hover:translate-x-0.5 transition"
200
  ></div>
201
  </div>
202
- <div class="group-hover:brightness-90 h-full" :class="model.isNFSW ? 'blur-md' : ''">
 
 
 
203
  <template x-if="model.images[0]">
204
  <img
205
  :src="()=> ASSETS_URL + model.images[0]"
@@ -212,7 +268,11 @@
212
  </a>
213
  </template>
214
  </template>
215
- <div class="h-12 relative" x-intersect="nextPage" data-iframe-height></div>
 
 
 
 
216
  </section>
217
  </body>
218
  </html>
 
5
  <meta name="viewport" content="width=device-width" />
6
 
7
  <title>Diffusers gallery</title>
8
+ <meta
9
+ name="description"
10
+ content="Discover all difussion models on the Hugging Face hub."
11
+ />
12
 
13
+ <meta
14
+ property="og:url"
15
+ content="https://huggingface-projects-diffusers-gallery.hf.space/"
16
+ />
17
  <meta property="og:type" content="website" />
18
+ <meta
19
+ property="og:title"
20
+ content="Hugging Face - Diffusers Models Gallery"
21
+ />
22
+ <meta
23
+ property="og:description"
24
+ content="Discover all difussion models on the Hugging Face hub."
25
+ />
26
+ <meta
27
+ property="og:image"
28
+ content="https://huggingface-projects-diffusers-gallery.hf.space/Fo6vR6JX0AEjbw1.jpeg"
29
+ />
30
 
31
  <meta name="twitter:card" content="player" />
32
+ <meta
33
+ property="twitter:url"
34
+ content="https://huggingface-projects-diffusers-gallery.hf.space/"
35
+ />
36
+ <meta
37
+ name="twitter:description"
38
+ content="Discover all difussion models on the Hugging Face hub."
39
+ />
40
 
41
  <meta name="twitter:site" content="@huggingface" />
42
+ <meta
43
+ name="twitter:title"
44
+ content="Hugging Face - Diffusers Models Gallery"
45
+ />
46
 
47
+ <meta
48
+ name="twitter:image"
49
+ content="https://huggingface-projects-diffusers-gallery.hf.space/Fo6vR6JX0AEjbw1.jpeg"
50
+ />
51
+ <meta
52
+ name="twitter:player"
53
+ content="https://huggingface-projects-diffusers-gallery.hf.space/index.html"
54
+ />
55
  <meta name="twitter:player:width" content="100%" />
56
  <meta name="twitter:player:height" content="600" />
57
 
 
96
  this.totalPages = data.totalPages;
97
  },
98
  async getModels(page, sort, style) {
 
99
  const res = await fetch(
100
+ `http://localhost:7860/api/models?page=${page}&sort=${sort}&style=${style}`
101
  );
102
+ // const res = await fetch(
103
+ // `https://huggingface-projects-diffusers-gallery-bot.hf.space/api/models?page=${page}&sort=${sort}&style=${style}`
104
+ // );
105
  const data = await res.json();
106
  const models = data.models.map((model) => ({
107
  id: model.id,
108
  likes: model.likes,
109
  class: model.class,
110
  isNFSW: model.isNFSW,
111
+ images: model.images.filter(
112
+ (image) => image && image.endsWith(".jpg")
113
+ ),
114
  }));
115
 
116
  return {
 
121
  async nextPage() {
122
  if (this.page < this.totalPages) {
123
  this.page += 1;
124
+ const data = await this.getModels(
125
+ this.page,
126
+ this.sort,
127
+ this.filter
128
+ );
129
  this.models = this.models.concat(data.models);
130
  this.totalPages = data.totalPages;
131
  }
 
141
  x-data="modelsData"
142
  >
143
  <div class="col-span-2 lg:col-span-1 flex flex-col gap-2 row-start">
144
+ <h1 class="text-lg font-semibold dark:text-white whitespace-nowrap">
145
+ Diffusers Models Gallery
146
+ </h1>
147
  </div>
148
 
149
+ <div
150
+ class="col-span-2 md:col-span-3 flex items-center gap-4 flex flex-wrap lg-auto lg:ml-auto text-sm"
151
+ >
152
  <div class="flex gap-2">
153
+ <span class="md:px-3 py-1 dark:text-white text-gray-400"
154
+ >sort by</span
155
+ >
156
  <button
157
  :class="buttonClass('sort', 'trending')"
158
  class="px-2 md:px-3 py-1 rounded-full text"
 
205
  >
206
  Realistic
207
  </button>
208
+ <button
209
+ :class="buttonClass('filter', 'lora')"
210
+ class="text-gray-600 hover:bg-gray-200 dark:hover:bg-gray-500 hover:text-gray-800 px-2 md:px-3 py-1 rounded-full"
211
+ @click="filterModels('lora')"
212
+ >
213
+ Lora
214
+ </button>
215
  </div>
216
  </div>
217
 
 
225
  <div
226
  class="absolute bottom-0 p-4 bg-gradient-to-t text-white pt-10 from-black/90 via-black/70 to-transparent w-full z-10"
227
  >
228
+ <div
229
+ class="text-sm flex items-center group-hover:translate-x-0.5 transition"
230
+ >
231
  <svg
232
  class="mr-1.5 text-white/70"
233
  xmlns="http://www.w3.org/2000/svg"
 
252
  class="text-sm md:text-lg lg:text-xl font-semibold group-hover:translate-x-0.5 transition"
253
  ></div>
254
  </div>
255
+ <div
256
+ class="group-hover:brightness-90 h-full"
257
+ :class="model.isNFSW ? 'blur-md' : ''"
258
+ >
259
  <template x-if="model.images[0]">
260
  <img
261
  :src="()=> ASSETS_URL + model.images[0]"
 
268
  </a>
269
  </template>
270
  </template>
271
+ <div
272
+ class="h-12 relative"
273
+ x-intersect="nextPage"
274
+ data-iframe-height
275
+ ></div>
276
  </section>
277
  </body>
278
  </html>