Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
CCJetWing opened this issue May 15, 2024 · 2 comments
Open

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

CCJetWing opened this issue May 15, 2024 · 2 comments

Comments

@CCJetWing
Copy link

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

@LeoXiangkai
Copy link

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
Copy link
Author

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants