Skip to content

Conversation

@plucked
Copy link
Contributor

@plucked plucked commented Oct 7, 2022

This proposal is for a feature to let a user define the filename format.

The use case would look like this:

dream> a cat --fnformat {seed}_{steps}_{cfg_scale}_{gfpgan_strength}.png
Generating:   0%|                                                                                                                                                 | 0/1 [00:00<?, ?it/s]>> Sampling with k_lms
100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 50/50 [00:06<00:00,  7.75it/s]
Generating: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:06<00:00,  6.71s/it]
>> Usage stats:
>>   1 image(s) generated in 6.74s
>>   Max VRAM used for this generation: 3.31G. Current VRAM utilization: 2.17G
>>   Max VRAM used since script start:  3.31G
Outputs:
[12] outputs/img-samples/3328504408_50_7.5_0.0.png: "a cat" -s 50 -S 3328504408 -W 512 -H 512 -C 7.5 --fnformat {seed}_{steps}_{cfg_scale}_{gfpgan_strength}.png -A k_lms

Documentation:

Filename Format

The argument --fnformat allows to specify the filename of the image. Supported wildcards are all arguments what can be set such as
perlin, seed, threshold, height, width, gfpgan_strength, sampler_name, steps, model, upscale, prompt, cfg_scale, prefix.

The following prompt

dream> a red car --steps 25 -C 9.8 --perlin 0.1 --fnformat {prompt}_steps.{steps}_cfg.{cfg_scale}_perlin.{perlin}.png

generates a file with the name: outputs/img-samples/a red car_steps.25_cfg.9.8_perlin.0.1.png


@plucked plucked changed the title feat: adding filename format template (proposal) feat: adding filename format template Oct 7, 2022
@plucked plucked marked this pull request as ready for review October 7, 2022 10:22
@plucked plucked changed the title (proposal) feat: adding filename format template feat: adding filename format template Oct 7, 2022
@19wolf
Copy link
Contributor

19wolf commented Oct 17, 2022

Any updates on merging this?

Copy link
Collaborator

@lstein lstein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! There's been some divergence of code since the PR was submitted, but I will attempt to fix the conflicts on my own. If there are any issues I encountered, I'll add another comment.

@lstein lstein merged commit 99d23c4 into invoke-ai:development Oct 25, 2022
@lstein
Copy link
Collaborator

lstein commented Oct 25, 2022

It's merged. One nice additional feature would be to let the user specify the fnformat on the shell command line when invoking the script. I added --fnformat to the command-line args processing, but an additional line of code or two is needed to have it used in invoke.py.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants