Skip to content

Commit 21f504f

Browse files
Add Filename Character Limit (#19)
Co-authored-by: Stefan-Hintz <[email protected]>
1 parent 3758abc commit 21f504f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

swift/StableDiffusionCLI/main.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,8 @@ struct StableDiffusionSample: ParsableCommand {
155155
}
156156

157157
func imageName(_ sample: Int, step: Int? = nil) -> String {
158-
var name = prompt.replacingOccurrences(of: " ", with: "_")
158+
let fileCharLimit = 75
159+
var name = prompt.prefix(fileCharLimit).replacingOccurrences(of: " ", with: "_")
159160
if imageCount != 1 {
160161
name += ".\(sample)"
161162
}

0 commit comments

Comments
 (0)