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 to modify the configuration of a model(like using zits) when using command line? #546

Open
darewolf-cyber opened this issue Jul 3, 2024 · 1 comment

Comments

@darewolf-cyber
Copy link

Dear authors:
Great project! I've already donated 5 dollars. I know how to modify the configuration of a model, like "crop" or "original" in the GUI window, but I don't know how to do this using a command line, this is especially important when my server can't use GUI. Also, I can use win_config.bat in my win10 computer to modify a setting called "image quality", which is by default 95. But I don't know how to set this by command line.

@Sanster
Copy link
Owner

Sanster commented Jul 4, 2024

You can create a 'config.json' file that can refer to this class for configuration

class InpaintRequest(BaseModel):

{"hd_strategy": "Resize", "hd_strategy_resize_limit": 300}

Use 'config.json' to perform batch processing:

iopaint run \
--model lama \
--image imgpath or imgdir \
--mask maskpath \
--config config.json \
--output ./tmp

Using the 'iopaint run' command, 'image quality' defaults to 100:

img_bytes = pil_to_bytes(Image.fromarray(inpaint_result), "png", 100, infos)

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