mirror of
https://github.com/vladmandic/automatic
synced 2026-09-20 01:31:13 +02:00
full codespell coverage
Signed-off-by: Vladimir Mandic <mandic00@live.com>
This commit is contained in:
@@ -459,7 +459,7 @@ class split_AttnProcessor2_0(torch.nn.Module):
|
||||
hidden_states_0 = hidden_states_0.view(batch_size, channel, height * width).transpose(1, 2)
|
||||
hidden_states_1 = hidden_states_1.view(batch_size, channel, height * width).transpose(1, 2)
|
||||
else:
|
||||
# directly split sqeuence according to concat dim.
|
||||
# directly split sequence according to concat dim.
|
||||
single_dim = original_shape[2] if cat_dim==-2 or cat_dim==2 else original_shape[1]
|
||||
hidden_states_0 = hidden_states[:, :single_dim*single_dim,:]
|
||||
hidden_states_1 = hidden_states[:, single_dim*(single_dim+1):,:]
|
||||
@@ -593,7 +593,7 @@ class sep_split_AttnProcessor2_0(torch.nn.Module):
|
||||
hidden_states_0 = hidden_states_0.view(batch_size, channel, height * width).transpose(1, 2)
|
||||
hidden_states_1 = hidden_states_1.view(batch_size, channel, height * width).transpose(1, 2)
|
||||
else:
|
||||
# directly split sqeuence according to concat dim.
|
||||
# directly split sequence according to concat dim.
|
||||
single_dim = original_shape[2] if cat_dim==-2 or cat_dim==2 else original_shape[1]
|
||||
hidden_states_0 = hidden_states[:, :single_dim*single_dim,:]
|
||||
hidden_states_1 = hidden_states[:, single_dim*(single_dim+1):,:]
|
||||
|
||||
@@ -65,7 +65,7 @@ def init_adapter_in_unet(
|
||||
image_projection_layers.append(image_proj_model)
|
||||
unet.encoder_hid_proj = MultiIPAdapterImageProjection(image_projection_layers)
|
||||
|
||||
# Adjust unet config to handle addtional ip hidden states.
|
||||
# Adjust unet config to handle additional ip hidden states.
|
||||
unet.config.encoder_hid_dim_type = "ip_image_proj"
|
||||
unet.to(dtype=dtype, device=device)
|
||||
|
||||
@@ -155,7 +155,7 @@ def load_adapter_to_pipe(
|
||||
image_projection_layers.append(image_proj_model)
|
||||
unet.encoder_hid_proj = MultiIPAdapterImageProjection(image_projection_layers)
|
||||
|
||||
# Adjust unet config to handle addtional ip hidden states.
|
||||
# Adjust unet config to handle additional ip hidden states.
|
||||
unet.config.encoder_hid_dim_type = "ip_image_proj"
|
||||
unet.to(dtype=pipe.dtype, device=pipe.device)
|
||||
|
||||
|
||||
@@ -932,7 +932,7 @@ class InstantIRPipeline(
|
||||
noise = torch.randn(latents.shape, generator=generator[0] if isinstance(generator, list) else generator, device=self.vae.device, dtype=self.vae.dtype, layout=torch.strided)
|
||||
bsz = latents.shape[0]
|
||||
timestep = torch.tensor([timestep]*bsz, device=self.vae.device)
|
||||
# Note that the latents will be scaled aleady by scheduler.add_noise
|
||||
# Note that the latents will be scaled already by scheduler.add_noise
|
||||
latents = self.scheduler.add_noise(latents, noise, timestep)
|
||||
return latents
|
||||
|
||||
|
||||
Reference in New Issue
Block a user