From cc79cac5fc20ea200b1423e8e8d037acee653965 Mon Sep 17 00:00:00 2001 From: jaydrennan Date: Mon, 29 Jan 2024 13:40:53 -0800 Subject: [PATCH] refactor: ruff formatting --- README.md | 8 +++++--- docs/index.md | 14 +++++++------- imaginairy/api/upscale.py | 2 +- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 90ce8a8..cc5906d 100644 --- a/README.md +++ b/README.md @@ -355,9 +355,7 @@ When writing strength modifiers keep in mind that pixel values are between 0 and ## Image Upscaling -Upscale images easily. - -You can view available models with "aimg upscale --list-models". Try a different model by using --upscale-model with the name or a url. +Upscale images easily. === "CLI" ```bash @@ -375,6 +373,10 @@ You can view available models with "aimg upscale --list-models". Try a different ➡️ +Upscaling uses [Spandrel](https://github.com/chaiNNer-org/spandrel) to make it easy to use different upscaling models. +You can view different integrated models by running `aimg upscale --list-models`, and then use it with `--upscale-model `. +Also accepts url's if you want to upscale an image with a different model. Control the new file format/location with --format. + ```python from imaginairy.enhancers.upscale_realesrgan import upscale_image from PIL import Image diff --git a/docs/index.md b/docs/index.md index 733cd7d..edc2fe7 100644 --- a/docs/index.md +++ b/docs/index.md @@ -315,14 +315,11 @@ allow the tool to generate one for you.

## Image Upscaling -Upscale images easily. - -You can view available models with "aimg upscale --list-models". Try a different model by using --upscale-model with the name or a url. -Control the new file format/location with --format. +Upscale images easily. === "CLI" ```bash - aimg upscale assets/000206_856637805_PLMS40_PS7.5_colorful_smoke.jpg --upscale-model realesrgan-x2-plus + aimg upscale assets/000206_856637805_PLMS40_PS7.5_colorful_smoke.jpg --upscale-model real-hat ``` === "Python" @@ -333,9 +330,12 @@ Control the new file format/location with --format. img.save("colorful_smoke.upscaled.jpg") ``` - ➡️ - + ➡️ + +Upscaling uses [Spandrel](https://github.com/chaiNNer-org/spandrel) to make it easy to use different upscaling models. +You can view different integrated models by running `aimg upscale --list-models`, and then use it with `--upscale-model `. +Also accepts url's if you want to upscale an image with a different model. Control the new file format/location with --format. ## Video Generation diff --git a/imaginairy/api/upscale.py b/imaginairy/api/upscale.py index fb9738f..9f7d5fe 100644 --- a/imaginairy/api/upscale.py +++ b/imaginairy/api/upscale.py @@ -8,7 +8,7 @@ if TYPE_CHECKING: from imaginairy.schema import LazyLoadingImage -def upscale_img( +def upscale_image( img: "Union[LazyLoadingImage, Image.Image, str]", upscale_model: str = DEFAULT_UPSCALE_MODEL, tile_size: int = 512,