[diffusion] feat: Add Configurable Generator Device and Seed Support via API (#14366)
Co-authored-by: niehen6174 <niehen.6174@gmail.com> Co-authored-by: Mick <mickjagger19@icloud.com>
This commit is contained in:
co-authored by
niehen6174
Mick
parent
11d33c0e8f
commit
788628b56f
@@ -101,6 +101,7 @@ class SamplingParams:
|
||||
# Batch info
|
||||
num_outputs_per_prompt: int = 1
|
||||
seed: int = 1024
|
||||
generator_device: str = "cuda" # Device for random generator: "cuda" or "cpu"
|
||||
|
||||
# Original dimensions (before VAE scaling)
|
||||
num_frames: int = 125
|
||||
@@ -393,6 +394,13 @@ class SamplingParams:
|
||||
default=SamplingParams.seed,
|
||||
help="Random seed for generation",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--generator-device",
|
||||
type=str,
|
||||
default=SamplingParams.generator_device,
|
||||
choices=["cuda", "cpu"],
|
||||
help="Device for random generator (cuda or cpu). Default: cuda",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--num-frames",
|
||||
type=int,
|
||||
|
||||
Reference in New Issue
Block a user