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

aimg upscale with --model #351

Open
xzitlou opened this issue Jun 24, 2023 · 17 comments
Open

aimg upscale with --model #351

xzitlou opened this issue Jun 24, 2023 · 17 comments
Labels
feature request New feature or request

Comments

@xzitlou
Copy link

xzitlou commented Jun 24, 2023

Hi, is there a way to use the upscale feature with another model? I tried:

aimg upscale "test.jpeg" --fix-faces --outdir "/results/" --model openjourney-v4
...
Error: No such option: --model Did you mean --help?
@brycedrennan brycedrennan added the feature request New feature or request label Jul 27, 2023
@brycedrennan
Copy link
Owner

upscale doesn't use stable diffusion, it uses realesrgan. I would like to support other super-resolution algorithms in the future though.

@brycedrennan
Copy link
Owner

Using a stable diffusion model to upscale can be done via tile/details controlnet. I'll leave this open so we can make it easy to do that using the upscale command.

@xzitlou
Copy link
Author

xzitlou commented Dec 19, 2023

Thanks @brycedrennan for your help, sorry for being so bothersome, but do you have an example of how to use it with the mentioned configuration? Thanks.

@brycedrennan
Copy link
Owner

brycedrennan commented Dec 19, 2023

If you're just wanting to make big generations then the current master branch (unreleased) will work very well now.
imagine blueberries --size 1080p --upscale will produce a well-composed 8k image. The stable diffusion upscaling happens automatically to get the image to 1080p and then the upscale flag takes it to 8k.

To upscale an existing image... let me see. I'll try a few things and get back to you in a minute.

Love to see all the sites you've made with the tool. Would love to learn more about your setup. Reach out on discord sometime.
025580_1_ddim50_PS7 5_blueberries_ upscaled

@brycedrennan
Copy link
Owner

imagine --init-image tests/data/dog.jpg --control-mode details --init-image-strength 0.5 --size 2048 "a dog" --no-compose-phase --upscale
Dog@512
dog

Dog@8192
025649_231460608_ddim50_PS7 5_img2img-0 5_a_dog_ upscaled

@xzitlou
Copy link
Author

xzitlou commented Dec 27, 2023

@brycedrennan quick question, what is the model you use in this command?

# generate kitchen remodel ideas
🤖🧠> imagine --control-image kitchen.jpg -w 1024 -h 1024 "{_interior-style_} kitchen" --control-mode depth -r 100 --init-image 0.01 --upscale --steps 35 --caption-text "{prompt}"

@brycedrennan
Copy link
Owner

since no model is specified the default models are used:

  • stable diffusion 1.5
  • controlnet depth
  • realesrgan upscaling

@xzitlou
Copy link
Author

xzitlou commented Dec 27, 2023

Thanks for your response, can specify a model like openjourney or the other availables?

@brycedrennan
Copy link
Owner

yep specify whatever model you want for the base model. --model

You should get much better looking results for large images from the currently unreleased version but the api has changed somewhat.

@xzitlou
Copy link
Author

xzitlou commented Dec 27, 2023

Awesome! Thanks @brycedrennan

@bluusun
Copy link

bluusun commented Jan 4, 2024

aimg upscale /root/work/*.jpg

has been working tremendously in former versions.

14.0.1 produces this:

Traceback (most recent call last):
File "/usr/local/bin/aimg", line 6, in
imaginairy.cli.main.aimg()
File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1157, in call
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.10/site-packages/click_shell/core.py", line 164, in invoke
ret = super(Shell, self).invoke(ctx)
File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.10/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
File "/usr/local/lib/python3.10/site-packages/imaginairy/cli/upscale.py", line 34, in upscale_cmd
from imaginairy.enhancers.face_restoration_codeformer import enhance_faces
File "/usr/local/lib/python3.10/site-packages/imaginairy/enhancers/face_restoration_codeformer.py", line 12, in
from imaginairy.utils.model_manager import get_cached_url_path
File "/usr/local/lib/python3.10/site-packages/imaginairy/utils/model_manager.py", line 24, in
from imaginairy.modules.refiners_sd import SDXLAutoencoderSliced, StableDiffusion_XL
File "/usr/local/lib/python3.10/site-packages/imaginairy/modules/refiners_sd.py", line 12, in
import imaginairy.vendored.refiners.fluxion.layers as fl
ModuleNotFoundError: No module named 'imaginairy.vendored.refiners'

@brycedrennan
Copy link
Owner

that's no good! Sounds like something is pretty wrong. I'll fix tonight.

@brycedrennan
Copy link
Owner

Yeah a bunch of files were missing from the package. I've added them back and more importantly added a test so this doesn't happen again. 14.0.3 is working. @bluusun

@bluusun
Copy link

bluusun commented Jan 4, 2024

Awesome thanks! Will check. Will wait to make newest version productive for a bit.

@bluusun
Copy link

bluusun commented Feb 6, 2024

aimg version
14.1.1

aimg uspcale
Usage: aimg [OPTIONS] COMMAND [ARGS]...
Try 'aimg --help' for help.

Error: No such command 'uspcale'.

aimg uspcale /root/work

Usage: aimg [OPTIONS] COMMAND [ARGS]...

🤖🧠 ImaginAIry.

Pythonic generation of images via AI

Options:
--help Show this message and exit.

Commands:
colorize Colorize images using AI.
describe Generate text descriptions of images.
edit Edit an image via AI.
edit-demo Make some fun pre-set edits to input photos.
imagine Generate images via AI.
model-list Print list of available models.
server Run a HTTP API server.
system-info Display system information.
upscale Upscale an image 4x using AI.
version Print the version.
videogen AI generate a video from an image

What am I missing?

@brycedrennan
Copy link
Owner

uspcale

upscale

@bluusun
Copy link

bluusun commented Feb 22, 2024

OMG :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants