mirror of https://github.com/skygpu/skynet.git
Move skynet.utils to skynet.dgpu submodule
parent
cebbd1059e
commit
a652fdd781
|
@ -45,7 +45,7 @@ def skynet(*args, **kwargs):
|
||||||
@click.option('--steps', '-s', default=26)
|
@click.option('--steps', '-s', default=26)
|
||||||
@click.option('--seed', '-S', default=None)
|
@click.option('--seed', '-S', default=None)
|
||||||
def txt2img(*args, **kwargs):
|
def txt2img(*args, **kwargs):
|
||||||
from . import utils # TODO? why here, import cycle?
|
from skynet.dgpu import utils
|
||||||
|
|
||||||
config = load_skynet_toml()
|
config = load_skynet_toml()
|
||||||
set_hf_vars(config.dgpu.hf_token, config.dgpu.hf_home)
|
set_hf_vars(config.dgpu.hf_token, config.dgpu.hf_home)
|
||||||
|
@ -70,7 +70,7 @@ def txt2img(*args, **kwargs):
|
||||||
@click.option('--steps', '-s', default=26)
|
@click.option('--steps', '-s', default=26)
|
||||||
@click.option('--seed', '-S', default=None)
|
@click.option('--seed', '-S', default=None)
|
||||||
def img2img(model, prompt, input, output, strength, guidance, steps, seed):
|
def img2img(model, prompt, input, output, strength, guidance, steps, seed):
|
||||||
from . import utils
|
from skynet.dgpu import utils
|
||||||
config = load_skynet_toml()
|
config = load_skynet_toml()
|
||||||
set_hf_vars(config.dgpu.hf_token, config.dgpu.hf_home)
|
set_hf_vars(config.dgpu.hf_token, config.dgpu.hf_home)
|
||||||
utils.img2img(
|
utils.img2img(
|
||||||
|
@ -98,7 +98,7 @@ def img2img(model, prompt, input, output, strength, guidance, steps, seed):
|
||||||
@click.option('--steps', '-s', default=26)
|
@click.option('--steps', '-s', default=26)
|
||||||
@click.option('--seed', '-S', default=None)
|
@click.option('--seed', '-S', default=None)
|
||||||
def inpaint(model, prompt, input, mask, output, strength, guidance, steps, seed):
|
def inpaint(model, prompt, input, mask, output, strength, guidance, steps, seed):
|
||||||
from . import utils
|
from skynet.dgpu import utils
|
||||||
config = load_skynet_toml()
|
config = load_skynet_toml()
|
||||||
set_hf_vars(config.dgpu.hf_token, config.dgpu.hf_home)
|
set_hf_vars(config.dgpu.hf_token, config.dgpu.hf_home)
|
||||||
utils.inpaint(
|
utils.inpaint(
|
||||||
|
@ -119,7 +119,7 @@ def inpaint(model, prompt, input, mask, output, strength, guidance, steps, seed)
|
||||||
@click.option('--output', '-o', default='output.png')
|
@click.option('--output', '-o', default='output.png')
|
||||||
@click.option('--model', '-m', default='weights/RealESRGAN_x4plus.pth')
|
@click.option('--model', '-m', default='weights/RealESRGAN_x4plus.pth')
|
||||||
def upscale(input, output, model):
|
def upscale(input, output, model):
|
||||||
from . import utils
|
from skynet.dgpu import utils
|
||||||
utils.upscale(
|
utils.upscale(
|
||||||
img_path=input,
|
img_path=input,
|
||||||
output=output,
|
output=output,
|
||||||
|
@ -128,7 +128,7 @@ def upscale(input, output, model):
|
||||||
|
|
||||||
@skynet.command()
|
@skynet.command()
|
||||||
def download():
|
def download():
|
||||||
from . import utils
|
from skynet.dgpu import utils
|
||||||
config = load_skynet_toml()
|
config = load_skynet_toml()
|
||||||
set_hf_vars(config.dgpu.hf_token, config.dgpu.hf_home)
|
set_hf_vars(config.dgpu.hf_token, config.dgpu.hf_home)
|
||||||
utils.download_all_models(config.dgpu.hf_token, config.dgpu.hf_home)
|
utils.download_all_models(config.dgpu.hf_token, config.dgpu.hf_home)
|
||||||
|
|
|
@ -19,7 +19,7 @@ from skynet.dgpu.errors import (
|
||||||
DGPUInferenceCancelled,
|
DGPUInferenceCancelled,
|
||||||
)
|
)
|
||||||
|
|
||||||
from skynet.utils import crop_image, convert_from_cv2_to_image, convert_from_image_to_cv2, convert_from_img_to_bytes, init_upscaler, pipeline_for
|
from skynet.dgpu.utils import crop_image, convert_from_cv2_to_image, convert_from_image_to_cv2, convert_from_img_to_bytes, init_upscaler, pipeline_for
|
||||||
|
|
||||||
|
|
||||||
def prepare_params_for_diffuse(
|
def prepare_params_for_diffuse(
|
||||||
|
|
|
@ -23,7 +23,7 @@ from diffusers import (
|
||||||
)
|
)
|
||||||
from huggingface_hub import login
|
from huggingface_hub import login
|
||||||
|
|
||||||
from .constants import MODELS
|
from skynet.constants import MODELS
|
||||||
|
|
||||||
# Hack to fix a changed import in torchvision 0.17+, which otherwise breaks
|
# Hack to fix a changed import in torchvision 0.17+, which otherwise breaks
|
||||||
# basicsr; see https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/13985
|
# basicsr; see https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/13985
|
Loading…
Reference in New Issue