Add Filename Character Limit (#19)

Co-authored-by: Stefan-Hintz <github@corbusierhaus.de>
pull/66/head
dec2-anon 2 years ago committed by GitHub
parent 3758abc652
commit 21f504fc8e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -155,7 +155,8 @@ struct StableDiffusionSample: ParsableCommand {
}
func imageName(_ sample: Int, step: Int? = nil) -> String {
var name = prompt.replacingOccurrences(of: " ", with: "_")
let fileCharLimit = 75
var name = prompt.prefix(fileCharLimit).replacingOccurrences(of: " ", with: "_")
if imageCount != 1 {
name += ".\(sample)"
}

Loading…
Cancel
Save