fix: sets correct default value for composition strength. (#422)

also corrects positional argument error by requiring _imagine_cmd to take key word arguments.
pull/423/head
jaydrennan 6 months ago committed by GitHub
parent 0c03612d44
commit 0c01cd690f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -228,8 +228,6 @@ def _generate_single_image(
result_images["composition"] = comp_img_orig
result_images["composition-upscaled"] = comp_image
composition_strength = prompt.composition_strength
# work around until bug is fixed in cli
composition_strength = 0.5
first_step = int((prompt.steps) * composition_strength)
noise_step = int((prompt.steps - 1) * composition_strength)
log_img(comp_img_orig, "comp_image")

@ -102,45 +102,45 @@ def edit_cmd(
control_inputs = [ControlInput(image=None, image_raw=None, mode="edit", strength=1)]
return _imagine_cmd(
ctx,
prompt,
negative_prompt,
prompt_strength,
image_paths,
image_strength,
outdir,
output_file_extension,
repeats,
size,
steps,
seed,
upscale,
fix_faces,
fix_faces_fidelity,
solver,
log_level,
quiet,
show_work,
tile,
tile_x,
tile_y,
allow_compose_phase,
mask_image,
mask_prompt,
mask_mode,
mask_modify_original,
outpaint,
caption,
precision,
model_weights_path,
model_architecture,
prompt_library_path,
version,
make_gif,
make_compare_gif,
arg_schedules,
make_compilation_animation,
caption_text,
composition_strength,
ctx=ctx,
prompt_texts=prompt,
negative_prompt=negative_prompt,
prompt_strength=prompt_strength,
init_image=image_paths,
init_image_strength=image_strength,
outdir=outdir,
output_file_extension=output_file_extension,
repeats=repeats,
size=size,
steps= steps,
seed=seed,
upscale=upscale,
fix_faces=fix_faces,
fix_faces_fidelity=fix_faces_fidelity,
solver=solver,
log_level=log_level,
quiet=quiet,
show_work=show_work,
tile=tile,
tile_x=tile_x,
tile_y=tile_y,
allow_compose_phase=allow_compose_phase,
mask_image=mask_image,
mask_prompt=mask_prompt,
mask_mode=mask_mode,
mask_modify_original=mask_modify_original,
outpaint=outpaint,
caption=caption,
precision=precision,
model_weights_path=model_weights_path,
model_architecture=model_architecture,
prompt_library_path=prompt_library_path,
version=version,
make_gif=make_gif,
make_compare_gif=make_compare_gif,
arg_schedules=arg_schedules,
make_compilation_animation=make_compilation_animation,
caption_text=caption_text,
composition_strength=composition_strength,
control_inputs=control_inputs,
)

@ -106,6 +106,7 @@ def imagine_cmd(
mask_modify_original,
outpaint,
caption,
composition_strength,
precision,
model_weights_path,
model_architecture,
@ -116,7 +117,6 @@ def imagine_cmd(
arg_schedules,
make_compilation_animation,
caption_text,
composition_strength,
control_image,
control_image_raw,
control_strength,
@ -185,46 +185,46 @@ def imagine_cmd(
)
return _imagine_cmd(
ctx,
prompt_texts,
negative_prompt,
prompt_strength,
init_image,
init_image_strength,
outdir,
output_file_extension,
repeats,
size,
steps,
seed,
upscale,
fix_faces,
fix_faces_fidelity,
solver,
log_level,
quiet,
show_work,
tile,
tile_x,
tile_y,
allow_compose_phase,
mask_image,
mask_prompt,
mask_mode,
mask_modify_original,
outpaint,
caption,
precision,
model_weights_path,
model_architecture,
prompt_library_path,
version,
make_gif,
make_compare_gif,
arg_schedules,
make_compilation_animation,
caption_text,
composition_strength,
ctx=ctx,
prompt_texts=prompt_texts,
negative_prompt=negative_prompt,
prompt_strength=prompt_strength,
init_image= init_image,
init_image_strength=init_image_strength,
outdir=outdir,
output_file_extension=output_file_extension,
repeats=repeats,
size=size,
steps=steps,
seed=seed,
upscale=upscale,
fix_faces=fix_faces,
fix_faces_fidelity=fix_faces_fidelity,
solver=solver,
log_level=log_level,
quiet=quiet,
show_work=show_work,
tile=tile,
tile_x=tile_x,
tile_y=tile_y,
allow_compose_phase=allow_compose_phase,
mask_image=mask_image,
mask_prompt=mask_prompt,
mask_mode=mask_mode,
mask_modify_original=mask_modify_original,
outpaint=outpaint,
caption=caption,
composition_strength=composition_strength,
precision=precision,
model_weights_path=model_weights_path,
model_architecture=model_architecture,
prompt_library_path=prompt_library_path,
version=version,
make_gif=make_gif,
make_compare_gif=make_compare_gif,
arg_schedules=arg_schedules,
make_compilation_animation=make_compilation_animation,
caption_text=caption_text,
control_inputs=control_inputs,
videogen=videogen,
)

@ -26,6 +26,7 @@ def imaginairy_click_context(log_level="INFO"):
def _imagine_cmd(
*,
ctx,
prompt_texts,
negative_prompt,
@ -55,11 +56,11 @@ def _imagine_cmd(
mask_modify_original,
outpaint,
caption,
composition_strength,
precision,
model_weights_path,
model_architecture,
prompt_library_path,
composition_strength,
version=False,
make_gif=False,
make_compare_gif=False,
@ -518,7 +519,7 @@ common_options = [
),
click.option(
"--composition-strength",
default=None,
default=0.5,
show_default=False,
type=float,
help=("Strength of the composition phase."),

Loading…
Cancel
Save