Fix enqueue cli for img2img also fix worker img2img input get bug

pull/26/head
Guillermo Rodriguez 2023-10-08 12:19:46 -03:00
parent 50ae61c7b2
commit 359e491d1f
No known key found for this signature in database
GPG Key ID: EC3AB66D5D83B392
3 changed files with 11 additions and 3 deletions

View File

@ -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',

View File

@ -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

View File

@ -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]