ExplainableML / ReNO

ReNO: Enhancing One-step Text-to-Image Models through Reward-based Noise Optimization
MIT License
64 stars 3 forks source link

Handling negative arguments with argparse #1

Closed pbaylies closed 3 months ago

pbaylies commented 3 months ago

https://github.com/ExplainableML/ReNO/blob/172e9973be395db744f1869632a8b1ed0fcdb7a3/arguments.py#L41

Friendly note that for negative (action store_false) default arguments on the command line, I'd suggest handling it like so:

parser.add_argument("--disable_hps", default=True, action="store_false", dest="enable_hps")

That's because it's confusing to "enable" something on the command line and then have it end up disabled.

sgk98 commented 3 months ago

Thanks for the suggestion! I have made the changes here a6a8b47. The losses used in the paper (HPSv2, ImageReward, CLIP, PickScore, Regularization) are enabled by default, and can be removed with the --disable_ flag. If you have any other suggestions/changes, please let us know, or feel free to make a pull request.