mirror of
https://github.com/modelscope/DiffSynth-Studio.git
synced 2026-03-24 01:48:13 +00:00
add fun-v1.1-1.3B-control-camera
This commit is contained in:
@@ -316,8 +316,12 @@ class WanModel(torch.nn.Module):
|
|||||||
else:
|
else:
|
||||||
self.control_adapter = None
|
self.control_adapter = None
|
||||||
|
|
||||||
def patchify(self, x: torch.Tensor):
|
def patchify(self, x: torch.Tensor,control_camera_latents_input: torch.Tensor = None):
|
||||||
x = self.patch_embedding(x)
|
x = self.patch_embedding(x)
|
||||||
|
if self.control_adapter is not None and control_camera_latents_input is not None:
|
||||||
|
y_camera = self.control_adapter(control_camera_latents_input)
|
||||||
|
x = [u + v for u, v in zip(x, y_camera)]
|
||||||
|
x = x[0].unsqueeze(0)
|
||||||
grid_size = x.shape[2:]
|
grid_size = x.shape[2:]
|
||||||
x = rearrange(x, 'b c f h w -> b (f h w) c').contiguous()
|
x = rearrange(x, 'b c f h w -> b (f h w) c').contiguous()
|
||||||
return x, grid_size # x, grid_size: (f, h, w)
|
return x, grid_size # x, grid_size: (f, h, w)
|
||||||
|
|||||||
Reference in New Issue
Block a user