Skip to content

Commit

Permalink
refactor: ruff formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
jaydrennan committed Mar 14, 2024
1 parent 48972a9 commit 725a314
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -352,9 +352,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
Expand All @@ -372,6 +370,10 @@ You can view available models with "aimg upscale --list-models". Try a different
<img src="docs/assets/000206_856637805_PLMS40_PS7.5_colorful_smoke.jpg" width="25%" height="auto"> ➡️
<img src="docs/assets/000206_856637805_PLMS40_PS7.5_colorful_smoke_upscaled.jpg" width="50%" height="auto">

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 <model-name>`.
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
Expand Down
14 changes: 7 additions & 7 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -315,14 +315,11 @@ allow the tool to generate one for you.
</p>

## 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"
Expand All @@ -333,9 +330,12 @@ Control the new file format/location with --format.
img.save("colorful_smoke.upscaled.jpg")

```
<img src="assets/000206_856637805_PLMS40_PS7.5_colorful_smoke.jpg" width="25%" height="auto"> ➡️
<img src="assets/000206_856637805_PLMS40_PS7.5_colorful_smoke_upscaled.jpg" width="50%" height="auto">
<img src="docs/assets/000206_856637805_PLMS40_PS7.5_colorful_smoke.jpg" width="25%" height="auto"> ➡️
<img src="docs/assets/000206_856637805_PLMS40_PS7.5_colorful_smoke_upscaled.jpg" width="50%" height="auto">

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 <model-name>`.
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
Expand Down
2 changes: 1 addition & 1 deletion imaginairy/api/upscale.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
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,
Expand Down

0 comments on commit 725a314

Please sign in to comment.