1
0
Fork 0

fix(api): correct output paths, read strength from params

This commit is contained in:
Sean Sube 2023-01-15 20:00:26 -06:00
parent f9c33486c1
commit a76793d105
2 changed files with 9 additions and 5 deletions

View File

@ -100,7 +100,7 @@ def run_txt2img_pipeline(params: BaseParams, size: Size, output: OutputPath):
num_inference_steps=params.steps,
).images[0]
image = upscale_resrgan(image, model_path)
image.save(output.file)
image.save(output.path)
print('saved txt2img output: %s' % (output.file))
@ -121,9 +121,9 @@ def run_img2img_pipeline(params: BaseParams, output: OutputPath, strength: float
strength=strength,
).images[0]
image = upscale_resrgan(image, model_path)
image.save(params.output.file)
image.save(output.path)
print('saved img2img output: %s' % (params.output.file))
print('saved img2img output: %s' % (output.file))
def run_inpaint_pipeline(
@ -168,6 +168,6 @@ def run_inpaint_pipeline(
width=size.width,
).images[0]
image.save(output.file)
image.save(output.path)
print('saved inpaint output: %s' % (output.file))

View File

@ -259,7 +259,11 @@ def img2img():
input_file = request.files.get('source')
input_image = Image.open(BytesIO(input_file.read())).convert('RGB')
strength = get_and_clamp_float(request.args, 'strength', 0.5, 1.0)
strength = get_and_clamp_float(
request.args,
'strength',
config_params.get('strength').get('default'),
config_params.get('strength').get('max'))
params, size = pipeline_from_request()