diff --git a/swift/StableDiffusionCLI/main.swift b/swift/StableDiffusionCLI/main.swift index 6b09af62..860dace1 100644 --- a/swift/StableDiffusionCLI/main.swift +++ b/swift/StableDiffusionCLI/main.swift @@ -145,7 +145,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)" }