ShineChen1024/MagicClothing

How can I parse more arguements when using inference.py

CCJetWing opened this issue · 2 comments

I would like to add arguements like prompt, height, width, seed, etc. when I run inference.py, how can I achieve this?

You can modify the inference.py file to support passing more parameters.

parser.add_argument('--output_path', type=str, default="./output_img")

Add the following code after the above code:

    parser.add_argument('--positive_prompt', type=str)
    parser.add_argument('--negative_prompt', type=str)
    parser.add_argument('--height', type=int)
    parser.add_argument('--width', type=int)
    parser.add_argument('--seed', type=int)
    parser.add_argument('--batch_size', type=int)
images = full_net.generate(cloth_image)

change into

images = full_net.generate(cloth_image, prompt=args.positive_prompt, negative_prompt=args.negative_prompt, height=args.height, width=args.width, seed=args.seed, num_images_per_prompt=args.batch_size)

You can try it and see if it works

You can modify the inference.py file to support passing more parameters.

parser.add_argument('--output_path', type=str, default="./output_img")

Add the following code after the above code:

    parser.add_argument('--positive_prompt', type=str)
    parser.add_argument('--negative_prompt', type=str)
    parser.add_argument('--height', type=int)
    parser.add_argument('--width', type=int)
    parser.add_argument('--seed', type=int)
    parser.add_argument('--batch_size', type=int)
images = full_net.generate(cloth_image)

change into

images = full_net.generate(cloth_image, prompt=args.positive_prompt, negative_prompt=args.negative_prompt, height=args.height, width=args.width, seed=args.seed, num_images_per_prompt=args.batch_size)

You can try it and see if it works

It works, and I want to ask if I can use other SD checkpoints to change the style of the output?