Stability-AI / StableSwarmUI

StableSwarmUI, A Modular Stable Diffusion Web-User-Interface, with an emphasis on making powertools easily accessible, high performance, and extensibility.
MIT License
4.52k stars 361 forks source link

In OutPathBuilder, [model] is defined as "model name", however this parameter includes a subpath component. Proposal to add [model_filename]. #404

Closed brendanhoar closed 3 months ago

brendanhoar commented 3 months ago

For the purposes of the below, assume agreement on leaving out the file extension.

Issue: I would like to use the model filename as part of my OutPathBuilder format string. As per the on screen documentation, [model] is defined as "model name". However, in reality [model] is "full sub path to model under the top level model directory."

Example/Request: And since a picture is worth a thousand words, see yellow highlighted bits in the example below. In this example I would have preferred to only see [model] return "picxReal_10" instead of "_offload_i_sd15picxReal_10". Since [model] is already defined the way it is, I propose adding [model_filename] that does what I am requesting, which does not use the intervening directories in the output string.

  1. The definition of [model] is shown in GUI, as well as the example format string I entered:

filenaming_01

The generation screen showing the model sub-path:

filenaming_02

The resulting output path assigned to the image file, with the subpath component (slashes stripped) that I do not want:

filenaming_04

PS - if proposed enhancement is accepted, the on-screen documentation for [model] would obviously need to be updated.

mcmonkey4eva commented 3 months ago

Oh that'd be [model_title] The full documentation for out path builder didn't fit in a popup so the popup just links https://github.com/Stability-AI/StableSwarmUI/blob/master/docs/User%20Settings.md#path-format which documents model_title

[model]: the filename of the model
[model_title]: the metadata title of the model

*I've fixed the link to be clickable instead of just text of the url, heh

brendanhoar commented 3 months ago

No, that's not what I am asking for.

I am requesting the model filename (at the operating system level), not anything from the internal metadata.

B

mcmonkey4eva commented 3 months ago

You want... the filename, but not the full filename, and not the title either... why so specific? 0.o

brendanhoar commented 3 months ago

Basically:

Here are things that are the filename: picxReal_10.safetensors

Here are things that are not the filename: This OS-view file path is: G:\___all_webuis\StableSwarmUI\Models\Stable-Diffusion\_offload_i\_sd15\picxReal_10.safetensors This app-view file path is: _offload_i\_sd15\picxReal_10.safetensors

I do not want any of the directory parts of the path, only the file name component.

 There are only two hard things in Computer Science: cache invalidation and naming things.

 -- Phil Karlton

(edits: backslashes are cursed, whyyyy)

mcmonkey4eva commented 3 months ago

My question was why

brendanhoar commented 3 months ago

My question was why

Short version number 1: Well, at some point model organizing will become several more directory layers deep and it will just be too much noise in the filename. My policy is not to change data inside the files (e.g. metadata edits) as I have a slow side project of comparing hashes of files and file components, so directory organizing will continue to be useful here.

Short version number 2: I've always done it that way with A1111. I'm probably not the only one.

mcmonkey4eva commented 3 months ago

If you haven't customized metadata on the model, the title is the filename without directory info

brendanhoar commented 3 months ago

That may be the case most of the time, but I have downloaded files which display a "Title" that does not match the filename. I think is only the filename under certain metadata conditions? I did not customize the metadata (perhaps the uploader did).

filenaming_06

B

mcmonkey4eva commented 3 months ago

yes the uploader set a title on their model

mcmonkey4eva commented 3 months ago

oh this is delayed for me to remember sorry, but that's what this option is for:

image

brendanhoar commented 3 months ago

lol ok thanks man, I should have investigated more. :)

B