From 1aa7850108c51b2ad67cb5aef974b652ddec42fd Mon Sep 17 00:00:00 2001
From: svenkevs <33825694+svenkevs@users.noreply.github.com>
Date: Sun, 30 Jul 2023 06:52:46 +0800
Subject: [PATCH] Update main.swift

See issue: https://github.com/apple/ml-stable-diffusion/issues/220

When running the --help argument (swift run StableDiffusionSample --help) the generated documentation calculates a random seed each time, and passes the result of the RNG as the default seed option.

The documentation implies that you have to provide some argument with --seed in order to get a random number, or otherwise it will provide the shown 'default value'. While this should be the other way around.

Run 1:
--seed Random seed (default: 3944433010)
Run 2:
--seed Random seed (default: 1029080931)
Run n:
--seed Random seed (default: 769278928)
---
 swift/StableDiffusionCLI/main.swift | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/swift/StableDiffusionCLI/main.swift b/swift/StableDiffusionCLI/main.swift
index da344471..55a226e2 100644
--- a/swift/StableDiffusionCLI/main.swift
+++ b/swift/StableDiffusionCLI/main.swift
@@ -62,7 +62,7 @@ struct StableDiffusionSample: ParsableCommand {
     @Option(help: "Output path")
     var outputPath: String = "./"
 
-    @Option(help: "Random seed")
+    @Option(help: "Provide set seed value, defaults to random seed")
     var seed: UInt32 = UInt32.random(in: 0...UInt32.max)
 
     @Option(help: "Controls the influence of the text prompt on sampling process (0=random images)")