fix(api): correct output paths, read strength from params
This commit is contained in:
parent
f9c33486c1
commit
a76793d105
|
@ -100,7 +100,7 @@ def run_txt2img_pipeline(params: BaseParams, size: Size, output: OutputPath):
|
||||||
num_inference_steps=params.steps,
|
num_inference_steps=params.steps,
|
||||||
).images[0]
|
).images[0]
|
||||||
image = upscale_resrgan(image, model_path)
|
image = upscale_resrgan(image, model_path)
|
||||||
image.save(output.file)
|
image.save(output.path)
|
||||||
|
|
||||||
print('saved txt2img output: %s' % (output.file))
|
print('saved txt2img output: %s' % (output.file))
|
||||||
|
|
||||||
|
@ -121,9 +121,9 @@ def run_img2img_pipeline(params: BaseParams, output: OutputPath, strength: float
|
||||||
strength=strength,
|
strength=strength,
|
||||||
).images[0]
|
).images[0]
|
||||||
image = upscale_resrgan(image, model_path)
|
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(
|
def run_inpaint_pipeline(
|
||||||
|
@ -168,6 +168,6 @@ def run_inpaint_pipeline(
|
||||||
width=size.width,
|
width=size.width,
|
||||||
).images[0]
|
).images[0]
|
||||||
|
|
||||||
image.save(output.file)
|
image.save(output.path)
|
||||||
|
|
||||||
print('saved inpaint output: %s' % (output.file))
|
print('saved inpaint output: %s' % (output.file))
|
||||||
|
|
|
@ -259,7 +259,11 @@ def img2img():
|
||||||
input_file = request.files.get('source')
|
input_file = request.files.get('source')
|
||||||
input_image = Image.open(BytesIO(input_file.read())).convert('RGB')
|
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()
|
params, size = pipeline_from_request()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue