MCPcopy Create free account
hub / github.com/OpenImagingLab/FlashVSR / tiled_forward

Method tiled_forward

diffsynth/models/flux_dit.py:324–340  ·  view source on GitHub ↗
(
        self,
        hidden_states,
        timestep, prompt_emb, pooled_prompt_emb, guidance, text_ids,
        tile_size=128, tile_stride=64,
        **kwargs
    )

Source from the content-addressed store, hash-verified

322
323
324 def tiled_forward(
325 self,
326 hidden_states,
327 timestep, prompt_emb, pooled_prompt_emb, guidance, text_ids,
328 tile_size=128, tile_stride=64,
329 **kwargs
330 ):
331 # Due to the global positional embedding, we cannot implement layer-wise tiled forward.
332 hidden_states = TileWorker().tiled_forward(
333 lambda x: self.forward(x, timestep, prompt_emb, pooled_prompt_emb, guidance, text_ids, image_ids=None),
334 hidden_states,
335 tile_size,
336 tile_stride,
337 tile_device=hidden_states.device,
338 tile_dtype=hidden_states.dtype
339 )
340 return hidden_states
341
342
343 def construct_mask(self, entity_masks, prompt_seq_len, image_seq_len):

Callers 1

forwardMethod · 0.95

Calls 2

forwardMethod · 0.95
TileWorkerClass · 0.85

Tested by

no test coverage detected