feat: stable-diffusion t2i add --seed (#558)

This commit is contained in:
zweifisch
2024-03-10 21:12:54 +08:00
committed by GitHub
parent ad3cf5ed98
commit d0fa6cfcae
2 changed files with 5 additions and 3 deletions

View File

@@ -110,7 +110,7 @@ class StableDiffusion:
seed=None,
):
# Set the PRNG state
seed = seed or int(time.time())
seed = int(time.time()) if seed is None else seed
mx.random.seed(seed)
# Get the text conditioning
@@ -140,7 +140,7 @@ class StableDiffusion:
seed=None,
):
# Set the PRNG state
seed = seed or int(time.time())
seed = int(time.time()) if seed is None else seed
mx.random.seed(seed)
# Define the num steps and start step
@@ -238,7 +238,7 @@ class StableDiffusionXL(StableDiffusion):
seed=None,
):
# Set the PRNG state
seed = seed or int(time.time())
seed = int(time.time()) if seed is None else seed
mx.random.seed(seed)
# Get the text conditioning