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

Upscale #186

Merged
merged 11 commits into from
Mar 13, 2023
Merged

Upscale #186

merged 11 commits into from
Mar 13, 2023

Conversation

enzymezoo-code
Copy link
Contributor

Upscaler added to client

Notable change:

Command line call has been modified!
From:

python -m stability_sdk ...

to

python -m stability_sdk generate ...
python -m stability_sdk upscale ...

Backwards compatibility has been (mostly) maintained with a hack here:

if len(input_args)>0:

Usage

The client is initialized with an upscale_engine (default "esrgan-v1-x2plus").
As illustrated in the notebook, the upscaler can be invoked with:

answers = stability_api.upscale(
    init_image=img
)

Default output image size depends on the upscale_engine (x2 for esrgan-v1-x2plus). Optionally, a height or width can be requested to specify output size:

answers = stability_api.upscale(
    init_image=img,
    width=1000
)

Do not specify both a height and width, only specify one or neither. This is to preserve the aspect ratio of the original image.

pharmapsychotic
pharmapsychotic previously approved these changes Mar 2, 2023
Copy link
Member

@pharmapsychotic pharmapsychotic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice approach to allow future expansion to the command line tool while exposing upscale.

README.md Outdated Show resolved Hide resolved
src/stability_sdk/client.py Outdated Show resolved Hide resolved
@enzymezoo-code
Copy link
Contributor Author

enzymezoo-code commented Mar 2, 2023

TODO before merge:

  • Update colab notebook linked in README.md
  • Update tests/
  • Versioning

enzymezoo-code and others added 7 commits March 2, 2023 22:36
Co-authored-by: pharmapsychotic <96542870+pharmapsychotic@users.noreply.github.com>
Co-authored-by: pharmapsychotic <96542870+pharmapsychotic@users.noreply.github.com>
@sonarcloud
Copy link

sonarcloud bot commented Mar 7, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@enzymezoo-code enzymezoo-code marked this pull request as ready for review March 7, 2023 18:43
@enzymezoo-code enzymezoo-code merged commit f01a647 into main Mar 13, 2023
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

Successfully merging this pull request may close these issues.

None yet

2 participants