From 359e491d1f9be8f52ba2887588f7a15c69fb2ff9 Mon Sep 17 00:00:00 2001 From: Guillermo Rodriguez Date: Sun, 8 Oct 2023 12:19:46 -0300 Subject: [PATCH] Fix enqueue cli for img2img also fix worker img2img input get bug --- skynet/cli.py | 12 +++++++++++- skynet/config.py | 1 - skynet/dgpu/network.py | 1 - 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/skynet/cli.py b/skynet/cli.py index 370cda2..f1b854d 100755 --- a/skynet/cli.py +++ b/skynet/cli.py @@ -102,6 +102,7 @@ def download(): @click.option('--seed', '-S', default=None) @click.option('--upscaler', '-U', default='x4') @click.option('--binary_data', '-b', default='') +@click.option('--strength', '-Z', default=None) def enqueue( reward: str, jobs: int, @@ -124,11 +125,20 @@ def enqueue( if not kwargs['seed']: kwargs['seed'] = random.randint(0, 10e9) + binary = kwargs['binary_data'] + if not kwargs['strength']: + if binary: + raise ValueError('strength -Z param required if binary data passed') + + del kwargs['strength'] + + else: + kwargs['strength'] = float(kwargs['strength']) + req = json.dumps({ 'method': 'diffuse', 'params': kwargs }) - binary = kwargs['binary_data'] res = await cleos.a_push_action( 'telos.gpu', diff --git a/skynet/config.py b/skynet/config.py index 73ee8c3..21cc113 100755 --- a/skynet/config.py +++ b/skynet/config.py @@ -31,4 +31,3 @@ def load_key(config: dict, key: str) -> str: def set_hf_vars(hf_token: str, hf_home: str): os.environ['HF_TOKEN'] = hf_token os.environ['HF_HOME'] = hf_home - os.environ['HUGGINGFACE_HUB_CACHE'] = hf_home diff --git a/skynet/dgpu/network.py b/skynet/dgpu/network.py index a029f82..10a9cb8 100644 --- a/skynet/dgpu/network.py +++ b/skynet/dgpu/network.py @@ -288,7 +288,6 @@ class SkynetGPUConnector: if ipfs_link_legacy in results: png_img = results[ipfs_link_legacy] - png_img = None if ipfs_link in results: png_img = results[ipfs_link]