Skip to content

Commit

Permalink
Add: Add use_gpu params.
Browse files Browse the repository at this point in the history
  • Loading branch information
chairc committed Dec 12, 2024
1 parent e924f11 commit b432297
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tools/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def __init__(self, gen_args, deploy=False):
# Weight path
self.weight_path = self.args.weight_path
# Run device initializer
self.device = device_initializer()
self.device = device_initializer(device_id=self.args.use_gpu)
# Enable conditional generation, sample type, network, image size,
# number of classes and select activation function
gen_results = generate_initializer(ckpt_path=self.weight_path, conditional=self.args.conditional,
Expand Down Expand Up @@ -165,6 +165,8 @@ def init_generate_args():
parser.add_argument("--class_name", type=int, default=0)
# classifier-free guidance interpolation weight, users can better generate model effect (recommend)
parser.add_argument("--cfg_scale", type=int, default=3)
# Set the use GPU in generate (required)
parser.add_argument("--use_gpu", type=int, default=0)

# =====================Older versions(version <= 1.1.1)=====================
# Enable conditional generation (required)
Expand Down

0 comments on commit b432297

Please sign in to comment.