Use part of filename in prompt #120
-
Context probably isn't very helpful but in case it is, I want to make a bunch of portraits for a ttrpg campaign Many are basically the same thing, a man or a woman in different poses, so they have the same filename with _1 or _2 in the end Is there some way to run the batch img2img script and feed the filename excluding the last x characters as part of the prompt? Thanks for taking the time and building this powerhouse of an extension edit |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @vassijoseph, You'll want to take a look at the So if your filename is
This may work for slicing a directory name out of a string as well, although it depends on how your paths are formatted. |
Beta Was this translation helpful? Give feedback.
Hi @vassijoseph,
You'll want to take a look at the
[substring]
shortcode - I just updated it to accept arbitrary strings for thestart
andend
values.So if your filename is
somepicturename_01.png
you can retrievesomepicturename
as follows:This may work for slicing a directory name out of a string as well, although it depends on how your paths are formatted.