ShineChen1024 / MagicClothing

Official implementation of Magic Clothing: Controllable Garment-Driven Image Synthesis
Other
1.21k stars 124 forks source link

How can I parse more arguements when using inference.py #83

Open CCJetWing opened 2 months ago

CCJetWing commented 2 months ago

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

LeoXiangkai commented 1 month ago

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

CCJetWing commented 1 month ago

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?