Dear Perchance Dev. Please add the ability to sort not only by Prompt and NegativePrompt, but also by SaveTitle and SaveDescription 🙏

you are viewing a single comment's thread
view the rest of the comments
[–] 1 point 5 months ago (2 children)

If you mean a public gallery or public generators or such, you'd need to add the script details yourself but you could shlap something like this in.

<!-- sample search thingy -->

<!-- sort filter section -->
<div style="margin: auto; display: flex; justify-content: center; align-items: center; flex-wrap: wrap;">
  <span class="mainctls sortctl" style="margin-left: 8px; font-family: inherit; color: red;" >
    <select id="sortSelect" onchange="handleSort(this.value)">
      <option value="default" selected>Sort</option>
      <option value="a-z">A-Z</option>
      <option value="z-a">Z-A</option>
      <option value="dateCreated">Date Created</option>
      <option value="newest">Newest</option>
      <option value="oldest">Oldest</option>
      <option value="mostViews">Most Views</option>
    </select>
  </span>

  <!-- search filter thingy-->
  <span class="mainctls filterctl" style="margin-left: 8px; font-family: inherit; color: red;">
    <select id="filterSelect" onchange="handleFilter(this.value)">
      <option value="default" selected>Filter</option>
      <option value="all">All</option>
      <option value="Prompt">Prompt</option>
      <option value="NegativePrompt">NegativePrompt</option>
      <option value="SaveTitle">SaveTitle</option>
      <option value="SaveDescription">SaveDescription</option>
      <option value="Model">Model</option>
      <option value="Sampler">Sampler</option>
      <option value="CFGScale">CFGScale</option>
      <option value="Steps">Steps</option>
      <option value="ClipSkip">ClipSkip</option>
      <option value="Seed">Seed</option>
      <option value="FaceRestoration">FaceRestoration</option>
      <option value="Comments">Comments</option>
      <option value="Tags">Tags</option>
    </select>
  </span>
</div>

Nice simple generic search thingy, but then you kinda have to hope that they have tags or references to filter. This is just a scuffy sample but, its a simple start if you want to use it and work from. You need to populate the handleFilter(this.value) and handleSort(this.value) to work depending on how you want to use it, i left them empty so you can work away with it.

  • source
  • hideshow 2 child comments
  • [–] [S] 2 points 5 months ago (1 child)

    Are you sure these are built-in functions of plugin? I tried using handleFilter(this.value) and handleSort(this.value), but I got an error saying that there are no such functions. Without the actual code for these functions, it won't work

  • source
  • parent
  • hideshow 1 child comment
  • [–] 1 point 5 months ago

    Oh those are just place holders for setting up a search for yourself, i just gave you a rough wireframe start to work with. Like i said some people might not tag or add references or descriptions into their uploads so it might not find everything which isnt a bad thing, just shows nobody is adding tags or details or such.

  • source
  • parent