mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
add cross-attention support to im2img; prevent inpainting from crashing
This commit is contained in:
@ -32,7 +32,7 @@ class Img2Img(Generator):
|
||||
) # move to latent space
|
||||
|
||||
t_enc = int(strength * steps)
|
||||
uc, c = conditioning
|
||||
uc, c, ec, edit_opcodes = conditioning
|
||||
|
||||
def make_image(x_T):
|
||||
# encode (scaled latent)
|
||||
@ -49,7 +49,10 @@ class Img2Img(Generator):
|
||||
img_callback = step_callback,
|
||||
unconditional_guidance_scale=cfg_scale,
|
||||
unconditional_conditioning=uc,
|
||||
init_latent = self.init_latent, # changes how noising is performed in ksampler
|
||||
init_latent = self.init_latent,
|
||||
edited_conditioning = ec,
|
||||
conditioning_edit_opcodes = edit_opcodes
|
||||
# changes how noising is performed in ksampler
|
||||
)
|
||||
|
||||
return self.sample_to_image(samples)
|
||||
|
@ -45,7 +45,8 @@ class Inpaint(Img2Img):
|
||||
) # move to latent space
|
||||
|
||||
t_enc = int(strength * steps)
|
||||
uc, c = conditioning
|
||||
# todo: support cross-attention control
|
||||
uc, c, _, _ = conditioning
|
||||
|
||||
print(f">> target t_enc is {t_enc} steps")
|
||||
|
||||
|
Reference in New Issue
Block a user