filter options
Browse files3 unmodified lines456789101112131415161718193 unmodified lines2324252627282930313233343536373839403 unmodified lines4445464748495015 unmodified lines6667686970718 unmodified lines8081828384858687888990919293945 unmodified lines10010110210310410510610710810911011111211311411510 unmodified lines1261271281291301311321331341351361371381393 unmodified lines<head><meta charset="utf-8" /><meta name="viewport" content="width=device-width" /><title>Diffusers gallery</title><meta name="description" content="Discover all difussion models on the Hugging Face hub."><meta property="og:url" content="https://huggingface-projects-diffusers-gallery.hf.space/"><meta property="og:type" content="website"><meta property="og:title" content="Hugging Face - Diffusers Models Gallery"><meta property="og:description" content="Discover all difussion models on the Hugging Face hub."><meta property="og:image" content="https://huggingface-projects-diffusers-gallery.hf.space/Fo6vR6JX0AEjbw1.jpeg"><meta name="twitter:card" content="player"><meta property="twitter:url" content="https://huggingface-projects-diffusers-gallery.hf.space/"><meta name="twitter:description" content="Discover all difussion models on the Hugging Face hub.">3 unmodified lines<meta name="twitter:image" content="https://huggingface-projects-diffusers-gallery.hf.space/Fo6vR6JX0AEjbw1.jpeg" /><meta name="twitter:player" content="https://huggingface-projects-diffusers-gallery.hf.space/index.html" /><meta name="twitter:player:width" content="100%"/><meta name="twitter:player:height" content="600"/><script src="https://cdnjs.cloudflare.com/ajax/libs/iframe-resizer/4.3.1/iframeResizer.contentWindow.min.js"></script><script src="https://cdn.tailwindcss.com"></script><style>body, html {height: 100%;}</style><script src="https://cdn.tailwindcss.com"></script><script type="module">3 unmodified linesAlpine.data("modelsData", () => ({async init() {const data = await this.getModels(this.page);this.models = data.models.map((model) => ({id: model.id,likes: model.likes,15 unmodified linesASSETS_URL: "https://d26smi9133w0oo.cloudfront.net/diffusers-gallery/",models: [],filter: "all",page: 1,totalPages: -1,isNSFW(model) {8 unmodified lines}return ""},buttonClass(filter) {if (this.filter === filter) {return "bg-black shadow-lg text-white"}return "text-gray-600 hover:bg-gray-200 hover:text-gray-800"},filterModels() {console.log(this.models)switch(this.filter) {case "all":return this.modelscase "anime":5 unmodified lines}return []},getModels(page) {// return fetch(`http://localhost:8000/api/models?page=${page}`).then(return fetch(`https://huggingface-projects-diffusers-gallery-bot.hf.space/api/models?page=${page}`).then((res) => res.json());},nextPage() {if (this.page < this.totalPages) {this.page += 1;this.getModels(this.page).then((data) => {const models = data.models.map((model) => ({id: model.id,likes: model.likes,10 unmodified lines</head><body class="pb-10 pt-5 bg-gray-100 relative"><section class="container px-6 grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4 mx-auto relative" x-data="modelsData"><div class="col-span-2 md:col-span-3 lg:col-span-4 flex items-center gap-2"><h1 class="mr-auto text-lg font-semibold">Diffusers Models Gallery</h1><button :class="buttonClass('all')" class="px-4 py-1 rounded-full" @click="filter='all'">All</button><button :class="buttonClass('anime')" class="text-gray-600 hover:bg-gray-200 hover:text-gray-800 px-4 py-1 rounded-full" @click="filter='anime'">Anime</button><button :class="buttonClass('3d')" class="text-gray-600 hover:bg-gray-200 hover:text-gray-800 px-4 py-1 rounded-full" @click="filter='3d'">3D</button><button :class="buttonClass('realistic')" class="text-gray-600 hover:bg-gray-200 hover:text-gray-800 px-4 py-1 rounded-full" @click="filter='realistic'">Realistic</button></div><template x-for="model in filterModels" :key="model.id"><template x-if="model.images.length > 0"><a :href="`https://huggingface.co/${model.id}`"3 unmodified lines456789101112131415161718193 unmodified lines232425262728293031323334353637383940413 unmodified lines4546474849505115 unmodified lines676869707172738 unmodified lines82838485868788899091929394955 unmodified lines10110210310410510610710810911011111211311411511611711811912012112212312412512612712812913010 unmodified lines1411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831843 unmodified lines<head><meta charset="utf-8" /><meta name="viewport" content="width=device-width" /><title>Diffusers gallery</title><meta name="description" content="Discover all difussion models on the Hugging Face hub."><meta property="og:url" content="https://huggingface-projects-diffusers-gallery.hf.space/"><meta property="og:type" content="website"><meta property="og:title" content="Hugging Face - Diffusers Models Gallery"><meta property="og:description" content="Discover all difussion models on the Hugging Face hub."><meta property="og:image" content="https://huggingface-projects-diffusers-gallery.hf.space/Fo6vR6JX0AEjbw1.jpeg"><meta name="twitter:card" content="player"><meta property="twitter:url" content="https://huggingface-projects-diffusers-gallery.hf.space/"><meta name="twitter:description" content="Discover all difussion models on the Hugging Face hub.">3 unmodified lines<meta name="twitter:image" content="https://huggingface-projects-diffusers-gallery.hf.space/Fo6vR6JX0AEjbw1.jpeg" /><meta name="twitter:player" content="https://huggingface-projects-diffusers-gallery.hf.space/index.html" /><meta name="twitter:player:width" content="100%" /><meta name="twitter:player:height" content="600" /><script src="https://cdnjs.cloudflare.com/ajax/libs/iframe-resizer/4.3.1/iframeResizer.contentWindow.min.js"></script><script src="https://cdn.tailwindcss.com"></script><style>body,html {height: 100%;}</style><script src="https://cdn.tailwindcss.com"></script><script type="module">3 unmodified linesAlpine.data("modelsData", () => ({async init() {const data = await this.getModels(this.page, this.sort);this.models = data.models.map((model) => ({id: model.id,likes: model.likes,15 unmodified linesASSETS_URL: "https://d26smi9133w0oo.cloudfront.net/diffusers-gallery/",models: [],filter: "all",sort: "trending",page: 1,totalPages: -1,isNSFW(model) {8 unmodified lines}return ""},buttonClass(attr, filter) {if (this[attr] === filter) {return "bg-black shadow-lg text-white"}return "text-gray-600 hover:bg-gray-200 hover:text-gray-800"},filterModels() {switch (this.filter) {case "all":return this.modelscase "anime":5 unmodified lines}return []},sortModels(sort) {this.sort = sortthis.page = 1this.getModels(this.page, this.sort).then((data) => {const models = data.models.map((model) => ({id: model.id,likes: model.likes,class: model.class,images: model.images.filter((image) => image && image.endsWith(".jpg")),}));this.models = models;});},getModels(page, sort) {// return fetch(`http://localhost:8000/api/models?page=${page}&sort=${sort}`).then(return fetch(`https://huggingface-projects-diffusers-gallery-bot.hf.space/api/models?page=${page}`).then((res) => res.json());},nextPage() {if (this.page < this.totalPages) {this.page += 1;this.getModels(this.page, this.sort).then((data) => {const models = data.models.map((model) => ({id: model.id,likes: model.likes,10 unmodified lines</head><body class="pb-10 pt-5 bg-gray-100 relative"><section class="container px-6 grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4 mx-auto relative"x-data="modelsData"><div class="col-span-2 md:col-span-1 flex items-center gap-2 row-start-1"><h1 class="mr-auto text-lg font-semibold">Diffusers Models Gallery</h1></div><div class="col-span-2 md:col-span-3 flex items-center gap-2 flex flex-wrap lg-auto"><div class="flex text-xs gap-2"><span class="px-3 py-1 font-thin">sort by</span><button :class="buttonClass('sort', 'trending')" class="px-2 md:px-3 py-1 rounded-full text"@click="sortModels('trending')">Trending</button><button :class="buttonClass('sort', 'recent')"class="text-gray-600 hover:bg-gray-200 hover:text-gray-800 px-2 md:px-3 py-1 rounded-full"@click="sortModels('recent')">Recent</button><button :class="buttonClass('sort', 'likes')"class="text-gray-600 hover:bg-gray-200 hover:text-gray-800 px-2 md:px-3 py-1 rounded-full"@click="sortModels('likes')">MostLikes</button></div><div class="flex text-xs gap-2"><span class="px-2 md:px-3 py-1 font-thin"> style</span><button :class="buttonClass('filter', 'all')" class="px-2 md:px-3 py-1 rounded-full"@click="filter='all'">All</button><button :class="buttonClass('filter', 'anime')"class="text-gray-600 hover:bg-gray-200 hover:text-gray-800 px-2 md:px-3 py-1 rounded-full"@click="filter='anime'">Anime</button><button :class="buttonClass('filter', '3d')"class="text-gray-600 hover:bg-gray-200 hover:text-gray-800 px-2 md:px-3 py-1 rounded-full"@click="filter='3d'">3D</button><button :class="buttonClass('filter', 'realistic')"class="text-gray-600 hover:bg-gray-200 hover:text-gray-800 px-2 md:px-3 py-1 rounded-full"@click="filter='realistic'">Realistic</button><button :class="buttonClass('filter', 'realistic')"class="text-gray-600 hover:bg-gray-200 hover:text-gray-800 px-2 md:px-3 py-1 rounded-full"@click="filter='realistic'">18+</button></div></div><template x-for="model in filterModels" :key="model.id"><template x-if="model.images.length > 0"><a :href="`https://huggingface.co/${model.id}`"
index.html+68-23