SYMBOL INDEX (2289 symbols across 137 files) FILE: diffsynth/controlnets/controlnet_unit.py class ControlNetConfigUnit (line 6) | class ControlNetConfigUnit: method __init__ (line 7) | def __init__(self, processor_id: Processor_id, model_path, scale=1.0, ... class ControlNetUnit (line 14) | class ControlNetUnit: method __init__ (line 15) | def __init__(self, processor, model, scale=1.0): class MultiControlNetManager (line 21) | class MultiControlNetManager: method __init__ (line 22) | def __init__(self, controlnet_units=[]): method cpu (line 27) | def cpu(self): method to (line 31) | def to(self, device): method process_image (line 37) | def process_image(self, image, processor_id=None): method __call__ (line 48) | def __call__( class FluxMultiControlNetManager (line 68) | class FluxMultiControlNetManager(MultiControlNetManager): method __init__ (line 69) | def __init__(self, controlnet_units=[]): method process_image (line 72) | def process_image(self, image, processor_id=None): method __call__ (line 79) | def __call__(self, conditionings, **kwargs): FILE: diffsynth/controlnets/processors.py class Annotator (line 8) | class Annotator: method __init__ (line 9) | def __init__(self, processor_id: Processor_id, model_path="models/Anno... method to (line 42) | def to(self,device): method __call__ (line 47) | def __call__(self, image, mask=None): FILE: diffsynth/data/simple_text_image.py class TextImageDataset (line 8) | class TextImageDataset(torch.utils.data.Dataset): method __init__ (line 9) | def __init__(self, dataset_path, steps_per_epoch=10000, height=1024, w... method __getitem__ (line 26) | def __getitem__(self, index): method __len__ (line 40) | def __len__(self): FILE: diffsynth/data/video.py class LowMemoryVideo (line 7) | class LowMemoryVideo: method __init__ (line 8) | def __init__(self, file_name): method __len__ (line 11) | def __len__(self): method __getitem__ (line 14) | def __getitem__(self, item): method __del__ (line 17) | def __del__(self): function split_file_name (line 21) | def split_file_name(file_name): function search_for_images (line 40) | def search_for_images(folder): class LowMemoryImageFolder (line 48) | class LowMemoryImageFolder: method __init__ (line 49) | def __init__(self, folder, file_list=None): method __len__ (line 55) | def __len__(self): method __getitem__ (line 58) | def __getitem__(self, item): method __del__ (line 61) | def __del__(self): function crop_and_resize (line 65) | def crop_and_resize(image, height, width): class VideoData (line 81) | class VideoData: method __init__ (line 82) | def __init__(self, video_file=None, image_folder=None, height=None, wi... method raw_data (line 94) | def raw_data(self): method set_length (line 100) | def set_length(self, length): method set_shape (line 103) | def set_shape(self, height, width): method __len__ (line 107) | def __len__(self): method shape (line 113) | def shape(self): method __getitem__ (line 120) | def __getitem__(self, item): method __del__ (line 128) | def __del__(self): method save_images (line 131) | def save_images(self, folder): function save_video (line 138) | def save_video(frames, save_path, fps, quality=9, ffmpeg_params=None): function save_frames (line 145) | def save_frames(frames, save_path): FILE: diffsynth/extensions/ESRGAN/__init__.py class ResidualDenseBlock (line 7) | class ResidualDenseBlock(torch.nn.Module): method __init__ (line 9) | def __init__(self, num_feat=64, num_grow_ch=32): method forward (line 18) | def forward(self, x): class RRDB (line 27) | class RRDB(torch.nn.Module): method __init__ (line 29) | def __init__(self, num_feat, num_grow_ch=32): method forward (line 35) | def forward(self, x): class RRDBNet (line 42) | class RRDBNet(torch.nn.Module): method __init__ (line 44) | def __init__(self, num_in_ch=3, num_out_ch=3, num_feat=64, num_block=2... method forward (line 56) | def forward(self, x): method state_dict_converter (line 70) | def state_dict_converter(): class RRDBNetStateDictConverter (line 74) | class RRDBNetStateDictConverter: method __init__ (line 75) | def __init__(self): method from_diffusers (line 78) | def from_diffusers(self, state_dict): method from_civitai (line 81) | def from_civitai(self, state_dict): class ESRGAN (line 85) | class ESRGAN(torch.nn.Module): method __init__ (line 86) | def __init__(self, model): method from_model_manager (line 91) | def from_model_manager(model_manager): method process_image (line 94) | def process_image(self, image): method process_images (line 98) | def process_images(self, images): method decode_images (line 103) | def decode_images(self, images): method upscale (line 109) | def upscale(self, images, batch_size=4, progress_bar=lambda x:x): FILE: diffsynth/extensions/FastBlend/__init__.py class FastBlendSmoother (line 7) | class FastBlendSmoother: method __init__ (line 8) | def __init__(self): method from_model_manager (line 22) | def from_model_manager(model_manager): method run (line 26) | def run(self, frames_guide, frames_style, batch_size, window_size, ebs... method __call__ (line 54) | def __call__(self, rendered_frames, original_frames=None, **kwargs): FILE: diffsynth/extensions/FastBlend/api.py function check_input_for_blending (line 7) | def check_input_for_blending(video_guide, video_guide_folder, video_styl... function smooth_video (line 25) | def smooth_video( class KeyFrameMatcher (line 92) | class KeyFrameMatcher: method __init__ (line 93) | def __init__(self): method extract_number_from_filename (line 96) | def extract_number_from_filename(self, file_name): method extract_number_from_filenames (line 113) | def extract_number_from_filenames(self, file_names): method match_using_filename (line 121) | def match_using_filename(self, file_names_a, file_names_b): method match_using_numbers (line 131) | def match_using_numbers(self, file_names_a, file_names_b): method match_filenames (line 143) | def match_filenames(self, file_names_a, file_names_b): function detect_frames (line 151) | def detect_frames(frames_path, keyframes_path): function check_input_for_interpolating (line 182) | def check_input_for_interpolating(frames_path, keyframes_path): function interpolate_video (line 202) | def interpolate_video( function on_ui_tabs (line 257) | def on_ui_tabs(): FILE: diffsynth/extensions/FastBlend/data.py function read_video (line 6) | def read_video(file_name): function get_video_fps (line 16) | def get_video_fps(file_name): function save_video (line 23) | def save_video(frames_path, video_path, num_frames, fps): class LowMemoryVideo (line 32) | class LowMemoryVideo: method __init__ (line 33) | def __init__(self, file_name): method __len__ (line 36) | def __len__(self): method __getitem__ (line 39) | def __getitem__(self, item): method __del__ (line 42) | def __del__(self): function split_file_name (line 46) | def split_file_name(file_name): function search_for_images (line 65) | def search_for_images(folder): function read_images (line 73) | def read_images(folder): class LowMemoryImageFolder (line 79) | class LowMemoryImageFolder: method __init__ (line 80) | def __init__(self, folder, file_list=None): method __len__ (line 86) | def __len__(self): method __getitem__ (line 89) | def __getitem__(self, item): method __del__ (line 92) | def __del__(self): class VideoData (line 96) | class VideoData: method __init__ (line 97) | def __init__(self, video_file, image_folder, **kwargs): method raw_data (line 110) | def raw_data(self): method set_length (line 116) | def set_length(self, length): method set_shape (line 119) | def set_shape(self, height, width): method __len__ (line 123) | def __len__(self): method shape (line 129) | def shape(self): method __getitem__ (line 136) | def __getitem__(self, item): method __del__ (line 145) | def __del__(self): FILE: diffsynth/extensions/FastBlend/patch_match.py class PatchMatcher (line 7) | class PatchMatcher: method __init__ (line 8) | def __init__( method pad_image (line 37) | def pad_image(self, image): method unpad_image (line 40) | def unpad_image(self, image): method apply_nnf_to_image (line 43) | def apply_nnf_to_image(self, nnf, source): method get_patch_error (line 53) | def get_patch_error(self, source, nnf, target): method get_pairwise_patch_error (line 63) | def get_pairwise_patch_error(self, source, nnf): method get_error (line 76) | def get_error(self, source_guide, target_guide, source_style, target_s... method clamp_bound (line 89) | def clamp_bound(self, nnf): method random_step (line 94) | def random_step(self, nnf, r): method neighboor_step (line 100) | def neighboor_step(self, nnf, d): method shift_nnf (line 116) | def shift_nnf(self, nnf, d): method track_step (line 125) | def track_step(self, nnf, d): method C (line 134) | def C(self, n, m): method bezier_step (line 145) | def bezier_step(self, nnf, r): method update (line 158) | def update(self, source_guide, target_guide, source_style, target_styl... method propagation (line 165) | def propagation(self, source_guide, target_guide, source_style, target... method random_search (line 171) | def random_search(self, source_guide, target_guide, source_style, targ... method track (line 177) | def track(self, source_guide, target_guide, source_style, target_style... method iteration (line 185) | def iteration(self, source_guide, target_guide, source_style, target_s... method estimate_nnf (line 191) | def estimate_nnf(self, source_guide, target_guide, source_style, nnf): class PyramidPatchMatcher (line 205) | class PyramidPatchMatcher: method __init__ (line 206) | def __init__( method resample_image (line 234) | def resample_image(self, images, level): method initialize_nnf (line 244) | def initialize_nnf(self, batch_size): method update_nnf (line 262) | def update_nnf(self, nnf, level): method apply_nnf_to_image (line 276) | def apply_nnf_to_image(self, nnf, image): method estimate_nnf (line 282) | def estimate_nnf(self, source_guide, target_guide, source_style): FILE: diffsynth/extensions/FastBlend/runners/accurate.py class AccurateModeRunner (line 8) | class AccurateModeRunner: method __init__ (line 9) | def __init__(self): method run (line 12) | def run(self, frames_guide, frames_style, batch_size, window_size, ebs... FILE: diffsynth/extensions/FastBlend/runners/balanced.py class BalancedModeRunner (line 8) | class BalancedModeRunner: method __init__ (line 9) | def __init__(self): method run (line 12) | def run(self, frames_guide, frames_style, batch_size, window_size, ebs... FILE: diffsynth/extensions/FastBlend/runners/fast.py class TableManager (line 8) | class TableManager: method __init__ (line 9) | def __init__(self): method task_list (line 12) | def task_list(self, n): method build_remapping_table (line 34) | def build_remapping_table(self, frames_guide, frames_style, patch_matc... method remapping_table_to_blending_table (line 56) | def remapping_table_to_blending_table(self, table): method tree_query (line 66) | def tree_query(self, leftbound, rightbound): method process_window_sum (line 77) | def process_window_sum(self, frames_guide, blending_table, patch_match... class FastModeRunner (line 109) | class FastModeRunner: method __init__ (line 110) | def __init__(self): method run (line 113) | def run(self, frames_guide, frames_style, batch_size, window_size, ebs... FILE: diffsynth/extensions/FastBlend/runners/interpolation.py class InterpolationModeRunner (line 8) | class InterpolationModeRunner: method __init__ (line 9) | def __init__(self): method get_index_dict (line 12) | def get_index_dict(self, index_style): method get_weight (line 18) | def get_weight(self, l, m, r): method get_task_group (line 26) | def get_task_group(self, index_style, n): method run (line 48) | def run(self, frames_guide, frames_style, index_style, batch_size, ebs... class InterpolationModeSingleFrameRunner (line 87) | class InterpolationModeSingleFrameRunner: method __init__ (line 88) | def __init__(self): method run (line 91) | def run(self, frames_guide, frames_style, index_style, batch_size, ebs... FILE: diffsynth/extensions/ImageQualityMetric/BLIP/blip.py function default_bert (line 16) | def default_bert(): function init_tokenizer (line 23) | def init_tokenizer(bert_model_path): function create_vit (line 31) | def create_vit(vit, image_size, use_grad_checkpointing=False, ckpt_layer... function is_url (line 49) | def is_url(url_or_filename): function load_checkpoint (line 53) | def load_checkpoint(model,url_or_filename): FILE: diffsynth/extensions/ImageQualityMetric/BLIP/blip_pretrain.py class BLIP_Pretrain (line 13) | class BLIP_Pretrain(nn.Module): method __init__ (line 14) | def __init__(self, FILE: diffsynth/extensions/ImageQualityMetric/BLIP/med.py class BertEmbeddings (line 44) | class BertEmbeddings(nn.Module): method __init__ (line 47) | def __init__(self, config): method forward (line 63) | def forward( class BertSelfAttention (line 89) | class BertSelfAttention(nn.Module): method __init__ (line 90) | def __init__(self, config, is_cross_attention): method save_attn_gradients (line 118) | def save_attn_gradients(self, attn_gradients): method get_attn_gradients (line 121) | def get_attn_gradients(self): method save_attention_map (line 124) | def save_attention_map(self, attention_map): method get_attention_map (line 127) | def get_attention_map(self): method transpose_for_scores (line 130) | def transpose_for_scores(self, x): method forward (line 135) | def forward( class BertSelfOutput (line 220) | class BertSelfOutput(nn.Module): method __init__ (line 221) | def __init__(self, config): method forward (line 227) | def forward(self, hidden_states, input_tensor): class BertAttention (line 234) | class BertAttention(nn.Module): method __init__ (line 235) | def __init__(self, config, is_cross_attention=False): method prune_heads (line 241) | def prune_heads(self, heads): method forward (line 259) | def forward( class BertIntermediate (line 283) | class BertIntermediate(nn.Module): method __init__ (line 284) | def __init__(self, config): method forward (line 292) | def forward(self, hidden_states): class BertOutput (line 298) | class BertOutput(nn.Module): method __init__ (line 299) | def __init__(self, config): method forward (line 305) | def forward(self, hidden_states, input_tensor): class BertLayer (line 312) | class BertLayer(nn.Module): method __init__ (line 313) | def __init__(self, config, layer_num): method forward (line 325) | def forward( method feed_forward_chunk (line 372) | def feed_forward_chunk(self, attention_output): class BertEncoder (line 378) | class BertEncoder(nn.Module): method __init__ (line 379) | def __init__(self, config): method forward (line 385) | def forward( class BertPooler (line 478) | class BertPooler(nn.Module): method __init__ (line 479) | def __init__(self, config): method forward (line 484) | def forward(self, hidden_states): class BertPredictionHeadTransform (line 493) | class BertPredictionHeadTransform(nn.Module): method __init__ (line 494) | def __init__(self, config): method forward (line 503) | def forward(self, hidden_states): class BertLMPredictionHead (line 510) | class BertLMPredictionHead(nn.Module): method __init__ (line 511) | def __init__(self, config): method forward (line 524) | def forward(self, hidden_states): class BertOnlyMLMHead (line 530) | class BertOnlyMLMHead(nn.Module): method __init__ (line 531) | def __init__(self, config): method forward (line 535) | def forward(self, sequence_output): class BertPreTrainedModel (line 540) | class BertPreTrainedModel(PreTrainedModel): method _init_weights (line 550) | def _init_weights(self, module): class BertModel (line 563) | class BertModel(BertPreTrainedModel): method __init__ (line 573) | def __init__(self, config, add_pooling_layer=True): method get_input_embeddings (line 586) | def get_input_embeddings(self): method set_input_embeddings (line 589) | def set_input_embeddings(self, value): method _prune_heads (line 592) | def _prune_heads(self, heads_to_prune): method get_extended_attention_mask (line 601) | def get_extended_attention_mask(self, attention_mask: Tensor, input_sh... method forward (line 662) | def forward( class BertLMHeadModel (line 803) | class BertLMHeadModel(BertPreTrainedModel): method __init__ (line 808) | def __init__(self, config): method get_output_embeddings (line 816) | def get_output_embeddings(self): method set_output_embeddings (line 819) | def set_output_embeddings(self, new_embeddings): method forward (line 822) | def forward( method prepare_inputs_for_generation (line 924) | def prepare_inputs_for_generation(self, input_ids, past=None, attentio... method _reorder_cache (line 943) | def _reorder_cache(self, past, beam_idx): FILE: diffsynth/extensions/ImageQualityMetric/BLIP/vit.py class Mlp (line 19) | class Mlp(nn.Module): method __init__ (line 22) | def __init__(self, in_features, hidden_features=None, out_features=Non... method forward (line 31) | def forward(self, x): class Attention (line 40) | class Attention(nn.Module): method __init__ (line 41) | def __init__(self, dim, num_heads=8, qkv_bias=False, qk_scale=None, at... method save_attn_gradients (line 54) | def save_attn_gradients(self, attn_gradients): method get_attn_gradients (line 57) | def get_attn_gradients(self): method save_attention_map (line 60) | def save_attention_map(self, attention_map): method get_attention_map (line 63) | def get_attention_map(self): method forward (line 66) | def forward(self, x, register_hook=False): class Block (line 85) | class Block(nn.Module): method __init__ (line 87) | def __init__(self, dim, num_heads, mlp_ratio=4., qkv_bias=False, qk_sc... method forward (line 103) | def forward(self, x, register_hook=False): class VisionTransformer (line 109) | class VisionTransformer(nn.Module): method __init__ (line 114) | def __init__(self, img_size=224, patch_size=16, in_chans=3, num_classe... method _init_weights (line 163) | def _init_weights(self, m): method no_weight_decay (line 173) | def no_weight_decay(self): method forward (line 176) | def forward(self, x, register_blk=-1): method load_pretrained (line 193) | def load_pretrained(self, checkpoint_path, prefix=''): function _load_weights (line 198) | def _load_weights(model: VisionTransformer, checkpoint_path: str, prefix... function interpolate_pos_embed (line 277) | def interpolate_pos_embed(pos_embed_checkpoint, visual_encoder): FILE: diffsynth/extensions/ImageQualityMetric/__init__.py function download_preference_model (line 136) | def download_preference_model(model_name: preference_model_id, cache_dir... function load_preference_model (line 144) | def load_preference_model(model_name: preference_model_id, device = "cud... FILE: diffsynth/extensions/ImageQualityMetric/aesthetic.py class MLP (line 10) | class MLP(torch.nn.Module): method __init__ (line 11) | def __init__(self, input_size: int, xcol: str = "emb", ycol: str = "av... method forward (line 31) | def forward(self, x: torch.Tensor) -> torch.Tensor: method training_step (line 34) | def training_step(self, batch: dict, batch_idx: int) -> torch.Tensor: method validation_step (line 41) | def validation_step(self, batch: dict, batch_idx: int) -> torch.Tensor: method configure_optimizers (line 48) | def configure_optimizers(self) -> torch.optim.Optimizer: class AestheticScore (line 52) | class AestheticScore(torch.nn.Module): method __init__ (line 53) | def __init__(self, device: torch.device, path: str = MODEL_PATHS): method _calculate_score (line 76) | def _calculate_score(self, image: torch.Tensor) -> float: method score (line 96) | def score(self, images: Union[str, List[str], Image.Image, List[Image.... FILE: diffsynth/extensions/ImageQualityMetric/clip.py class CLIPScore (line 7) | class CLIPScore(torch.nn.Module): method __init__ (line 8) | def __init__(self, device: torch.device, path: str = MODEL_PATHS): method _calculate_score (line 44) | def _calculate_score(self, image: torch.Tensor, prompt: str) -> float: method score (line 67) | def score(self, images: Union[str, List[str], Image.Image, List[Image.... FILE: diffsynth/extensions/ImageQualityMetric/config.py function get_model_path (line 8) | def get_model_path(model_name): FILE: diffsynth/extensions/ImageQualityMetric/hps.py class HPScore_v2 (line 9) | class HPScore_v2(torch.nn.Module): method __init__ (line 10) | def __init__(self, device: torch.device, path: str = MODEL_PATHS, mode... method _calculate_score (line 62) | def _calculate_score(self, image: torch.Tensor, prompt: str) -> float: method score (line 85) | def score(self, images: Union[str, List[str], Image.Image, List[Image.... FILE: diffsynth/extensions/ImageQualityMetric/imagereward.py function _convert_image_to_rgb (line 12) | def _convert_image_to_rgb(image): function _transform (line 15) | def _transform(n_px): class MLP (line 24) | class MLP(torch.nn.Module): method __init__ (line 25) | def __init__(self, input_size): method forward (line 51) | def forward(self, input): class ImageReward (line 54) | class ImageReward(torch.nn.Module): method __init__ (line 55) | def __init__(self, med_config, device='cpu', bert_model_path=""): method score_grad (line 66) | def score_grad(self, prompt_ids, prompt_attention_mask, image): method score (line 91) | def score(self, images: Union[str, List[str], Image.Image, List[Image.... method _calculate_score (line 125) | def _calculate_score(self, prompt: str, image: torch.Tensor) -> torch.... method inference_rank (line 150) | def inference_rank(self, prompt: str, generations_list: List[Union[str... class ImageRewardScore (line 190) | class ImageRewardScore(torch.nn.Module): method __init__ (line 191) | def __init__(self, device: Union[str, torch.device], path: str = MODEL... method score (line 202) | def score(self, images: Union[str, List[str], Image.Image, List[Image.... FILE: diffsynth/extensions/ImageQualityMetric/mps.py class MPScore (line 27) | class MPScore(torch.nn.Module): method __init__ (line 28) | def __init__(self, device: Union[str, torch.device], path: str = MODEL... method _calculate_score (line 45) | def _calculate_score(self, image: torch.Tensor, prompt: str) -> float: method score (line 99) | def score(self, images: Union[str, List[str], Image.Image, List[Image.... FILE: diffsynth/extensions/ImageQualityMetric/open_clip/coca_model.py class MultimodalCfg (line 45) | class MultimodalCfg(CLIPTextCfg): function _build_text_decoder_tower (line 53) | def _build_text_decoder_tower( class CoCa (line 79) | class CoCa(nn.Module): method __init__ (line 80) | def __init__( method set_grad_checkpointing (line 126) | def set_grad_checkpointing(self, enable=True): method _encode_image (line 131) | def _encode_image(self, images, normalize=True): method _encode_text (line 136) | def _encode_text(self, text, normalize=True, embed_cls=True): method encode_image (line 142) | def encode_image(self, images, normalize=True): method encode_text (line 146) | def encode_text(self, text, normalize=True, embed_cls=True): method forward (line 150) | def forward(self, image, text, embed_cls=True, image_latent=None, imag... method generate (line 167) | def generate( method _generate_beamsearch (line 290) | def _generate_beamsearch( function prepare_inputs_for_generation (line 439) | def prepare_inputs_for_generation(input_ids, image_inputs, past=None, **... FILE: diffsynth/extensions/ImageQualityMetric/open_clip/factory.py function _natural_key (line 29) | def _natural_key(string_): function _rescan_model_configs (line 33) | def _rescan_model_configs(): function list_models (line 57) | def list_models(): function add_model_config (line 62) | def add_model_config(path): function get_model_config (line 70) | def get_model_config(model_name): function get_tokenizer (line 77) | def get_tokenizer(model_name, open_clip_bpe_path=None): function load_state_dict (line 87) | def load_state_dict(checkpoint_path: str, map_location='cpu'): function load_checkpoint (line 98) | def load_checkpoint(model, checkpoint_path, strict=True): function create_model (line 108) | def create_model( function create_loss (line 244) | def create_loss(args): class MLP (line 274) | class MLP(torch.nn.Module): method __init__ (line 275) | def __init__(self, input_size): method forward (line 289) | def forward(self, x): function create_model_and_transforms (line 309) | def create_model_and_transforms( function create_model_from_pretrained (line 394) | def create_model_from_pretrained( FILE: diffsynth/extensions/ImageQualityMetric/open_clip/hf_model.py class BaseModelOutput (line 21) | class BaseModelOutput: class PretrainedConfig (line 25) | class PretrainedConfig: function _camel2snake (line 32) | def _camel2snake(s): function register_pooler (line 40) | def register_pooler(cls): class MeanPooler (line 47) | class MeanPooler(nn.Module): method forward (line 50) | def forward(self, x: BaseModelOutput, attention_mask: TensorType): class MaxPooler (line 56) | class MaxPooler(nn.Module): method forward (line 59) | def forward(self, x: BaseModelOutput, attention_mask: TensorType): class ClsPooler (line 65) | class ClsPooler(nn.Module): method __init__ (line 68) | def __init__(self, use_pooler_output=True): method forward (line 73) | def forward(self, x: BaseModelOutput, attention_mask: TensorType): class HFTextEncoder (line 83) | class HFTextEncoder(nn.Module): method __init__ (line 87) | def __init__( method forward (line 137) | def forward(self, x: TensorType): method lock (line 154) | def lock(self, unlocked_layers: int = 0, freeze_layer_norm: bool = True): method set_grad_checkpointing (line 172) | def set_grad_checkpointing(self, enable=True): method init_parameters (line 175) | def init_parameters(self): FILE: diffsynth/extensions/ImageQualityMetric/open_clip/loss.py function gather_features (line 20) | def gather_features( class ClipLoss (line 67) | class ClipLoss(nn.Module): method __init__ (line 69) | def __init__( method get_ground_truth (line 90) | def get_ground_truth(self, device, num_logits) -> torch.Tensor: method get_logits (line 103) | def get_logits(self, image_features, text_features, logit_scale): method forward (line 121) | def forward(self, image_features, text_features, logit_scale, output_d... class PreferenceLoss (line 133) | class PreferenceLoss(nn.Module): method forward (line 135) | def forward(self, logits_per_image, num_images, labels): class HPSLoss (line 143) | class HPSLoss(nn.Module): method forward (line 145) | def forward(self, text_logits, labels): class RankingLoss (line 171) | class RankingLoss(nn.Module): method forward (line 173) | def forward(self, logits_per_image, num_images, labels, margin = 1.0): class CoCaLoss (line 192) | class CoCaLoss(ClipLoss): method __init__ (line 193) | def __init__( method forward (line 218) | def forward(self, image_features, text_features, logits, labels, logit... class DistillClipLoss (line 234) | class DistillClipLoss(ClipLoss): method dist_loss (line 236) | def dist_loss(self, teacher_logits, student_logits): method forward (line 239) | def forward( FILE: diffsynth/extensions/ImageQualityMetric/open_clip/model.py class CLIPVisionCfg (line 24) | class CLIPVisionCfg: class CLIPTextCfg (line 49) | class CLIPTextCfg: function get_cast_dtype (line 66) | def get_cast_dtype(precision: str): function _build_vision_tower (line 75) | def _build_vision_tower( function _build_text_tower (line 137) | def _build_text_tower( class CLIP (line 176) | class CLIP(nn.Module): method __init__ (line 179) | def __init__( method lock_image_tower (line 203) | def lock_image_tower(self, unlocked_groups=0, freeze_bn_stats=False): method lock_text_tower (line 207) | def lock_text_tower(self, unlocked_layers: int = 0, freeze_layer_norm:... method set_grad_checkpointing (line 224) | def set_grad_checkpointing(self, enable=True): method encode_image (line 228) | def encode_image(self, image, normalize: bool = False): method encode_text (line 232) | def encode_text(self, text, normalize: bool = False): method forward (line 246) | def forward(self, image, text): class CustomTextCLIP (line 258) | class CustomTextCLIP(nn.Module): method __init__ (line 261) | def __init__( method lock_image_tower (line 276) | def lock_image_tower(self, unlocked_groups=0, freeze_bn_stats=False): method lock_text_tower (line 280) | def lock_text_tower(self, unlocked_layers: int = 0, freeze_layer_norm:... method set_grad_checkpointing (line 284) | def set_grad_checkpointing(self, enable=True): method encode_image (line 288) | def encode_image(self, image, normalize: bool = False): method encode_text (line 292) | def encode_text(self, text, normalize: bool = False): method forward (line 296) | def forward(self, image, text): function convert_weights_to_lp (line 308) | def convert_weights_to_lp(model: nn.Module, dtype=torch.float16): function convert_to_custom_text_state_dict (line 336) | def convert_to_custom_text_state_dict(state_dict: dict): function build_model_from_openai_state_dict (line 354) | def build_model_from_openai_state_dict( function trace_model (line 414) | def trace_model(model, batch_size=256, device=torch.device('cpu')): function resize_pos_embed (line 430) | def resize_pos_embed(state_dict, model, interpolation: str = 'bicubic', ... FILE: diffsynth/extensions/ImageQualityMetric/open_clip/modified_resnet.py class Bottleneck (line 10) | class Bottleneck(nn.Module): method __init__ (line 13) | def __init__(self, inplanes, planes, stride=1): method forward (line 42) | def forward(self, x: torch.Tensor): class AttentionPool2d (line 58) | class AttentionPool2d(nn.Module): method __init__ (line 59) | def __init__(self, spacial_dim: int, embed_dim: int, num_heads: int, o... method forward (line 68) | def forward(self, x): class ModifiedResNet (line 95) | class ModifiedResNet(nn.Module): method __init__ (line 103) | def __init__(self, layers, output_dim, heads, image_size=224, width=64): method _make_layer (line 132) | def _make_layer(self, planes, blocks, stride=1): method init_parameters (line 141) | def init_parameters(self): method lock (line 154) | def lock(self, unlocked_groups=0, freeze_bn_stats=False): method set_grad_checkpointing (line 162) | def set_grad_checkpointing(self, enable=True): method stem (line 166) | def stem(self, x): method forward (line 173) | def forward(self, x): FILE: diffsynth/extensions/ImageQualityMetric/open_clip/openai.py function list_openai_models (line 18) | def list_openai_models() -> List[str]: function load_openai_model (line 23) | def load_openai_model( FILE: diffsynth/extensions/ImageQualityMetric/open_clip/pretrained.py function _pcfg (line 21) | def _pcfg(url='', hf_hub='', mean=None, std=None): function _clean_tag (line 235) | def _clean_tag(tag: str): function list_pretrained (line 240) | def list_pretrained(as_str: bool = False): function list_pretrained_models_by_tag (line 247) | def list_pretrained_models_by_tag(tag: str): function list_pretrained_tags_by_model (line 257) | def list_pretrained_tags_by_model(model: str): function is_pretrained_cfg (line 265) | def is_pretrained_cfg(model: str, tag: str): function get_pretrained_cfg (line 271) | def get_pretrained_cfg(model: str, tag: str): function get_pretrained_url (line 278) | def get_pretrained_url(model: str, tag: str): function download_pretrained_from_url (line 283) | def download_pretrained_from_url( function has_hf_hub (line 329) | def has_hf_hub(necessary=False): function download_pretrained_from_hf (line 337) | def download_pretrained_from_hf( function download_pretrained (line 348) | def download_pretrained( FILE: diffsynth/extensions/ImageQualityMetric/open_clip/push_to_hf_hub.py function save_config_for_hf (line 27) | def save_config_for_hf( function save_for_hf (line 45) | def save_for_hf( function push_to_hf_hub (line 65) | def push_to_hf_hub( function push_pretrained_to_hf_hub (line 124) | def push_pretrained_to_hf_hub( function generate_readme (line 163) | def generate_readme(model_card: dict, model_name: str): FILE: diffsynth/extensions/ImageQualityMetric/open_clip/timm_model.py class TimmModel (line 28) | class TimmModel(nn.Module): method __init__ (line 33) | def __init__( method lock (line 85) | def lock(self, unlocked_groups=0, freeze_bn_stats=False): method set_grad_checkpointing (line 118) | def set_grad_checkpointing(self, enable=True): method forward (line 124) | def forward(self, x): FILE: diffsynth/extensions/ImageQualityMetric/open_clip/tokenizer.py function default_bpe (line 21) | def default_bpe(): function bytes_to_unicode (line 29) | def bytes_to_unicode(): function get_pairs (line 51) | def get_pairs(word): function basic_clean (line 63) | def basic_clean(text): function whitespace_clean (line 69) | def whitespace_clean(text): class SimpleTokenizer (line 75) | class SimpleTokenizer(object): method __init__ (line 76) | def __init__(self, bpe_path: str = default_bpe(), special_tokens=None): method bpe (line 101) | def bpe(self, token): method encode (line 142) | def encode(self, text): method decode (line 150) | def decode(self, tokens): method __call__ (line 155) | def __call__(self, texts: Union[str, List[str]], context_length: int =... class HFTokenizer (line 188) | class HFTokenizer: method __init__ (line 191) | def __init__(self, tokenizer_name: str): method save_pretrained (line 195) | def save_pretrained(self, dest): method __call__ (line 198) | def __call__(self, texts: Union[str, List[str]], context_length: int =... FILE: diffsynth/extensions/ImageQualityMetric/open_clip/transform.py class AugmentationCfg (line 16) | class AugmentationCfg: class ResizeMaxSize (line 26) | class ResizeMaxSize(nn.Module): method __init__ (line 28) | def __init__(self, max_size, interpolation=InterpolationMode.BICUBIC, ... method forward (line 37) | def forward(self, img): function _convert_to_rgb_or_rgba (line 52) | def _convert_to_rgb_or_rgba(image): class MaskAwareNormalize (line 66) | class MaskAwareNormalize(nn.Module): method __init__ (line 67) | def __init__(self, mean, std): method forward (line 71) | def forward(self, tensor): function image_transform (line 77) | def image_transform( FILE: diffsynth/extensions/ImageQualityMetric/open_clip/transformer.py class LayerNormFp32 (line 13) | class LayerNormFp32(nn.LayerNorm): method forward (line 16) | def forward(self, x: torch.Tensor): class LayerNorm (line 22) | class LayerNorm(nn.LayerNorm): method forward (line 25) | def forward(self, x: torch.Tensor): class QuickGELU (line 31) | class QuickGELU(nn.Module): method forward (line 33) | def forward(self, x: torch.Tensor): class LayerScale (line 37) | class LayerScale(nn.Module): method __init__ (line 38) | def __init__(self, dim, init_values=1e-5, inplace=False): method forward (line 43) | def forward(self, x): class PatchDropout (line 47) | class PatchDropout(nn.Module): method __init__ (line 52) | def __init__(self, prob, exclude_first_token=True): method forward (line 58) | def forward(self, x): class Attention (line 87) | class Attention(nn.Module): method __init__ (line 88) | def __init__( method forward (line 127) | def forward(self, x, attn_mask: Optional[torch.Tensor] = None): class AttentionalPooler (line 163) | class AttentionalPooler(nn.Module): method __init__ (line 164) | def __init__( method forward (line 178) | def forward(self, x: torch.Tensor): method _repeat (line 185) | def _repeat(self, query, N: int): class ResidualAttentionBlock (line 189) | class ResidualAttentionBlock(nn.Module): method __init__ (line 190) | def __init__( method attention (line 217) | def attention( method forward (line 232) | def forward( class CustomResidualAttentionBlock (line 247) | class CustomResidualAttentionBlock(nn.Module): method __init__ (line 248) | def __init__( method forward (line 282) | def forward(self, x: torch.Tensor, attn_mask: Optional[torch.Tensor] =... class Transformer (line 288) | class Transformer(nn.Module): method __init__ (line 289) | def __init__( method get_cast_dtype (line 310) | def get_cast_dtype(self) -> torch.dtype: method forward (line 313) | def forward(self, x: torch.Tensor, attn_mask: Optional[torch.Tensor] =... class VisionTransformer (line 323) | class VisionTransformer(nn.Module): method __init__ (line 326) | def __init__( method lock (line 395) | def lock(self, unlocked_groups=0, freeze_bn_stats=False): method init_parameters (line 428) | def init_parameters(self): method set_grad_checkpointing (line 449) | def set_grad_checkpointing(self, enable=True): method _global_pool (line 452) | def _global_pool(self, x: torch.Tensor) -> Tuple[torch.Tensor, torch.T... method forward (line 458) | def forward(self, x: torch.Tensor, skip_pool: bool = False): class TextTransformer (line 507) | class TextTransformer(nn.Module): method __init__ (line 510) | def __init__( method init_parameters (line 558) | def init_parameters(self): method set_grad_checkpointing (line 577) | def set_grad_checkpointing(self, enable=True): method build_attention_mask (line 580) | def build_attention_mask(self): method build_cls_mask (line 588) | def build_cls_mask(self, text, cast_dtype: torch.dtype): method _repeat (line 597) | def _repeat(self, t, N: int): method forward (line 600) | def forward(self, text): class MultimodalTransformer (line 635) | class MultimodalTransformer(Transformer): method __init__ (line 636) | def __init__( method init_parameters (line 677) | def init_parameters(self): method build_attention_mask (line 695) | def build_attention_mask(self): method forward (line 703) | def forward(self, image_embs, text_embs): method set_grad_checkpointing (line 726) | def set_grad_checkpointing(self, enable=True): FILE: diffsynth/extensions/ImageQualityMetric/open_clip/utils.py function freeze_batch_norm_2d (line 8) | def freeze_batch_norm_2d(module, module_match={}, name=''): function _ntuple (line 48) | def _ntuple(n): FILE: diffsynth/extensions/ImageQualityMetric/pickscore.py class PickScore (line 8) | class PickScore(torch.nn.Module): method __init__ (line 9) | def __init__(self, device: Union[str, torch.device], path: str = MODEL... method _calculate_score (line 22) | def _calculate_score(self, image: torch.Tensor, prompt: str, softmax: ... method score (line 58) | def score(self, images: Union[str, List[str], Image.Image, List[Image.... FILE: diffsynth/extensions/ImageQualityMetric/trainer/models/base_model.py class BaseModelConfig (line 6) | class BaseModelConfig: FILE: diffsynth/extensions/ImageQualityMetric/trainer/models/clip_model.py class XCLIPModel (line 17) | class XCLIPModel(HFCLIPModel): method __init__ (line 18) | def __init__(self, config: CLIPConfig): method get_text_features (line 21) | def get_text_features( method get_image_features (line 61) | def get_image_features( class ClipModelConfig (line 93) | class ClipModelConfig(BaseModelConfig): class CLIPModel (line 98) | class CLIPModel(nn.Module): method __init__ (line 99) | def __init__(self, ckpt, config_file=False): method get_text_features (line 110) | def get_text_features(self, *args, **kwargs): method get_image_features (line 113) | def get_image_features(self, *args, **kwargs): method forward (line 116) | def forward(self, text_inputs=None, image_inputs=None, condition_input... method logit_scale (line 141) | def logit_scale(self): method save (line 144) | def save(self, path): FILE: diffsynth/extensions/ImageQualityMetric/trainer/models/cross_modeling.py function exists (line 8) | def exists(val): function default (line 11) | def default(val, d): class LayerNorm (line 18) | class LayerNorm(nn.Module): method __init__ (line 19) | def __init__(self, dim): method forward (line 24) | def forward(self, x): class Residual (line 30) | class Residual(nn.Module): method __init__ (line 31) | def __init__(self, fn): method forward (line 35) | def forward(self, x, *args, **kwargs): class RotaryEmbedding (line 43) | class RotaryEmbedding(nn.Module): method __init__ (line 44) | def __init__(self, dim): method forward (line 49) | def forward(self, max_seq_len, *, device): function rotate_half (line 55) | def rotate_half(x): function apply_rotary_pos_emb (line 61) | def apply_rotary_pos_emb(pos, t): class SwiGLU (line 69) | class SwiGLU(nn.Module): method forward (line 70) | def forward(self, x): class ParallelTransformerBlock (line 78) | class ParallelTransformerBlock(nn.Module): method __init__ (line 79) | def __init__(self, dim, dim_head=64, heads=8, ff_mult=4): method get_rotary_embedding (line 102) | def get_rotary_embedding(self, n, device): method forward (line 110) | def forward(self, x, attn_mask=None): class CrossAttention (line 172) | class CrossAttention(nn.Module): method __init__ (line 173) | def __init__( method forward (line 207) | def forward(self, x, context, mask): class Cross_model (line 261) | class Cross_model(nn.Module): method __init__ (line 262) | def __init__( method forward (line 281) | def forward( FILE: diffsynth/extensions/RIFE/__init__.py function warp (line 8) | def warp(tenInput, tenFlow, device): function conv (line 26) | def conv(in_planes, out_planes, kernel_size=3, stride=1, padding=1, dila... class IFBlock (line 34) | class IFBlock(nn.Module): method __init__ (line 35) | def __init__(self, in_planes, c=64): method forward (line 45) | def forward(self, x, flow, scale=1): class IFNet (line 60) | class IFNet(nn.Module): method __init__ (line 61) | def __init__(self, **kwargs): method forward (line 68) | def forward(self, x, scale_list=[4, 2, 1], training=False): method state_dict_converter (line 103) | def state_dict_converter(): class IFNetStateDictConverter (line 107) | class IFNetStateDictConverter: method __init__ (line 108) | def __init__(self): method from_diffusers (line 111) | def from_diffusers(self, state_dict): method from_civitai (line 115) | def from_civitai(self, state_dict): class RIFEInterpolater (line 119) | class RIFEInterpolater: method __init__ (line 120) | def __init__(self, model, device="cuda"): method from_model_manager (line 127) | def from_model_manager(model_manager): method process_image (line 130) | def process_image(self, image): method process_images (line 139) | def process_images(self, images): method decode_images (line 144) | def decode_images(self, images): method add_interpolated_images (line 149) | def add_interpolated_images(self, images, interpolated_images): method interpolate_ (line 159) | def interpolate_(self, images, scale=1.0): method interpolate (line 171) | def interpolate(self, images, scale=1.0, batch_size=4, num_iter=1, pro... class RIFESmoother (line 200) | class RIFESmoother(RIFEInterpolater): method __init__ (line 201) | def __init__(self, model, device="cuda"): method from_model_manager (line 205) | def from_model_manager(model_manager): method process_tensors (line 208) | def process_tensors(self, input_tensor, scale=1.0, batch_size=4): method __call__ (line 220) | def __call__(self, rendered_frames, scale=1.0, batch_size=4, num_iter=... FILE: diffsynth/models/attention.py function low_version_attention (line 5) | def low_version_attention(query, key, value, attn_bias=None): class Attention (line 15) | class Attention(torch.nn.Module): method __init__ (line 17) | def __init__(self, q_dim, num_heads, head_dim, kv_dim=None, bias_q=Fal... method interact_with_ipadapter (line 29) | def interact_with_ipadapter(self, hidden_states, q, ip_k, ip_v, scale=... method torch_forward (line 37) | def torch_forward(self, hidden_states, encoder_hidden_states=None, att... method xformers_forward (line 64) | def xformers_forward(self, hidden_states, encoder_hidden_states=None, ... method forward (line 88) | def forward(self, hidden_states, encoder_hidden_states=None, attn_mask... FILE: diffsynth/models/cog_dit.py class CogPatchify (line 11) | class CogPatchify(torch.nn.Module): method __init__ (line 12) | def __init__(self, dim_in, dim_out, patch_size) -> None: method forward (line 16) | def forward(self, hidden_states): class CogAdaLayerNorm (line 23) | class CogAdaLayerNorm(torch.nn.Module): method __init__ (line 24) | def __init__(self, dim, dim_cond, single=False): method forward (line 31) | def forward(self, hidden_states, prompt_emb, emb): class CogDiTBlock (line 45) | class CogDiTBlock(torch.nn.Module): method __init__ (line 46) | def __init__(self, dim, dim_cond, num_heads): method apply_rotary_emb (line 61) | def apply_rotary_emb(self, x, freqs_cis): method process_qkv (line 72) | def process_qkv(self, q, k, v, image_rotary_emb, text_seq_length): method forward (line 80) | def forward(self, hidden_states, prompt_emb, time_emb, image_rotary_emb): class CogDiT (line 108) | class CogDiT(torch.nn.Module): method __init__ (line 109) | def __init__(self): method get_resize_crop_region_for_grid (line 120) | def get_resize_crop_region_for_grid(self, src, tgt_width, tgt_height): method get_3d_rotary_pos_embed (line 138) | def get_3d_rotary_pos_embed( method prepare_rotary_positional_embeddings (line 202) | def prepare_rotary_positional_embeddings( method unpatchify (line 230) | def unpatchify(self, hidden_states, height, width): method build_mask (line 235) | def build_mask(self, T, H, W, dtype, device, is_bound): method tiled_forward (line 255) | def tiled_forward(self, hidden_states, timestep, prompt_emb, tile_size... method forward (line 286) | def forward(self, hidden_states, timestep, prompt_emb, image_rotary_em... method state_dict_converter (line 328) | def state_dict_converter(): method from_pretrained (line 333) | def from_pretrained(file_path, torch_dtype=torch.bfloat16): class CogDiTStateDictConverter (line 342) | class CogDiTStateDictConverter: method __init__ (line 343) | def __init__(self): method from_diffusers (line 347) | def from_diffusers(self, state_dict): method from_civitai (line 407) | def from_civitai(self, state_dict): FILE: diffsynth/models/cog_vae.py class Downsample3D (line 7) | class Downsample3D(torch.nn.Module): method __init__ (line 8) | def __init__( method forward (line 22) | def forward(self, x: torch.Tensor, xq: torch.Tensor) -> torch.Tensor: class Upsample3D (line 57) | class Upsample3D(torch.nn.Module): method __init__ (line 58) | def __init__( method forward (line 71) | def forward(self, inputs: torch.Tensor, xq: torch.Tensor) -> torch.Ten... class CogVideoXSpatialNorm3D (line 103) | class CogVideoXSpatialNorm3D(torch.nn.Module): method __init__ (line 104) | def __init__(self, f_channels, zq_channels, groups): method forward (line 111) | def forward(self, f: torch.Tensor, zq: torch.Tensor) -> torch.Tensor: class Resnet3DBlock (line 128) | class Resnet3DBlock(torch.nn.Module): method __init__ (line 129) | def __init__(self, in_channels, out_channels, spatial_norm_dim, groups... method forward (line 152) | def forward(self, hidden_states, zq): class CachedConv3d (line 169) | class CachedConv3d(torch.nn.Conv3d): method __init__ (line 170) | def __init__(self, in_channels, out_channels, kernel_size, stride=1, p... method clear_cache (line 175) | def clear_cache(self): method forward (line 179) | def forward(self, input: torch.Tensor, use_cache = True) -> torch.Tensor: class CogVAEDecoder (line 189) | class CogVAEDecoder(torch.nn.Module): method __init__ (line 190) | def __init__(self): method forward (line 224) | def forward(self, sample): method decode_video (line 238) | def decode_video(self, sample, tiled=True, tile_size=(60, 90), tile_st... method decode_small_video (line 254) | def decode_small_video(self, sample): method state_dict_converter (line 273) | def state_dict_converter(): class CogVAEEncoder (line 278) | class CogVAEEncoder(torch.nn.Module): method __init__ (line 279) | def __init__(self): method forward (line 309) | def forward(self, sample): method encode_video (line 323) | def encode_video(self, sample, tiled=True, tile_size=(60, 90), tile_st... method encode_small_video (line 339) | def encode_small_video(self, sample): method state_dict_converter (line 358) | def state_dict_converter(): class CogVAEEncoderStateDictConverter (line 363) | class CogVAEEncoderStateDictConverter: method __init__ (line 364) | def __init__(self): method from_diffusers (line 368) | def from_diffusers(self, state_dict): method from_civitai (line 435) | def from_civitai(self, state_dict): class CogVAEDecoderStateDictConverter (line 440) | class CogVAEDecoderStateDictConverter: method __init__ (line 441) | def __init__(self): method from_diffusers (line 445) | def from_diffusers(self, state_dict): method from_civitai (line 516) | def from_civitai(self, state_dict): FILE: diffsynth/models/downloader.py function download_from_modelscope (line 9) | def download_from_modelscope(model_id, origin_file_path, local_dir): function download_from_huggingface (line 24) | def download_from_huggingface(model_id, origin_file_path, local_dir): function download_customized_models (line 53) | def download_customized_models( function download_models (line 72) | def download_models( FILE: diffsynth/models/flux_controlnet.py class FluxControlNet (line 8) | class FluxControlNet(torch.nn.Module): method __init__ (line 9) | def __init__(self, disable_guidance_embedder=False, num_joint_blocks=5... method prepare_image_ids (line 29) | def prepare_image_ids(self, latents): method patchify (line 46) | def patchify(self, hidden_states): method align_res_stack_to_original_blocks (line 51) | def align_res_stack_to_original_blocks(self, res_stack, num_blocks, hi... method forward (line 59) | def forward( method state_dict_converter (line 106) | def state_dict_converter(): method quantize (line 109) | def quantize(self): class FluxControlNetStateDictConverter (line 212) | class FluxControlNetStateDictConverter: method __init__ (line 213) | def __init__(self): method from_diffusers (line 216) | def from_diffusers(self, state_dict): method from_civitai (line 326) | def from_civitai(self, state_dict): FILE: diffsynth/models/flux_dit.py function interact_with_ipadapter (line 7) | def interact_with_ipadapter(hidden_states, q, ip_k, ip_v, scale=1.0): class RoPEEmbedding (line 15) | class RoPEEmbedding(torch.nn.Module): method __init__ (line 16) | def __init__(self, dim, theta, axes_dim): method rope (line 23) | def rope(self, pos: torch.Tensor, dim: int, theta: int) -> torch.Tensor: method forward (line 39) | def forward(self, ids): class FluxJointAttention (line 46) | class FluxJointAttention(torch.nn.Module): method __init__ (line 47) | def __init__(self, dim_a, dim_b, num_heads, head_dim, only_out_a=False): method apply_rope (line 66) | def apply_rope(self, xq, xk, freqs_cis): method forward (line 73) | def forward(self, hidden_states_a, hidden_states_b, image_rotary_emb, ... class FluxJointTransformerBlock (line 109) | class FluxJointTransformerBlock(torch.nn.Module): method __init__ (line 110) | def __init__(self, dim, num_attention_heads): method forward (line 132) | def forward(self, hidden_states_a, hidden_states_b, temb, image_rotary... class FluxSingleAttention (line 153) | class FluxSingleAttention(torch.nn.Module): method __init__ (line 154) | def __init__(self, dim_a, dim_b, num_heads, head_dim): method apply_rope (line 165) | def apply_rope(self, xq, xk, freqs_cis): method forward (line 173) | def forward(self, hidden_states, image_rotary_emb): class AdaLayerNormSingle (line 190) | class AdaLayerNormSingle(torch.nn.Module): method __init__ (line 191) | def __init__(self, dim): method forward (line 198) | def forward(self, x, emb): class FluxSingleTransformerBlock (line 206) | class FluxSingleTransformerBlock(torch.nn.Module): method __init__ (line 207) | def __init__(self, dim, num_attention_heads): method apply_rope (line 221) | def apply_rope(self, xq, xk, freqs_cis): method process_attention (line 229) | def process_attention(self, hidden_states, image_rotary_emb, attn_mask... method forward (line 246) | def forward(self, hidden_states_a, hidden_states_b, temb, image_rotary... class AdaLayerNormContinuous (line 263) | class AdaLayerNormContinuous(torch.nn.Module): method __init__ (line 264) | def __init__(self, dim): method forward (line 270) | def forward(self, x, conditioning): class FluxDiT (line 278) | class FluxDiT(torch.nn.Module): method __init__ (line 279) | def __init__(self, disable_guidance_embedder=False): method patchify (line 295) | def patchify(self, hidden_states): method unpatchify (line 300) | def unpatchify(self, hidden_states, height, width): method prepare_image_ids (line 305) | def prepare_image_ids(self, latents): method tiled_forward (line 322) | def tiled_forward( method construct_mask (line 341) | def construct_mask(self, entity_masks, prompt_seq_len, image_seq_len): method process_entity_masks (line 376) | def process_entity_masks(self, hidden_states, prompt_emb, entity_promp... method forward (line 405) | def forward( method quantize (line 474) | def quantize(self): method state_dict_converter (line 553) | def state_dict_converter(): class FluxDiTStateDictConverter (line 557) | class FluxDiTStateDictConverter: method __init__ (line 558) | def __init__(self): method from_diffusers (line 561) | def from_diffusers(self, state_dict): method from_civitai (line 662) | def from_civitai(self, state_dict): FILE: diffsynth/models/flux_ipadapter.py class MLPProjModel (line 7) | class MLPProjModel(torch.nn.Module): method __init__ (line 8) | def __init__(self, cross_attention_dim=768, id_embeddings_dim=512, num... method forward (line 21) | def forward(self, id_embeds): class IpAdapterModule (line 27) | class IpAdapterModule(torch.nn.Module): method __init__ (line 28) | def __init__(self, num_attention_heads, attention_head_dim, input_dim): method forward (line 38) | def forward(self, hidden_states): class FluxIpAdapter (line 50) | class FluxIpAdapter(torch.nn.Module): method __init__ (line 51) | def __init__(self, num_attention_heads=24, attention_head_dim=128, cro... method set_adapter (line 57) | def set_adapter(self): method forward (line 60) | def forward(self, hidden_states, scale=1.0): method state_dict_converter (line 75) | def state_dict_converter(): class FluxIpAdapterStateDictConverter (line 79) | class FluxIpAdapterStateDictConverter: method __init__ (line 80) | def __init__(self): method from_diffusers (line 83) | def from_diffusers(self, state_dict): method from_civitai (line 93) | def from_civitai(self, state_dict): FILE: diffsynth/models/flux_text_encoder.py class FluxTextEncoder2 (line 7) | class FluxTextEncoder2(T5EncoderModel): method __init__ (line 8) | def __init__(self, config): method forward (line 12) | def forward(self, input_ids): method state_dict_converter (line 18) | def state_dict_converter(): class FluxTextEncoder2StateDictConverter (line 23) | class FluxTextEncoder2StateDictConverter(): method __init__ (line 24) | def __init__(self): method from_diffusers (line 27) | def from_diffusers(self, state_dict): method from_civitai (line 31) | def from_civitai(self, state_dict): FILE: diffsynth/models/flux_vae.py class FluxVAEEncoder (line 5) | class FluxVAEEncoder(SD3VAEEncoder): method __init__ (line 6) | def __init__(self): method state_dict_converter (line 12) | def state_dict_converter(): class FluxVAEDecoder (line 16) | class FluxVAEDecoder(SD3VAEDecoder): method __init__ (line 17) | def __init__(self): method state_dict_converter (line 23) | def state_dict_converter(): class FluxVAEEncoderStateDictConverter (line 27) | class FluxVAEEncoderStateDictConverter(SDVAEEncoderStateDictConverter): method __init__ (line 28) | def __init__(self): method from_civitai (line 31) | def from_civitai(self, state_dict): class FluxVAEDecoderStateDictConverter (line 151) | class FluxVAEDecoderStateDictConverter(SDVAEDecoderStateDictConverter): method __init__ (line 152) | def __init__(self): method from_civitai (line 155) | def from_civitai(self, state_dict): FILE: diffsynth/models/hunyuan_dit.py class HunyuanDiTRotaryEmbedding (line 7) | class HunyuanDiTRotaryEmbedding(torch.nn.Module): method __init__ (line 9) | def __init__(self, q_norm_shape=88, k_norm_shape=88, rotary_emb_on_k=T... method reshape_for_broadcast (line 16) | def reshape_for_broadcast(self, freqs_cis, x): method rotate_half (line 21) | def rotate_half(self, x): method apply_rotary_emb (line 25) | def apply_rotary_emb(self, xq, xk, freqs_cis): method forward (line 34) | def forward(self, q, k, v, freqs_cis_img, to_cache=False): class FP32_Layernorm (line 55) | class FP32_Layernorm(torch.nn.LayerNorm): method forward (line 56) | def forward(self, inputs): class FP32_SiLU (line 61) | class FP32_SiLU(torch.nn.SiLU): method forward (line 62) | def forward(self, inputs): class HunyuanDiTFinalLayer (line 67) | class HunyuanDiTFinalLayer(torch.nn.Module): method __init__ (line 68) | def __init__(self, final_hidden_size=1408, condition_dim=1408, patch_s... method modulate (line 77) | def modulate(self, x, shift, scale): method forward (line 80) | def forward(self, hidden_states, condition_emb): class HunyuanDiTBlock (line 87) | class HunyuanDiTBlock(torch.nn.Module): method __init__ (line 89) | def __init__( method forward (line 118) | def forward(self, hidden_states, condition_emb, text_emb, freq_cis_img... class AttentionPool (line 140) | class AttentionPool(torch.nn.Module): method __init__ (line 141) | def __init__(self, spacial_dim, embed_dim, num_heads, output_dim = None): method forward (line 150) | def forward(self, x): class PatchEmbed (line 176) | class PatchEmbed(torch.nn.Module): method __init__ (line 177) | def __init__( method forward (line 187) | def forward(self, x): function timestep_embedding (line 193) | def timestep_embedding(t, dim, max_period=10000, repeat_only=False): class TimestepEmbedder (line 213) | class TimestepEmbedder(torch.nn.Module): method __init__ (line 214) | def __init__(self, hidden_size=1408, frequency_embedding_size=256): method forward (line 223) | def forward(self, t): class HunyuanDiT (line 229) | class HunyuanDiT(torch.nn.Module): method __init__ (line 230) | def __init__(self, num_layers_down=21, num_layers_up=19, in_channels=4... method prepare_text_emb (line 262) | def prepare_text_emb(self, text_emb, text_emb_t5, text_emb_mask, text_... method prepare_extra_emb (line 271) | def prepare_extra_emb(self, text_emb_t5, timestep, size_emb, dtype, ba... method unpatchify (line 291) | def unpatchify(self, x, h, w): method build_mask (line 294) | def build_mask(self, data, is_bound): method tiled_block_forward (line 311) | def tiled_block_forward(self, block, hidden_states, condition_emb, tex... method forward (line 348) | def forward( method state_dict_converter (line 402) | def state_dict_converter(): class HunyuanDiTStateDictConverter (line 407) | class HunyuanDiTStateDictConverter(): method __init__ (line 408) | def __init__(self): method from_diffusers (line 411) | def from_diffusers(self, state_dict): method from_civitai (line 450) | def from_civitai(self, state_dict): FILE: diffsynth/models/hunyuan_dit_text_encoder.py class HunyuanDiTCLIPTextEncoder (line 6) | class HunyuanDiTCLIPTextEncoder(BertModel): method __init__ (line 7) | def __init__(self): method forward (line 43) | def forward(self, input_ids, attention_mask, clip_skip=1): method state_dict_converter (line 83) | def state_dict_converter(): class HunyuanDiTT5TextEncoder (line 88) | class HunyuanDiTT5TextEncoder(T5EncoderModel): method __init__ (line 89) | def __init__(self): method forward (line 123) | def forward(self, input_ids, attention_mask, clip_skip=1): method state_dict_converter (line 136) | def state_dict_converter(): class HunyuanDiTCLIPTextEncoderStateDictConverter (line 141) | class HunyuanDiTCLIPTextEncoderStateDictConverter(): method __init__ (line 142) | def __init__(self): method from_diffusers (line 145) | def from_diffusers(self, state_dict): method from_civitai (line 149) | def from_civitai(self, state_dict): class HunyuanDiTT5TextEncoderStateDictConverter (line 153) | class HunyuanDiTT5TextEncoderStateDictConverter(): method __init__ (line 154) | def __init__(self): method from_diffusers (line 157) | def from_diffusers(self, state_dict): method from_civitai (line 162) | def from_civitai(self, state_dict): FILE: diffsynth/models/hunyuan_video_dit.py function HunyuanVideoRope (line 10) | def HunyuanVideoRope(latents): class PatchEmbed (line 196) | class PatchEmbed(torch.nn.Module): method __init__ (line 197) | def __init__(self, patch_size=(1, 2, 2), in_channels=16, embed_dim=3072): method forward (line 201) | def forward(self, x): class IndividualTokenRefinerBlock (line 207) | class IndividualTokenRefinerBlock(torch.nn.Module): method __init__ (line 208) | def __init__(self, hidden_size=3072, num_heads=24): method forward (line 226) | def forward(self, x, c, attn_mask=None): class SingleTokenRefiner (line 242) | class SingleTokenRefiner(torch.nn.Module): method __init__ (line 243) | def __init__(self, in_channels=4096, hidden_size=3072, depth=2): method forward (line 254) | def forward(self, x, t, mask=None): class ModulateDiT (line 275) | class ModulateDiT(torch.nn.Module): method __init__ (line 276) | def __init__(self, hidden_size, factor=6): method forward (line 281) | def forward(self, x): function modulate (line 285) | def modulate(x, shift=None, scale=None, tr_shift=None, tr_scale=None, tr... function reshape_for_broadcast (line 301) | def reshape_for_broadcast( function rotate_half (line 347) | def rotate_half(x): function apply_rotary_emb (line 354) | def apply_rotary_emb( function attention (line 387) | def attention(q, k, v): function apply_gate (line 394) | def apply_gate(x, gate, tr_gate=None, tr_token=None): class MMDoubleStreamBlockComponent (line 403) | class MMDoubleStreamBlockComponent(torch.nn.Module): method __init__ (line 404) | def __init__(self, hidden_size=3072, heads_num=24, mlp_width_ratio=4): method forward (line 423) | def forward(self, hidden_states, conditioning, freqs_cis=None, token_r... method process_ff (line 444) | def process_ff(self, hidden_states, attn_output, mod, mod_tr=None, tr_... class MMDoubleStreamBlock (line 456) | class MMDoubleStreamBlock(torch.nn.Module): method __init__ (line 457) | def __init__(self, hidden_size=3072, heads_num=24, mlp_width_ratio=4): method forward (line 462) | def forward(self, hidden_states_a, hidden_states_b, conditioning, freq... class MMSingleStreamBlockOriginal (line 478) | class MMSingleStreamBlockOriginal(torch.nn.Module): method __init__ (line 479) | def __init__(self, hidden_size=3072, heads_num=24, mlp_width_ratio=4): method forward (line 496) | def forward(self, x, vec, freqs_cis=None, txt_len=256): class MMSingleStreamBlock (line 518) | class MMSingleStreamBlock(torch.nn.Module): method __init__ (line 519) | def __init__(self, hidden_size=3072, heads_num=24, mlp_width_ratio=4): method forward (line 537) | def forward(self, hidden_states, conditioning, freqs_cis=None, txt_len... class FinalLayer (line 573) | class FinalLayer(torch.nn.Module): method __init__ (line 574) | def __init__(self, hidden_size=3072, patch_size=(1, 2, 2), out_channel... method forward (line 582) | def forward(self, x, c): class HunyuanVideoDiT (line 589) | class HunyuanVideoDiT(torch.nn.Module): method __init__ (line 590) | def __init__(self, in_channels=16, hidden_size=3072, text_dim=4096, nu... method unpatchify (line 612) | def unpatchify(self, x, T, H, W): method enable_block_wise_offload (line 616) | def enable_block_wise_offload(self, warm_device="cuda", cold_device="c... method load_models_to_device (line 621) | def load_models_to_device(self, loadmodel_names=[], device="cpu"): method prepare_freqs (line 628) | def prepare_freqs(self, latents): method forward (line 631) | def forward( method enable_auto_offload (line 664) | def enable_auto_offload(self, dtype=torch.bfloat16, device="cuda"): method state_dict_converter (line 810) | def state_dict_converter(): class HunyuanVideoDiTStateDictConverter (line 814) | class HunyuanVideoDiTStateDictConverter: method __init__ (line 815) | def __init__(self): method from_civitai (line 818) | def from_civitai(self, state_dict): FILE: diffsynth/models/hunyuan_video_text_encoder.py class HunyuanVideoLLMEncoder (line 6) | class HunyuanVideoLLMEncoder(LlamaModel): method __init__ (line 8) | def __init__(self, config: LlamaConfig): method enable_auto_offload (line 12) | def enable_auto_offload(self, **kwargs): method forward (line 15) | def forward(self, input_ids, attention_mask, hidden_state_skip_layer=2): class HunyuanVideoMLLMEncoder (line 52) | class HunyuanVideoMLLMEncoder(LlavaForConditionalGeneration): method __init__ (line 54) | def __init__(self, config): method enable_auto_offload (line 58) | def enable_auto_offload(self, **kwargs): method forward (line 62) | def forward(self, input_ids, pixel_values, attention_mask, hidden_stat... FILE: diffsynth/models/hunyuan_video_vae_decoder.py class CausalConv3d (line 10) | class CausalConv3d(nn.Module): method __init__ (line 12) | def __init__(self, in_channel, out_channel, kernel_size, stride=1, dil... method forward (line 19) | def forward(self, x): class UpsampleCausal3D (line 24) | class UpsampleCausal3D(nn.Module): method __init__ (line 26) | def __init__(self, channels, use_conv=False, out_channels=None, kernel... method forward (line 36) | def forward(self, hidden_states): class ResnetBlockCausal3D (line 64) | class ResnetBlockCausal3D(nn.Module): method __init__ (line 66) | def __init__(self, in_channels, out_channels=None, dropout=0.0, groups... method forward (line 86) | def forward(self, input_tensor): function prepare_causal_attention_mask (line 107) | def prepare_causal_attention_mask(n_frame, n_hw, dtype, device, batch_si... class Attention (line 118) | class Attention(nn.Module): method __init__ (line 120) | def __init__(self, method forward (line 140) | def forward(self, input_tensor, attn_mask=None): class UNetMidBlockCausal3D (line 162) | class UNetMidBlockCausal3D(nn.Module): method __init__ (line 164) | def __init__(self, in_channels, dropout=0.0, num_layers=1, eps=1e-6, n... method forward (line 203) | def forward(self, hidden_states): class UpDecoderBlockCausal3D (line 216) | class UpDecoderBlockCausal3D(nn.Module): method __init__ (line 218) | def __init__( method forward (line 254) | def forward(self, hidden_states): class DecoderCausal3D (line 263) | class DecoderCausal3D(nn.Module): method __init__ (line 265) | def __init__( method forward (line 331) | def forward(self, hidden_states): class HunyuanVideoVAEDecoder (line 369) | class HunyuanVideoVAEDecoder(nn.Module): method __init__ (line 371) | def __init__( method forward (line 401) | def forward(self, latents): method build_1d_mask (line 408) | def build_1d_mask(self, length, left_bound, right_bound, border_width): method build_mask (line 417) | def build_mask(self, data, is_bound, border_width): method tile_forward (line 432) | def tile_forward(self, hidden_states, tile_size, tile_stride): method decode_video (line 488) | def decode_video(self, latents, tile_size=(17, 32, 32), tile_stride=(1... method state_dict_converter (line 493) | def state_dict_converter(): class HunyuanVideoVAEDecoderStateDictConverter (line 497) | class HunyuanVideoVAEDecoderStateDictConverter: method __init__ (line 499) | def __init__(self): method from_diffusers (line 502) | def from_diffusers(self, state_dict): FILE: diffsynth/models/hunyuan_video_vae_encoder.py class DownsampleCausal3D (line 10) | class DownsampleCausal3D(nn.Module): method __init__ (line 12) | def __init__(self, channels, out_channels, kernel_size=3, bias=True, s... method forward (line 16) | def forward(self, hidden_states): class DownEncoderBlockCausal3D (line 21) | class DownEncoderBlockCausal3D(nn.Module): method __init__ (line 23) | def __init__( method forward (line 57) | def forward(self, hidden_states): class EncoderCausal3D (line 68) | class EncoderCausal3D(nn.Module): method __init__ (line 70) | def __init__( method forward (line 129) | def forward(self, hidden_states): class HunyuanVideoVAEEncoder (line 167) | class HunyuanVideoVAEEncoder(nn.Module): method __init__ (line 169) | def __init__( method forward (line 199) | def forward(self, images): method build_1d_mask (line 207) | def build_1d_mask(self, length, left_bound, right_bound, border_width): method build_mask (line 216) | def build_mask(self, data, is_bound, border_width): method tile_forward (line 231) | def tile_forward(self, hidden_states, tile_size, tile_stride): method encode_video (line 287) | def encode_video(self, latents, tile_size=(65, 256, 256), tile_stride=... method state_dict_converter (line 293) | def state_dict_converter(): class HunyuanVideoVAEEncoderStateDictConverter (line 297) | class HunyuanVideoVAEEncoderStateDictConverter: method __init__ (line 299) | def __init__(self): method from_diffusers (line 302) | def from_diffusers(self, state_dict): FILE: diffsynth/models/kolors_text_encoder.py class Kernel (line 52) | class Kernel: method __init__ (line 53) | def __init__(self, code: bytes, function_names: List[str]): class W8A16Linear (line 78) | class W8A16Linear(torch.autograd.Function): method forward (line 80) | def forward(ctx, inp: torch.Tensor, quant_w: torch.Tensor, scale_w: to... method backward (line 92) | def backward(ctx, grad_output: torch.Tensor): function compress_int4_weight (line 101) | def compress_int4_weight(weight: torch.Tensor): # (n, m) function extract_weight_to_half (line 122) | def extract_weight_to_half(weight: torch.Tensor, scale_list: torch.Tenso... class QuantizedLinear (line 158) | class QuantizedLinear(torch.nn.Module): method __init__ (line 159) | def __init__(self, weight_bit_width: int, weight, bias=None, device="c... method forward (line 180) | def forward(self, input): function quantize (line 187) | def quantize(model, weight_bit_width, empty_init=False, device=None): class ChatGLMConfig (line 227) | class ChatGLMConfig(PretrainedConfig): method __init__ (line 229) | def __init__( function default_init (line 307) | def default_init(cls, *args, **kwargs): class InvalidScoreLogitsProcessor (line 311) | class InvalidScoreLogitsProcessor(LogitsProcessor): method __call__ (line 312) | def __call__(self, input_ids: torch.LongTensor, scores: torch.FloatTen... class PrefixEncoder (line 319) | class PrefixEncoder(torch.nn.Module): method __init__ (line 326) | def __init__(self, config: ChatGLMConfig): method forward (line 342) | def forward(self, prefix: torch.Tensor): function split_tensor_along_last_dim (line 351) | def split_tensor_along_last_dim( class RotaryEmbedding (line 379) | class RotaryEmbedding(nn.Module): method __init__ (line 380) | def __init__(self, dim, original_impl=False, device=None, dtype=None): method forward_impl (line 387) | def forward_impl( method forward (line 412) | def forward(self, max_seq_len, offset=0): function apply_rotary_pos_emb (line 419) | def apply_rotary_pos_emb(x: torch.Tensor, rope_cache: torch.Tensor) -> t... class RMSNorm (line 439) | class RMSNorm(torch.nn.Module): method __init__ (line 440) | def __init__(self, normalized_shape, eps=1e-5, device=None, dtype=None... method forward (line 445) | def forward(self, hidden_states: torch.Tensor): class CoreAttention (line 453) | class CoreAttention(torch.nn.Module): method __init__ (line 454) | def __init__(self, config: ChatGLMConfig, layer_number): method forward (line 479) | def forward(self, query_layer, key_layer, value_layer, attention_mask): class SelfAttention (line 571) | class SelfAttention(torch.nn.Module): method __init__ (line 578) | def __init__(self, config: ChatGLMConfig, layer_number, device=None): method _allocate_memory (line 607) | def _allocate_memory(self, inference_max_sequence_len, batch_size, dev... method forward (line 621) | def forward( function _config_to_kwargs (line 710) | def _config_to_kwargs(args): class MLP (line 717) | class MLP(torch.nn.Module): method __init__ (line 725) | def __init__(self, config: ChatGLMConfig, device=None): method forward (line 754) | def forward(self, hidden_states): class GLMBlock (line 763) | class GLMBlock(torch.nn.Module): method __init__ (line 770) | def __init__(self, config: ChatGLMConfig, layer_number, device=None): method forward (line 794) | def forward( class GLMTransformer (line 837) | class GLMTransformer(torch.nn.Module): method __init__ (line 840) | def __init__(self, config: ChatGLMConfig, device=None): method _get_layer (line 863) | def _get_layer(self, layer_number): method forward (line 866) | def forward( class ChatGLMPreTrainedModel (line 919) | class ChatGLMPreTrainedModel(PreTrainedModel): method _init_weights (line 931) | def _init_weights(self, module: nn.Module): method get_masks (line 935) | def get_masks(self, input_ids, past_key_values, padding_mask=None): method get_position_ids (line 953) | def get_position_ids(self, input_ids, device): method _set_gradient_checkpointing (line 958) | def _set_gradient_checkpointing(self, module, value=False): class Embedding (line 963) | class Embedding(torch.nn.Module): method __init__ (line 966) | def __init__(self, config: ChatGLMConfig, device=None): method forward (line 979) | def forward(self, input_ids): class ChatGLMModel (line 991) | class ChatGLMModel(ChatGLMPreTrainedModel): method __init__ (line 992) | def __init__(self, config: ChatGLMConfig, device=None, empty_init=True): method get_input_embeddings (line 1026) | def get_input_embeddings(self): method get_prompt (line 1029) | def get_prompt(self, batch_size, device, dtype=torch.half): method forward (line 1044) | def forward( method quantize (line 1103) | def quantize(self, weight_bit_width: int): class ChatGLMForConditionalGeneration (line 1109) | class ChatGLMForConditionalGeneration(ChatGLMPreTrainedModel): method __init__ (line 1110) | def __init__(self, config: ChatGLMConfig, empty_init=True, device=None): method _update_model_kwargs_for_generation (line 1121) | def _update_model_kwargs_for_generation( method prepare_inputs_for_generation (line 1152) | def prepare_inputs_for_generation( method forward (line 1178) | def forward( method _reorder_cache (line 1239) | def _reorder_cache( method process_response (line 1257) | def process_response(self, output, history): method chat (line 1279) | def chat(self, tokenizer, query: str, history: List[Tuple[str, str]] =... method stream_chat (line 1301) | def stream_chat(self, tokenizer, query: str, history: List[Tuple[str, ... method stream_generate (line 1342) | def stream_generate( method quantize (line 1449) | def quantize(self, bits: int, empty_init=False, device=None, **kwargs): class ChatGLMForSequenceClassification (line 1468) | class ChatGLMForSequenceClassification(ChatGLMPreTrainedModel): method __init__ (line 1469) | def __init__(self, config: ChatGLMConfig, empty_init=True, device=None): method forward (line 1485) | def forward( FILE: diffsynth/models/lora.py class LoRAFromCivitai (line 15) | class LoRAFromCivitai: method __init__ (line 16) | def __init__(self): method convert_state_dict (line 23) | def convert_state_dict(self, state_dict, lora_prefix="lora_unet_", alp... method convert_state_dict_up_down (line 30) | def convert_state_dict_up_down(self, state_dict, lora_prefix="lora_une... method convert_state_dict_AB (line 53) | def convert_state_dict_AB(self, state_dict, lora_prefix="", alpha=1.0,... method load (line 76) | def load(self, model, state_dict_lora, lora_prefix, alpha=1.0, model_r... method match (line 99) | def match(self, model, state_dict_lora): class SDLoRAFromCivitai (line 125) | class SDLoRAFromCivitai(LoRAFromCivitai): method __init__ (line 126) | def __init__(self): class SDXLLoRAFromCivitai (line 152) | class SDXLLoRAFromCivitai(LoRAFromCivitai): method __init__ (line 153) | def __init__(self): class FluxLoRAFromCivitai (line 181) | class FluxLoRAFromCivitai(LoRAFromCivitai): method __init__ (line 182) | def __init__(self): class GeneralLoRAFromPeft (line 200) | class GeneralLoRAFromPeft: method __init__ (line 201) | def __init__(self): method get_name_dict (line 205) | def get_name_dict(self, lora_state_dict): method match (line 221) | def match(self, model: torch.nn.Module, state_dict_lora): method fetch_device_and_dtype (line 231) | def fetch_device_and_dtype(self, state_dict): method load (line 246) | def load(self, model, state_dict_lora, lora_prefix="", alpha=1.0, mode... class HunyuanVideoLoRAFromCivitai (line 267) | class HunyuanVideoLoRAFromCivitai(LoRAFromCivitai): method __init__ (line 268) | def __init__(self): class FluxLoRAConverter (line 275) | class FluxLoRAConverter: method __init__ (line 276) | def __init__(self): method align_to_opensource_format (line 280) | def align_to_opensource_format(state_dict, alpha=1.0): method align_to_diffsynth_format (line 323) | def align_to_diffsynth_format(state_dict): function get_lora_loaders (line 370) | def get_lora_loaders(): FILE: diffsynth/models/model_manager.py function load_model_from_single_file (line 56) | def load_model_from_single_file(state_dict, model_names, model_classes, ... function load_model_from_huggingface_folder (line 82) | def load_model_from_huggingface_folder(file_path, model_names, model_cla... function load_single_patch_model_from_single_file (line 100) | def load_single_patch_model_from_single_file(state_dict, model_name, mod... function load_patch_model_from_single_file (line 112) | def load_patch_model_from_single_file(state_dict, model_names, model_cla... class ModelDetectorTemplate (line 136) | class ModelDetectorTemplate: method __init__ (line 137) | def __init__(self): method match (line 140) | def match(self, file_path="", state_dict={}): method load (line 143) | def load(self, file_path="", state_dict={}, device="cuda", torch_dtype... class ModelDetectorFromSingleFile (line 148) | class ModelDetectorFromSingleFile: method __init__ (line 149) | def __init__(self, model_loader_configs=[]): method add_model_metadata (line 156) | def add_model_metadata(self, keys_hash, keys_hash_with_shape, model_na... method match (line 162) | def match(self, file_path="", state_dict={}): method load (line 176) | def load(self, file_path="", state_dict={}, device="cuda", torch_dtype... class ModelDetectorFromSplitedSingleFile (line 199) | class ModelDetectorFromSplitedSingleFile(ModelDetectorFromSingleFile): method __init__ (line 200) | def __init__(self, model_loader_configs=[]): method match (line 204) | def match(self, file_path="", state_dict={}): method load (line 216) | def load(self, file_path="", state_dict={}, device="cuda", torch_dtype... class ModelDetectorFromHuggingfaceFolder (line 236) | class ModelDetectorFromHuggingfaceFolder: method __init__ (line 237) | def __init__(self, model_loader_configs=[]): method add_model_metadata (line 243) | def add_model_metadata(self, architecture, huggingface_lib, model_name... method match (line 247) | def match(self, file_path="", state_dict={}): method load (line 260) | def load(self, file_path="", state_dict={}, device="cuda", torch_dtype... class ModelDetectorFromPatchedSingleFile (line 277) | class ModelDetectorFromPatchedSingleFile: method __init__ (line 278) | def __init__(self, model_loader_configs=[]): method add_model_metadata (line 284) | def add_model_metadata(self, keys_hash_with_shape, model_name, model_c... method match (line 288) | def match(self, file_path="", state_dict={}): method load (line 299) | def load(self, file_path="", state_dict={}, device="cuda", torch_dtype... class ModelManager (line 316) | class ModelManager: method __init__ (line 317) | def __init__( method load_model_from_single_file (line 340) | def load_model_from_single_file(self, file_path="", state_dict={}, mod... method load_model_from_huggingface_folder (line 352) | def load_model_from_huggingface_folder(self, file_path="", model_names... method load_patch_model_from_single_file (line 362) | def load_patch_model_from_single_file(self, file_path="", state_dict={... method load_lora (line 373) | def load_lora(self, file_path="", state_dict={}, lora_alpha=1.0): method load_model (line 395) | def load_model(self, file_path, model_names=None, device=None, torch_d... method load_models (line 424) | def load_models(self, file_path_list, model_names=None, device=None, t... method fetch_model (line 429) | def fetch_model(self, model_name, file_path=None, require_model_path=F... method to (line 451) | def to(self, device): FILE: diffsynth/models/omnigen.py class Phi3Transformer (line 20) | class Phi3Transformer(Phi3Model): method prefetch_layer (line 27) | def prefetch_layer(self, layer_idx: int, device: torch.device): method evict_previous_layer (line 34) | def evict_previous_layer(self, layer_idx: int): method get_offlaod_layer (line 40) | def get_offlaod_layer(self, layer_idx: int, device: torch.device): method forward (line 56) | def forward( function modulate (line 191) | def modulate(x, shift, scale): class TimestepEmbedder (line 195) | class TimestepEmbedder(nn.Module): method __init__ (line 199) | def __init__(self, hidden_size, frequency_embedding_size=256): method timestep_embedding (line 209) | def timestep_embedding(t, dim, max_period=10000): method forward (line 229) | def forward(self, t, dtype=torch.float32): class FinalLayer (line 235) | class FinalLayer(nn.Module): method __init__ (line 239) | def __init__(self, hidden_size, patch_size, out_channels): method forward (line 248) | def forward(self, x, c): function get_2d_sincos_pos_embed (line 255) | def get_2d_sincos_pos_embed(embed_dim, grid_size, cls_token=False, extra... function get_2d_sincos_pos_embed_from_grid (line 275) | def get_2d_sincos_pos_embed_from_grid(embed_dim, grid): function get_1d_sincos_pos_embed_from_grid (line 286) | def get_1d_sincos_pos_embed_from_grid(embed_dim, pos): class PatchEmbedMR (line 307) | class PatchEmbedMR(nn.Module): method __init__ (line 310) | def __init__( method forward (line 320) | def forward(self, x): class OmniGenOriginalModel (line 326) | class OmniGenOriginalModel(nn.Module): method __init__ (line 330) | def __init__( method from_pretrained (line 364) | def from_pretrained(cls, model_name): method initialize_weights (line 380) | def initialize_weights(self): method unpatchify (line 413) | def unpatchify(self, x, h, w): method cropped_pos_embed (line 426) | def cropped_pos_embed(self, height, width): method patch_multiple_resolutions (line 451) | def patch_multiple_resolutions(self, latents, padding_latent=None, is_... method forward (line 489) | def forward(self, x, timestep, input_ids, input_img_latents, input_ima... method forward_with_cfg (line 534) | def forward_with_cfg(self, x, timestep, input_ids, input_img_latents, ... method forward_with_separate_cfg (line 550) | def forward_with_separate_cfg(self, x, timestep, input_ids, input_img_... class OmniGenTransformer (line 580) | class OmniGenTransformer(OmniGenOriginalModel): method __init__ (line 581) | def __init__(self): method forward (line 717) | def forward(self, x, timestep, input_ids, input_img_latents, input_ima... method forward_with_separate_cfg (line 760) | def forward_with_separate_cfg(self, x, timestep, input_ids, input_img_... method state_dict_converter (line 790) | def state_dict_converter(): class OmniGenTransformerStateDictConverter (line 795) | class OmniGenTransformerStateDictConverter: method __init__ (line 796) | def __init__(self): method from_diffusers (line 799) | def from_diffusers(self, state_dict): method from_civitai (line 802) | def from_civitai(self, state_dict): FILE: diffsynth/models/sd3_dit.py class RMSNorm (line 8) | class RMSNorm(torch.nn.Module): method __init__ (line 9) | def __init__(self, dim, eps, elementwise_affine=True): method forward (line 17) | def forward(self, hidden_states): class PatchEmbed (line 28) | class PatchEmbed(torch.nn.Module): method __init__ (line 29) | def __init__(self, patch_size=2, in_channels=16, embed_dim=1536, pos_e... method cropped_pos_embed (line 37) | def cropped_pos_embed(self, height, width): method forward (line 45) | def forward(self, latent): class TimestepEmbeddings (line 54) | class TimestepEmbeddings(torch.nn.Module): method __init__ (line 55) | def __init__(self, dim_in, dim_out, computation_device=None): method forward (line 62) | def forward(self, timestep, dtype): class AdaLayerNorm (line 69) | class AdaLayerNorm(torch.nn.Module): method __init__ (line 70) | def __init__(self, dim, single=False, dual=False): method forward (line 77) | def forward(self, x, emb): class JointAttention (line 96) | class JointAttention(torch.nn.Module): method __init__ (line 97) | def __init__(self, dim_a, dim_b, num_heads, head_dim, only_out_a=False... method process_qkv (line 122) | def process_qkv(self, hidden_states, to_qkv, norm_q, norm_k): method forward (line 134) | def forward(self, hidden_states_a, hidden_states_b): class SingleAttention (line 156) | class SingleAttention(torch.nn.Module): method __init__ (line 157) | def __init__(self, dim_a, num_heads, head_dim, use_rms_norm=False): method process_qkv (line 173) | def process_qkv(self, hidden_states, to_qkv, norm_q, norm_k): method forward (line 185) | def forward(self, hidden_states_a): class DualTransformerBlock (line 197) | class DualTransformerBlock(torch.nn.Module): method __init__ (line 198) | def __init__(self, dim, num_attention_heads, use_rms_norm=False): method forward (line 221) | def forward(self, hidden_states_a, hidden_states_b, temb): class JointTransformerBlock (line 243) | class JointTransformerBlock(torch.nn.Module): method __init__ (line 244) | def __init__(self, dim, num_attention_heads, use_rms_norm=False, dual=... method forward (line 268) | def forward(self, hidden_states_a, hidden_states_b, temb): class JointTransformerFinalBlock (line 294) | class JointTransformerFinalBlock(torch.nn.Module): method __init__ (line 295) | def __init__(self, dim, num_attention_heads, use_rms_norm=False): method forward (line 310) | def forward(self, hidden_states_a, hidden_states_b, temb): class SD3DiT (line 326) | class SD3DiT(torch.nn.Module): method __init__ (line 327) | def __init__(self, embed_dim=1536, num_layers=24, use_rms_norm=False, ... method tiled_forward (line 339) | def tiled_forward(self, hidden_states, timestep, prompt_emb, pooled_pr... method forward (line 351) | def forward(self, hidden_states, timestep, prompt_emb, pooled_prompt_e... method state_dict_converter (line 381) | def state_dict_converter(): class SD3DiTStateDictConverter (line 386) | class SD3DiTStateDictConverter: method __init__ (line 387) | def __init__(self): method infer_architecture (line 390) | def infer_architecture(self, state_dict): method from_diffusers (line 408) | def from_diffusers(self, state_dict): method from_civitai (line 472) | def from_civitai(self, state_dict): FILE: diffsynth/models/sd3_text_encoder.py class SD3TextEncoder1 (line 7) | class SD3TextEncoder1(SDTextEncoder): method __init__ (line 8) | def __init__(self, vocab_size=49408): method forward (line 11) | def forward(self, input_ids, clip_skip=2, extra_mask=None): method state_dict_converter (line 26) | def state_dict_converter(): class SD3TextEncoder2 (line 31) | class SD3TextEncoder2(SDXLTextEncoder2): method __init__ (line 32) | def __init__(self): method state_dict_converter (line 36) | def state_dict_converter(): class SD3TextEncoder3 (line 40) | class SD3TextEncoder3(T5EncoderModel): method __init__ (line 41) | def __init__(self): method forward (line 75) | def forward(self, input_ids): method state_dict_converter (line 81) | def state_dict_converter(): class SD3TextEncoder1StateDictConverter (line 86) | class SD3TextEncoder1StateDictConverter: method __init__ (line 87) | def __init__(self): method from_diffusers (line 90) | def from_diffusers(self, state_dict): method from_civitai (line 122) | def from_civitai(self, state_dict): class SD3TextEncoder2StateDictConverter (line 337) | class SD3TextEncoder2StateDictConverter(SDXLTextEncoder2StateDictConvert... method __init__ (line 338) | def __init__(self): method from_diffusers (line 341) | def from_diffusers(self, state_dict): method from_civitai (line 344) | def from_civitai(self, state_dict): class SD3TextEncoder3StateDictConverter (line 880) | class SD3TextEncoder3StateDictConverter(): method __init__ (line 881) | def __init__(self): method from_diffusers (line 884) | def from_diffusers(self, state_dict): method from_civitai (line 888) | def from_civitai(self, state_dict): FILE: diffsynth/models/sd3_vae_decoder.py class SD3VAEDecoder (line 8) | class SD3VAEDecoder(torch.nn.Module): method __init__ (line 9) | def __init__(self): method tiled_forward (line 45) | def tiled_forward(self, sample, tile_size=64, tile_stride=32): method forward (line 56) | def forward(self, sample, tiled=False, tile_size=64, tile_stride=32, *... method state_dict_converter (line 80) | def state_dict_converter(): FILE: diffsynth/models/sd3_vae_encoder.py class SD3VAEEncoder (line 8) | class SD3VAEEncoder(torch.nn.Module): method __init__ (line 9) | def __init__(self): method tiled_forward (line 41) | def tiled_forward(self, sample, tile_size=64, tile_stride=32): method forward (line 52) | def forward(self, sample, tiled=False, tile_size=64, tile_stride=32, *... method encode_video (line 76) | def encode_video(self, sample, batch_size=8): method state_dict_converter (line 94) | def state_dict_converter(): FILE: diffsynth/models/sd_controlnet.py class ControlNetConditioningLayer (line 6) | class ControlNetConditioningLayer(torch.nn.Module): method __init__ (line 7) | def __init__(self, channels = (3, 16, 32, 96, 256, 320)): method forward (line 19) | def forward(self, conditioning): class SDControlNet (line 25) | class SDControlNet(torch.nn.Module): method __init__ (line 26) | def __init__(self, global_pool=False): method forward (line 96) | def forward( method state_dict_converter (line 139) | def state_dict_converter(): class SDControlNetStateDictConverter (line 143) | class SDControlNetStateDictConverter: method __init__ (line 144) | def __init__(self): method from_diffusers (line 147) | def from_diffusers(self, state_dict): method from_civitai (line 236) | def from_civitai(self, state_dict): FILE: diffsynth/models/sd_ipadapter.py class IpAdapterCLIPImageEmbedder (line 7) | class IpAdapterCLIPImageEmbedder(SVDImageEncoder): method __init__ (line 8) | def __init__(self): method forward (line 12) | def forward(self, image): class SDIpAdapter (line 18) | class SDIpAdapter(torch.nn.Module): method __init__ (line 19) | def __init__(self): method set_full_adapter (line 26) | def set_full_adapter(self): method set_less_adapter (line 30) | def set_less_adapter(self): method forward (line 34) | def forward(self, hidden_states, scale=1.0): method state_dict_converter (line 51) | def state_dict_converter(): class SDIpAdapterStateDictConverter (line 55) | class SDIpAdapterStateDictConverter(SDXLIpAdapterStateDictConverter): method __init__ (line 56) | def __init__(self): FILE: diffsynth/models/sd_motion.py class TemporalTransformerBlock (line 6) | class TemporalTransformerBlock(torch.nn.Module): method __init__ (line 8) | def __init__(self, dim, num_attention_heads, attention_head_dim, max_p... method forward (line 27) | def forward(self, hidden_states, batch_size=1): class TemporalBlock (line 52) | class TemporalBlock(torch.nn.Module): method __init__ (line 54) | def __init__(self, num_attention_heads, attention_head_dim, in_channel... method forward (line 72) | def forward(self, hidden_states, time_emb, text_emb, res_stack, batch_... class SDMotionModel (line 94) | class SDMotionModel(torch.nn.Module): method __init__ (line 95) | def __init__(self): method forward (line 144) | def forward(self): method state_dict_converter (line 148) | def state_dict_converter(): class SDMotionModelStateDictConverter (line 152) | class SDMotionModelStateDictConverter: method __init__ (line 153) | def __init__(self): method from_diffusers (line 156) | def from_diffusers(self, state_dict): method from_civitai (line 198) | def from_civitai(self, state_dict): FILE: diffsynth/models/sd_text_encoder.py class CLIPEncoderLayer (line 5) | class CLIPEncoderLayer(torch.nn.Module): method __init__ (line 6) | def __init__(self, embed_dim, intermediate_size, num_heads=12, head_di... method quickGELU (line 16) | def quickGELU(self, x): method forward (line 19) | def forward(self, hidden_states, attn_mask=None): class SDTextEncoder (line 39) | class SDTextEncoder(torch.nn.Module): method __init__ (line 40) | def __init__(self, embed_dim=768, vocab_size=49408, max_position_embed... method attention_mask (line 58) | def attention_mask(self, length): method forward (line 64) | def forward(self, input_ids, clip_skip=1): method state_dict_converter (line 75) | def state_dict_converter(): class SDTextEncoderStateDictConverter (line 79) | class SDTextEncoderStateDictConverter: method __init__ (line 80) | def __init__(self): method from_diffusers (line 83) | def from_diffusers(self, state_dict): method from_civitai (line 115) | def from_civitai(self, state_dict): FILE: diffsynth/models/sd_unet.py class Timesteps (line 6) | class Timesteps(torch.nn.Module): method __init__ (line 7) | def __init__(self, num_channels): method forward (line 11) | def forward(self, timesteps): class GEGLU (line 20) | class GEGLU(torch.nn.Module): method __init__ (line 22) | def __init__(self, dim_in, dim_out): method forward (line 26) | def forward(self, hidden_states): class BasicTransformerBlock (line 31) | class BasicTransformerBlock(torch.nn.Module): method __init__ (line 33) | def __init__(self, dim, num_attention_heads, attention_head_dim, cross... method forward (line 50) | def forward(self, hidden_states, encoder_hidden_states, ipadapter_kwar... class DownSampler (line 70) | class DownSampler(torch.nn.Module): method __init__ (line 71) | def __init__(self, channels, padding=1, extra_padding=False): method forward (line 76) | def forward(self, hidden_states, time_emb, text_emb, res_stack, **kwar... class UpSampler (line 83) | class UpSampler(torch.nn.Module): method __init__ (line 84) | def __init__(self, channels): method forward (line 88) | def forward(self, hidden_states, time_emb, text_emb, res_stack, **kwar... class ResnetBlock (line 94) | class ResnetBlock(torch.nn.Module): method __init__ (line 95) | def __init__(self, in_channels, out_channels, temb_channels=None, grou... method forward (line 108) | def forward(self, hidden_states, time_emb, text_emb, res_stack, **kwar... class AttentionBlock (line 126) | class AttentionBlock(torch.nn.Module): method __init__ (line 128) | def __init__(self, num_attention_heads, attention_head_dim, in_channel... method forward (line 148) | def forward( class PushBlock (line 211) | class PushBlock(torch.nn.Module): method __init__ (line 212) | def __init__(self): method forward (line 215) | def forward(self, hidden_states, time_emb, text_emb, res_stack, **kwar... class PopBlock (line 220) | class PopBlock(torch.nn.Module): method __init__ (line 221) | def __init__(self): method forward (line 224) | def forward(self, hidden_states, time_emb, text_emb, res_stack, **kwar... class SDUNet (line 230) | class SDUNet(torch.nn.Module): method __init__ (line 231) | def __init__(self): method forward (line 324) | def forward(self, sample, timestep, encoder_hidden_states, **kwargs): method state_dict_converter (line 346) | def state_dict_converter(): class SDUNetStateDictConverter (line 350) | class SDUNetStateDictConverter: method __init__ (line 351) | def __init__(self): method from_diffusers (line 354) | def from_diffusers(self, state_dict): method from_civitai (line 412) | def from_civitai(self, state_dict): FILE: diffsynth/models/sd_vae_decoder.py class VAEAttentionBlock (line 7) | class VAEAttentionBlock(torch.nn.Module): method __init__ (line 9) | def __init__(self, num_attention_heads, attention_head_dim, in_channel... method forward (line 27) | def forward(self, hidden_states, time_emb, text_emb, res_stack): class SDVAEDecoder (line 44) | class SDVAEDecoder(torch.nn.Module): method __init__ (line 45) | def __init__(self): method tiled_forward (line 81) | def tiled_forward(self, sample, tile_size=64, tile_stride=32): method forward (line 92) | def forward(self, sample, tiled=False, tile_size=64, tile_stride=32, *... method state_dict_converter (line 120) | def state_dict_converter(): class SDVAEDecoderStateDictConverter (line 124) | class SDVAEDecoderStateDictConverter: method __init__ (line 125) | def __init__(self): method from_diffusers (line 128) | def from_diffusers(self, state_dict): method from_civitai (line 186) | def from_civitai(self, state_dict): FILE: diffsynth/models/sd_vae_encoder.py class SDVAEEncoder (line 8) | class SDVAEEncoder(torch.nn.Module): method __init__ (line 9) | def __init__(self): method tiled_forward (line 41) | def tiled_forward(self, sample, tile_size=64, tile_stride=32): method forward (line 52) | def forward(self, sample, tiled=False, tile_size=64, tile_stride=32, *... method encode_video (line 80) | def encode_video(self, sample, batch_size=8): method state_dict_converter (line 98) | def state_dict_converter(): class SDVAEEncoderStateDictConverter (line 102) | class SDVAEEncoderStateDictConverter: method __init__ (line 103) | def __init__(self): method from_diffusers (line 106) | def from_diffusers(self, state_dict): method from_civitai (line 164) | def from_civitai(self, state_dict): FILE: diffsynth/models/sdxl_controlnet.py class QuickGELU (line 10) | class QuickGELU(torch.nn.Module): method forward (line 12) | def forward(self, x: torch.Tensor): class ResidualAttentionBlock (line 17) | class ResidualAttentionBlock(torch.nn.Module): method __init__ (line 19) | def __init__(self, d_model: int, n_head: int, attn_mask: torch.Tensor ... method attention (line 32) | def attention(self, x: torch.Tensor): method forward (line 36) | def forward(self, x: torch.Tensor): class SDXLControlNetUnion (line 43) | class SDXLControlNetUnion(torch.nn.Module): method __init__ (line 44) | def __init__(self, global_pool=False): method fuse_condition_to_input (line 137) | def fuse_condition_to_input(self, hidden_states, task_id, conditioning): method forward (line 151) | def forward( method state_dict_converter (line 217) | def state_dict_converter(): class SDXLControlNetUnionStateDictConverter (line 222) | class SDXLControlNetUnionStateDictConverter: method __init__ (line 223) | def __init__(self): method from_diffusers (line 226) | def from_diffusers(self, state_dict): method from_civitai (line 317) | def from_civitai(self, state_dict): FILE: diffsynth/models/sdxl_ipadapter.py class IpAdapterXLCLIPImageEmbedder (line 6) | class IpAdapterXLCLIPImageEmbedder(SVDImageEncoder): method __init__ (line 7) | def __init__(self): method forward (line 11) | def forward(self, image): class IpAdapterImageProjModel (line 17) | class IpAdapterImageProjModel(torch.nn.Module): method __init__ (line 18) | def __init__(self, cross_attention_dim=2048, clip_embeddings_dim=1280,... method forward (line 25) | def forward(self, image_embeds): class IpAdapterModule (line 31) | class IpAdapterModule(torch.nn.Module): method __init__ (line 32) | def __init__(self, input_dim, output_dim): method forward (line 37) | def forward(self, hidden_states): class SDXLIpAdapter (line 43) | class SDXLIpAdapter(torch.nn.Module): method __init__ (line 44) | def __init__(self): method set_full_adapter (line 51) | def set_full_adapter(self): method set_less_adapter (line 67) | def set_less_adapter(self): method forward (line 83) | def forward(self, hidden_states, scale=1.0): method state_dict_converter (line 100) | def state_dict_converter(): class SDXLIpAdapterStateDictConverter (line 104) | class SDXLIpAdapterStateDictConverter: method __init__ (line 105) | def __init__(self): method from_diffusers (line 108) | def from_diffusers(self, state_dict): method from_civitai (line 120) | def from_civitai(self, state_dict): FILE: diffsynth/models/sdxl_motion.py class SDXLMotionModel (line 6) | class SDXLMotionModel(torch.nn.Module): method __init__ (line 7) | def __init__(self): method forward (line 49) | def forward(self): method state_dict_converter (line 53) | def state_dict_converter(): class SDMotionModelStateDictConverter (line 57) | class SDMotionModelStateDictConverter: method __init__ (line 58) | def __init__(self): method from_diffusers (line 61) | def from_diffusers(self, state_dict): method from_civitai (line 103) | def from_civitai(self, state_dict): FILE: diffsynth/models/sdxl_text_encoder.py class SDXLTextEncoder (line 5) | class SDXLTextEncoder(torch.nn.Module): method __init__ (line 6) | def __init__(self, embed_dim=768, vocab_size=49408, max_position_embed... method attention_mask (line 24) | def attention_mask(self, length): method forward (line 30) | def forward(self, input_ids, clip_skip=1): method state_dict_converter (line 40) | def state_dict_converter(): class SDXLTextEncoder2 (line 44) | class SDXLTextEncoder2(torch.nn.Module): method __init__ (line 45) | def __init__(self, embed_dim=1280, vocab_size=49408, max_position_embe... method attention_mask (line 66) | def attention_mask(self, length): method forward (line 72) | def forward(self, input_ids, clip_skip=2): method state_dict_converter (line 85) | def state_dict_converter(): class SDXLTextEncoderStateDictConverter (line 89) | class SDXLTextEncoderStateDictConverter: method __init__ (line 90) | def __init__(self): method from_diffusers (line 93) | def from_diffusers(self, state_dict): method from_civitai (line 125) | def from_civitai(self, state_dict): class SDXLTextEncoder2StateDictConverter (line 316) | class SDXLTextEncoder2StateDictConverter: method __init__ (line 317) | def __init__(self): method from_diffusers (line 320) | def from_diffusers(self, state_dict): method from_civitai (line 353) | def from_civitai(self, state_dict): FILE: diffsynth/models/sdxl_unet.py class SDXLUNet (line 5) | class SDXLUNet(torch.nn.Module): method __init__ (line 6) | def __init__(self, is_kolors=False): method forward (line 88) | def forward( method state_dict_converter (line 139) | def state_dict_converter(): class SDXLUNetStateDictConverter (line 143) | class SDXLUNetStateDictConverter: method __init__ (line 144) | def __init__(self): method from_diffusers (line 147) | def from_diffusers(self, state_dict): method from_civitai (line 208) | def from_civitai(self, state_dict): FILE: diffsynth/models/sdxl_vae_decoder.py class SDXLVAEDecoder (line 4) | class SDXLVAEDecoder(SDVAEDecoder): method __init__ (line 5) | def __init__(self, upcast_to_float32=True): method state_dict_converter (line 10) | def state_dict_converter(): class SDXLVAEDecoderStateDictConverter (line 14) | class SDXLVAEDecoderStateDictConverter(SDVAEDecoderStateDictConverter): method __init__ (line 15) | def __init__(self): method from_diffusers (line 18) | def from_diffusers(self, state_dict): method from_civitai (line 22) | def from_civitai(self, state_dict): FILE: diffsynth/models/sdxl_vae_encoder.py class SDXLVAEEncoder (line 4) | class SDXLVAEEncoder(SDVAEEncoder): method __init__ (line 5) | def __init__(self, upcast_to_float32=True): method state_dict_converter (line 10) | def state_dict_converter(): class SDXLVAEEncoderStateDictConverter (line 14) | class SDXLVAEEncoderStateDictConverter(SDVAEEncoderStateDictConverter): method __init__ (line 15) | def __init__(self): method from_diffusers (line 18) | def from_diffusers(self, state_dict): method from_civitai (line 22) | def from_civitai(self, state_dict): FILE: diffsynth/models/stepvideo_dit.py class RMSNorm (line 20) | class RMSNorm(nn.Module): method __init__ (line 21) | def __init__( method _norm (line 47) | def _norm(self, x): method forward (line 60) | def forward(self, x): function get_activation (line 86) | def get_activation(act_fn: str) -> nn.Module: function get_timestep_embedding (line 103) | def get_timestep_embedding( class Timesteps (line 146) | class Timesteps(nn.Module): method __init__ (line 147) | def __init__(self, num_channels: int, flip_sin_to_cos: bool, downscale... method forward (line 153) | def forward(self, timesteps): class TimestepEmbedding (line 163) | class TimestepEmbedding(nn.Module): method __init__ (line 164) | def __init__( method forward (line 210) | def forward(self, sample, condition=None): class PixArtAlphaCombinedTimestepSizeEmbeddings (line 225) | class PixArtAlphaCombinedTimestepSizeEmbeddings(nn.Module): method __init__ (line 226) | def __init__(self, embedding_dim, size_emb_dim, use_additional_conditi... method forward (line 240) | def forward(self, timestep, resolution=None, nframe=None, fps=None): class AdaLayerNormSingle (line 264) | class AdaLayerNormSingle(nn.Module): method __init__ (line 274) | def __init__(self, embedding_dim: int, use_additional_conditions: bool... method forward (line 286) | def forward( class PixArtAlphaTextProjection (line 298) | class PixArtAlphaTextProjection(nn.Module): method __init__ (line 305) | def __init__(self, in_features, hidden_size): method forward (line 319) | def forward(self, caption): class Attention (line 326) | class Attention(nn.Module): method __init__ (line 327) | def __init__(self): method attn_processor (line 330) | def attn_processor(self, attn_type): method torch_attn_func (line 338) | def torch_attn_func( class RoPE1D (line 366) | class RoPE1D: method __init__ (line 367) | def __init__(self, freq=1e4, F0=1.0, scaling_factor=1.0): method get_cos_sin (line 373) | def get_cos_sin(self, D, seq_len, device, dtype): method rotate_half (line 385) | def rotate_half(x): method apply_rope1d (line 389) | def apply_rope1d(self, tokens, pos1d, cos, sin): method __call__ (line 395) | def __call__(self, tokens, positions): class RoPE3D (line 410) | class RoPE3D(RoPE1D): method __init__ (line 411) | def __init__(self, freq=1e4, F0=1.0, scaling_factor=1.0): method get_mesh_3d (line 415) | def get_mesh_3d(self, rope_positions, bsz): method __call__ (line 425) | def __call__(self, tokens, rope_positions, ch_split, parallel=False): class SelfAttention (line 451) | class SelfAttention(Attention): method __init__ (line 452) | def __init__(self, hidden_dim, head_dim, bias=False, with_rope=True, w... method apply_rope3d (line 473) | def apply_rope3d(self, x, fhw_positions, rope_ch_split, parallel=True): method forward (line 477) | def forward( class CrossAttention (line 512) | class CrossAttention(Attention): method __init__ (line 513) | def __init__(self, hidden_dim, head_dim, bias=False, with_qk_norm=True... method forward (line 529) | def forward( class GELU (line 560) | class GELU(nn.Module): method __init__ (line 571) | def __init__(self, dim_in: int, dim_out: int, approximate: str = "none... method gelu (line 576) | def gelu(self, gate: torch.Tensor) -> torch.Tensor: method forward (line 579) | def forward(self, hidden_states): class FeedForward (line 585) | class FeedForward(nn.Module): method __init__ (line 586) | def __init__( method forward (line 604) | def forward(self, hidden_states: torch.Tensor, *args, **kwargs) -> tor... function modulate (line 610) | def modulate(x, scale, shift): function gate (line 615) | def gate(x, gate): class StepVideoTransformerBlock (line 620) | class StepVideoTransformerBlock(nn.Module): method __init__ (line 655) | def __init__( method forward (line 677) | def forward( class PatchEmbed (line 715) | class PatchEmbed(nn.Module): method __init__ (line 718) | def __init__( method forward (line 736) | def forward(self, latent): class StepVideoModel (line 746) | class StepVideoModel(torch.nn.Module): method __init__ (line 747) | def __init__( method patchfy (line 812) | def patchfy(self, hidden_states): method prepare_attn_mask (line 817) | def prepare_attn_mask(self, encoder_attention_mask, encoder_hidden_sta... method block_forward (line 826) | def block_forward( method forward (line 848) | def forward( method state_dict_converter (line 925) | def state_dict_converter(): class StepVideoDiTStateDictConverter (line 929) | class StepVideoDiTStateDictConverter: method __init__ (line 930) | def __init__(self): method from_diffusers (line 933) | def from_diffusers(self, state_dict): method from_civitai (line 936) | def from_civitai(self, state_dict): FILE: diffsynth/models/stepvideo_text_encoder.py class EmptyInitOnDevice (line 30) | class EmptyInitOnDevice(torch.overrides.TorchFunctionMode): method __init__ (line 31) | def __init__(self, device=None): method __torch_function__ (line 34) | def __torch_function__(self, func, types, args=(), kwargs=None): function with_empty_init (line 46) | def with_empty_init(func): class LLaMaEmbedding (line 55) | class LLaMaEmbedding(nn.Module): method __init__ (line 69) | def __init__(self, method forward (line 82) | def forward(self, input_ids): class StepChatTokenizer (line 105) | class StepChatTokenizer: method __init__ (line 108) | def __init__( method vocab (line 166) | def vocab(self): method inv_vocab (line 170) | def inv_vocab(self): method vocab_size (line 174) | def vocab_size(self): method tokenize (line 177) | def tokenize(self, text: str) -> List[int]: method detokenize (line 180) | def detokenize(self, token_ids: List[int]) -> str: class Tokens (line 184) | class Tokens: method __init__ (line 185) | def __init__(self, input_ids, cu_input_ids, attention_mask, cu_seqlens... method to (line 191) | def to(self, device): class Wrapped_StepChatTokenizer (line 198) | class Wrapped_StepChatTokenizer(StepChatTokenizer): method __call__ (line 199) | def __call__(self, text, max_length=320, padding="max_length", truncat... function flash_attn_func (line 245) | def flash_attn_func(q, k, v, dropout_p=0.0, softmax_scale=None, causal=T... class FlashSelfAttention (line 256) | class FlashSelfAttention(torch.nn.Module): method __init__ (line 257) | def __init__( method forward (line 265) | def forward(self, q, k, v, cu_seqlens=None, max_seq_len=None): function safediv (line 275) | def safediv(n, d): class MultiQueryAttention (line 281) | class MultiQueryAttention(nn.Module): method __init__ (line 282) | def __init__(self, cfg, layer_id=None): method forward (line 311) | def forward( class FeedForward (line 373) | class FeedForward(nn.Module): method __init__ (line 374) | def __init__( method forward (line 401) | def forward(self, x): class TransformerBlock (line 408) | class TransformerBlock(nn.Module): method __init__ (line 409) | def __init__( method forward (line 438) | def forward( class Transformer (line 455) | class Transformer(nn.Module): method __init__ (line 456) | def __init__( method _build_layers (line 465) | def _build_layers(self, config): method forward (line 476) | def forward( class Step1Model (line 497) | class Step1Model(PreTrainedModel): method __init__ (line 500) | def __init__( method forward (line 508) | def forward( class STEP1TextEncoder (line 524) | class STEP1TextEncoder(torch.nn.Module): method __init__ (line 525) | def __init__(self, model_dir, max_length=320): method from_pretrained (line 533) | def from_pretrained(path, torch_dtype=torch.bfloat16): method forward (line 538) | def forward(self, prompts, with_mask=True, max_length=None, device="cu... FILE: diffsynth/models/stepvideo_vae.py class BaseGroupNorm (line 21) | class BaseGroupNorm(nn.GroupNorm): method __init__ (line 22) | def __init__(self, num_groups, num_channels): method forward (line 25) | def forward(self, x, zero_pad=False, **kwargs): function base_group_norm (line 32) | def base_group_norm(x, norm_layer, act_silu=False, channel_last=False): function base_conv2d (line 62) | def base_conv2d(x, conv_layer, channel_last=False, residual=None): function base_conv3d (line 74) | def base_conv3d(x, conv_layer, channel_last=False, residual=None, only_r... function cal_outsize (line 90) | def cal_outsize(input_sizes, kernel_sizes, stride, padding): function calc_out_ (line 115) | def calc_out_(in_size, padding, dilation, kernel, stride): function base_conv3d_channel_last (line 120) | def base_conv3d_channel_last(x, conv_layer, residual=None): class Upsample2D (line 160) | class Upsample2D(nn.Module): method __init__ (line 161) | def __init__(self, method forward (line 178) | def forward(self, x, output_size=None): class Downsample2D (line 198) | class Downsample2D(nn.Module): method __init__ (line 199) | def __init__(self, channels, use_conv=False, out_channels=None, paddin... method forward (line 213) | def forward(self, x): class CausalConv (line 226) | class CausalConv(nn.Module): method __init__ (line 227) | def __init__(self, method forward (line 252) | def forward(self, x, is_init=True, residual=None): class ChannelDuplicatingPixelUnshuffleUpSampleLayer3D (line 262) | class ChannelDuplicatingPixelUnshuffleUpSampleLayer3D(nn.Module): method __init__ (line 263) | def __init__( method forward (line 276) | def forward(self, x: torch.Tensor, is_init=True) -> torch.Tensor: class ConvPixelShuffleUpSampleLayer3D (line 284) | class ConvPixelShuffleUpSampleLayer3D(nn.Module): method __init__ (line 285) | def __init__( method forward (line 301) | def forward(self, x: torch.Tensor, is_init=True) -> torch.Tensor: method pixel_shuffle_3d (line 307) | def pixel_shuffle_3d(x: torch.Tensor, factor: int) -> torch.Tensor: class ConvPixelUnshuffleDownSampleLayer3D (line 320) | class ConvPixelUnshuffleDownSampleLayer3D(nn.Module): method __init__ (line 321) | def __init__( method forward (line 338) | def forward(self, x: torch.Tensor, is_init=True) -> torch.Tensor: method pixel_unshuffle_3d (line 344) | def pixel_unshuffle_3d(x: torch.Tensor, factor: int) -> torch.Tensor: class PixelUnshuffleChannelAveragingDownSampleLayer3D (line 353) | class PixelUnshuffleChannelAveragingDownSampleLayer3D(nn.Module): method __init__ (line 354) | def __init__( method forward (line 367) | def forward(self, x: torch.Tensor, is_init=True) -> torch.Tensor: method __init__ (line 378) | def __init__( method forward (line 391) | def forward(self, x: torch.Tensor, is_init=True) -> torch.Tensor: function base_group_norm_with_zero_pad (line 405) | def base_group_norm_with_zero_pad(x, norm_layer, act_silu=True, pad_size... class CausalConvChannelLast (line 414) | class CausalConvChannelLast(CausalConv): method __init__ (line 415) | def __init__(self, method forward (line 427) | def forward(self, x, is_init=True, residual=None): class CausalConvAfterNorm (line 438) | class CausalConvAfterNorm(CausalConv): method __init__ (line 439) | def __init__(self, method forward (line 454) | def forward(self, x, is_init=True, residual=None): class AttnBlock (line 466) | class AttnBlock(nn.Module): method __init__ (line 467) | def __init__(self, method attention (line 478) | def attention(self, x, is_init=True): method forward (line 491) | def forward(self, x): class Resnet3DBlock (line 498) | class Resnet3DBlock(nn.Module): method __init__ (line 499) | def __init__(self, method forward (line 527) | def forward(self, x, temb=None, is_init=True): class Downsample3D (line 544) | class Downsample3D(nn.Module): method __init__ (line 545) | def __init__(self, method forward (line 556) | def forward(self, x, is_init=True): class VideoEncoder (line 563) | class VideoEncoder(nn.Module): method __init__ (line 564) | def __init__(self, method forward (line 626) | def forward(self, x, video_frame_num, is_init=True): class Res3DBlockUpsample (line 676) | class Res3DBlockUpsample(nn.Module): method __init__ (line 677) | def __init__(self, method forward (line 706) | def forward(self, x, is_init=False): class Upsample3D (line 729) | class Upsample3D(nn.Module): method __init__ (line 730) | def __init__(self, method forward (line 742) | def forward(self, x, is_init=True, is_split=True): class VideoDecoder (line 757) | class VideoDecoder(nn.Module): method __init__ (line 758) | def __init__(self, method forward (line 823) | def forward(self, z, is_init=True): function rms_norm (line 871) | def rms_norm(input, normalized_shape, eps=1e-6): class DiagonalGaussianDistribution (line 878) | class DiagonalGaussianDistribution(object): method __init__ (line 879) | def __init__(self, parameters, deterministic=False, rms_norm_mean=Fals... method sample (line 895) | def sample(self, generator=None): class StepVideoVAE (line 908) | class StepVideoVAE(nn.Module): method __init__ (line 909) | def __init__(self, method init_from_ckpt (line 948) | def init_from_ckpt(self, model_path): method load_from_dict (line 959) | def load_from_dict(self, p): method convert_channel_last (line 962) | def convert_channel_last(self): method naive_encode (line 966) | def naive_encode(self, x, is_init_image=True): method encode (line 973) | def encode(self, x): method decode_naive (line 983) | def decode_naive(self, z, is_init=True): method decode_original (line 989) | def decode_original(self, z): method mix (line 1014) | def mix(self, x, smooth_scale = 0.6): method single_decode (line 1025) | def single_decode(self, hidden_states, device): method build_1d_mask (line 1032) | def build_1d_mask(self, length, left_bound, right_bound, border_width): method build_mask (line 1040) | def build_mask(self, data, is_bound, border_width): method tiled_decode (line 1052) | def tiled_decode(self, hidden_states, device, tile_size=(34, 34), tile... method decode (line 1103) | def decode(self, hidden_states, device, tiled=False, tile_size=(34, 34... method state_dict_converter (line 1113) | def state_dict_converter(): class StepVideoVAEStateDictConverter (line 1117) | class StepVideoVAEStateDictConverter: method __init__ (line 1118) | def __init__(self): method from_diffusers (line 1121) | def from_diffusers(self, state_dict): method from_civitai (line 1124) | def from_civitai(self, state_dict): FILE: diffsynth/models/svd_image_encoder.py class CLIPVisionEmbeddings (line 5) | class CLIPVisionEmbeddings(torch.nn.Module): method __init__ (line 6) | def __init__(self, embed_dim=1280, image_size=224, patch_size=14, num_... method forward (line 18) | def forward(self, pixel_values): class SVDImageEncoder (line 27) | class SVDImageEncoder(torch.nn.Module): method __init__ (line 28) | def __init__(self, embed_dim=1280, layer_norm_eps=1e-5, num_encoder_la... method forward (line 38) | def forward(self, pixel_values): method state_dict_converter (line 48) | def state_dict_converter(): class SVDImageEncoderStateDictConverter (line 52) | class SVDImageEncoderStateDictConverter: method __init__ (line 53) | def __init__(self): method from_diffusers (line 56) | def from_diffusers(self, state_dict): method from_civitai (line 94) | def from_civitai(self, state_dict): FILE: diffsynth/models/svd_unet.py class TemporalResnetBlock (line 6) | class TemporalResnetBlock(torch.nn.Module): method __init__ (line 7) | def __init__(self, in_channels, out_channels, temb_channels=None, grou... method forward (line 20) | def forward(self, hidden_states, time_emb, text_emb, res_stack, **kwar... function get_timestep_embedding (line 40) | def get_timestep_embedding( class TemporalTimesteps (line 84) | class TemporalTimesteps(torch.nn.Module): method __init__ (line 85) | def __init__(self, num_channels: int, flip_sin_to_cos: bool, downscale... method forward (line 92) | def forward(self, timesteps): class TrainableTemporalTimesteps (line 103) | class TrainableTemporalTimesteps(torch.nn.Module): method __init__ (line 104) | def __init__(self, num_channels: int, flip_sin_to_cos: bool, downscale... method forward (line 110) | def forward(self, timesteps): class PositionalID (line 115) | class PositionalID(torch.nn.Module): method __init__ (line 116) | def __init__(self, max_id=25, repeat_length=20): method frame_id_to_position_id (line 121) | def frame_id_to_position_id(self, frame_id): method forward (line 132) | def forward(self, num_frames, pivot_frame_id=0): class TemporalAttentionBlock (line 138) | class TemporalAttentionBlock(torch.nn.Module): method __init__ (line 140) | def __init__(self, num_attention_heads, attention_head_dim, in_channel... method forward (line 180) | def forward(self, hidden_states, time_emb, text_emb, res_stack, **kwar... class PopMixBlock (line 217) | class PopMixBlock(torch.nn.Module): method __init__ (line 218) | def __init__(self, in_channels=None): method forward (line 225) | def forward(self, hidden_states, time_emb, text_emb, res_stack, **kwar... class SVDUNet (line 238) | class SVDUNet(torch.nn.Module): method __init__ (line 239) | def __init__(self, add_positional_conv=None): method build_mask (line 316) | def build_mask(self, data, is_bound): method tiled_forward (line 337) | def tiled_forward( method forward (line 373) | def forward(self, sample, timestep, encoder_hidden_states, add_time_id... method state_dict_converter (line 414) | def state_dict_converter(): class SVDUNetStateDictConverter (line 419) | class SVDUNetStateDictConverter: method __init__ (line 420) | def __init__(self): method get_block_name (line 423) | def get_block_name(self, names): method from_diffusers (line 435) | def from_diffusers(self, state_dict): method from_civitai (line 555) | def from_civitai(self, state_dict, add_positional_conv=None): FILE: diffsynth/models/svd_vae_decoder.py class VAEAttentionBlock (line 8) | class VAEAttentionBlock(torch.nn.Module): method __init__ (line 10) | def __init__(self, num_attention_heads, attention_head_dim, in_channel... method forward (line 28) | def forward(self, hidden_states, time_emb, text_emb, res_stack): class TemporalResnetBlock (line 45) | class TemporalResnetBlock(torch.nn.Module): method __init__ (line 47) | def __init__(self, in_channels, out_channels, groups=32, eps=1e-5): method forward (line 56) | def forward(self, hidden_states, time_emb, text_emb, res_stack, **kwar... class SVDVAEDecoder (line 71) | class SVDVAEDecoder(torch.nn.Module): method __init__ (line 72) | def __init__(self): method forward (line 123) | def forward(self, sample): method build_mask (line 144) | def build_mask(self, data, is_bound): method decode_video (line 165) | def decode_video( method state_dict_converter (line 203) | def state_dict_converter(): class SVDVAEDecoderStateDictConverter (line 207) | class SVDVAEDecoderStateDictConverter: method __init__ (line 208) | def __init__(self): method from_diffusers (line 211) | def from_diffusers(self, state_dict): method from_civitai (line 302) | def from_civitai(self, state_dict): FILE: diffsynth/models/svd_vae_encoder.py class SVDVAEEncoder (line 4) | class SVDVAEEncoder(SDVAEEncoder): method __init__ (line 5) | def __init__(self): method state_dict_converter (line 10) | def state_dict_converter(): class SVDVAEEncoderStateDictConverter (line 14) | class SVDVAEEncoderStateDictConverter(SDVAEEncoderStateDictConverter): method __init__ (line 15) | def __init__(self): method from_diffusers (line 18) | def from_diffusers(self, state_dict): method from_civitai (line 21) | def from_civitai(self, state_dict): FILE: diffsynth/models/tiler.py class TileWorker (line 5) | class TileWorker: method __init__ (line 6) | def __init__(self): method mask (line 10) | def mask(self, height, width, border_width): method tile (line 20) | def tile(self, model_input, tile_size, tile_stride, tile_device, tile_... method tiled_inference (line 34) | def tiled_inference(self, forward_fn, model_input, tile_batch_size, in... method io_scale (line 57) | def io_scale(self, model_output, tile_size): method untile (line 64) | def untile(self, model_output, height, width, tile_size, tile_stride, ... method tiled_forward (line 83) | def tiled_forward(self, forward_fn, model_input, tile_size, tile_strid... class FastTileWorker (line 110) | class FastTileWorker: method __init__ (line 111) | def __init__(self): method build_mask (line 115) | def build_mask(self, data, is_bound): method tiled_forward (line 133) | def tiled_forward(self, forward_fn, model_input, tile_size, tile_strid... class TileWorker2Dto3D (line 164) | class TileWorker2Dto3D: method __init__ (line 168) | def __init__(self): method build_mask (line 172) | def build_mask(self, T, H, W, dtype, device, is_bound, border_width): method tiled_forward (line 192) | def tiled_forward( FILE: diffsynth/models/utils.py function init_weights_on_device (line 7) | def init_weights_on_device(device = torch.device("meta"), include_buffer... function load_state_dict_from_folder (line 55) | def load_state_dict_from_folder(file_path, torch_dtype=None): function load_state_dict (line 65) | def load_state_dict(file_path, torch_dtype=None): function load_state_dict_from_safetensors (line 72) | def load_state_dict_from_safetensors(file_path, torch_dtype=None): function load_state_dict_from_bin (line 82) | def load_state_dict_from_bin(file_path, torch_dtype=None): function search_for_embeddings (line 91) | def search_for_embeddings(state_dict): function search_parameter (line 101) | def search_parameter(param, state_dict): function build_rename_dict (line 113) | def build_rename_dict(source_state_dict, target_state_dict, split_qkv=Fa... function search_for_files (line 135) | def search_for_files(folder, extensions): function convert_state_dict_keys_to_single_str (line 148) | def convert_state_dict_keys_to_single_str(state_dict, with_shape=True): function split_state_dict_with_prefix (line 164) | def split_state_dict_with_prefix(state_dict): function hash_state_dict_keys (line 179) | def hash_state_dict_keys(state_dict, with_shape=True): FILE: diffsynth/models/wan_video_dit.py function flash_attention (line 28) | def flash_attention(q: torch.Tensor, k: torch.Tensor, v: torch.Tensor, n... function modulate (line 62) | def modulate(x: torch.Tensor, shift: torch.Tensor, scale: torch.Tensor): function sinusoidal_embedding_1d (line 66) | def sinusoidal_embedding_1d(dim, position): function precompute_freqs_cis_3d (line 73) | def precompute_freqs_cis_3d(dim: int, end: int = 1024, theta: float = 10... function precompute_freqs_cis (line 81) | def precompute_freqs_cis(dim: int, end: int = 1024, theta: float = 10000... function rope_apply (line 90) | def rope_apply(x, freqs, num_heads): class RMSNorm (line 98) | class RMSNorm(nn.Module): method __init__ (line 99) | def __init__(self, dim, eps=1e-5): method norm (line 104) | def norm(self, x): method forward (line 107) | def forward(self, x): class AttentionModule (line 112) | class AttentionModule(nn.Module): method __init__ (line 113) | def __init__(self, num_heads): method forward (line 117) | def forward(self, q, k, v): class SelfAttention (line 122) | class SelfAttention(nn.Module): method __init__ (line 123) | def __init__(self, dim: int, num_heads: int, eps: float = 1e-6): method forward (line 138) | def forward(self, x, freqs): class CrossAttention (line 148) | class CrossAttention(nn.Module): method __init__ (line 149) | def __init__(self, dim: int, num_heads: int, eps: float = 1e-6, has_im... method forward (line 169) | def forward(self, x: torch.Tensor, y: torch.Tensor): class DiTBlock (line 187) | class DiTBlock(nn.Module): method __init__ (line 188) | def __init__(self, has_image_input: bool, dim: int, num_heads: int, ff... method forward (line 204) | def forward(self, x, context, cam_emb, t_mod, freqs, freqs_mvs): class MLP (line 243) | class MLP(torch.nn.Module): method __init__ (line 244) | def __init__(self, in_dim, out_dim): method forward (line 254) | def forward(self, x): class Head (line 258) | class Head(nn.Module): method __init__ (line 259) | def __init__(self, dim: int, out_dim: int, patch_size: Tuple[int, int,... method forward (line 267) | def forward(self, x, t_mod): class WanModel (line 273) | class WanModel(torch.nn.Module): method __init__ (line 274) | def __init__( method patchify (line 319) | def patchify(self, x: torch.Tensor): method unpatchify (line 325) | def unpatchify(self, x: torch.Tensor, grid_size: torch.Tensor): method forward (line 332) | def forward(self, method state_dict_converter (line 396) | def state_dict_converter(): class WanModelStateDictConverter (line 400) | class WanModelStateDictConverter: method __init__ (line 401) | def __init__(self): method from_diffusers (line 404) | def from_diffusers(self, state_dict): method from_civitai (line 481) | def from_civitai(self, state_dict): FILE: diffsynth/models/wan_video_image_encoder.py class SelfAttention (line 14) | class SelfAttention(nn.Module): method __init__ (line 16) | def __init__(self, dim, num_heads, dropout=0.1, eps=1e-5): method forward (line 31) | def forward(self, x, mask): method __init__ (line 236) | def __init__(self, method forward (line 255) | def forward(self, x): class AttentionBlock (line 53) | class AttentionBlock(nn.Module): method __init__ (line 55) | def __init__(self, dim, num_heads, post_norm, dropout=0.1, eps=1e-5): method forward (line 70) | def forward(self, x, mask): method __init__ (line 291) | def __init__(self, method forward (line 323) | def forward(self, x): class XLMRoberta (line 80) | class XLMRoberta(nn.Module): method __init__ (line 85) | def __init__(self, method forward (line 122) | def forward(self, ids): function xlm_roberta_large (line 150) | def xlm_roberta_large(pretrained=False, function pos_interpolate (line 203) | def pos_interpolate(pos, seq_len): class QuickGELU (line 222) | class QuickGELU(nn.Module): method forward (line 224) | def forward(self, x): class LayerNorm (line 228) | class LayerNorm(nn.LayerNorm): method forward (line 230) | def forward(self, x): class SelfAttention (line 234) | class SelfAttention(nn.Module): method __init__ (line 16) | def __init__(self, dim, num_heads, dropout=0.1, eps=1e-5): method forward (line 31) | def forward(self, x, mask): method __init__ (line 236) | def __init__(self, method forward (line 255) | def forward(self, x): class SwiGLU (line 271) | class SwiGLU(nn.Module): method __init__ (line 273) | def __init__(self, dim, mid_dim): method forward (line 283) | def forward(self, x): class AttentionBlock (line 289) | class AttentionBlock(nn.Module): method __init__ (line 55) | def __init__(self, dim, num_heads, post_norm, dropout=0.1, eps=1e-5): method forward (line 70) | def forward(self, x, mask): method __init__ (line 291) | def __init__(self, method forward (line 323) | def forward(self, x): class AttentionPool (line 333) | class AttentionPool(nn.Module): method __init__ (line 335) | def __init__(self, method forward (line 363) | def forward(self, x): class VisionTransformer (line 386) | class VisionTransformer(nn.Module): method __init__ (line 388) | def __init__(self, method forward (line 456) | def forward(self, x, interpolation=False, use_31_block=False): class CLIP (line 481) | class CLIP(nn.Module): method __init__ (line 483) | def __init__(self, method forward (line 571) | def forward(self, imgs, txt_ids): method init_weights (line 582) | def init_weights(self): method param_groups (line 601) | def param_groups(self): class XLMRobertaWithHead (line 617) | class XLMRobertaWithHead(XLMRoberta): method __init__ (line 619) | def __init__(self, **kwargs): method forward (line 629) | def forward(self, ids): class XLMRobertaCLIP (line 642) | class XLMRobertaCLIP(nn.Module): method __init__ (line 644) | def __init__(self, method forward (line 710) | def forward(self, imgs, txt_ids): method param_groups (line 722) | def param_groups(self): function _clip (line 738) | def _clip(pretrained=False, function clip_xlm_roberta_vit_h_14 (line 822) | def clip_xlm_roberta_vit_h_14( class WanImageEncoder (line 852) | class WanImageEncoder(torch.nn.Module): method __init__ (line 854) | def __init__(self): method encode_image (line 864) | def encode_image(self, videos): method state_dict_converter (line 883) | def state_dict_converter(): class WanImageEncoderStateDictConverter (line 887) | class WanImageEncoderStateDictConverter: method __init__ (line 888) | def __init__(self): method from_diffusers (line 891) | def from_diffusers(self, state_dict): method from_civitai (line 894) | def from_civitai(self, state_dict): FILE: diffsynth/models/wan_video_text_encoder.py function fp16_clamp (line 8) | def fp16_clamp(x): class GELU (line 15) | class GELU(nn.Module): method forward (line 17) | def forward(self, x): class T5LayerNorm (line 22) | class T5LayerNorm(nn.Module): method __init__ (line 24) | def __init__(self, dim, eps=1e-6): method forward (line 30) | def forward(self, x): class T5Attention (line 38) | class T5Attention(nn.Module): method __init__ (line 40) | def __init__(self, dim, dim_attn, num_heads, dropout=0.1): method forward (line 55) | def forward(self, x, context=None, mask=None, pos_bias=None): class T5FeedForward (line 92) | class T5FeedForward(nn.Module): method __init__ (line 94) | def __init__(self, dim, dim_ffn, dropout=0.1): method forward (line 105) | def forward(self, x): class T5SelfAttention (line 113) | class T5SelfAttention(nn.Module): method __init__ (line 115) | def __init__(self, method forward (line 139) | def forward(self, x, mask=None, pos_bias=None): class T5RelativeEmbedding (line 147) | class T5RelativeEmbedding(nn.Module): method __init__ (line 149) | def __init__(self, num_buckets, num_heads, bidirectional, max_dist=128): method forward (line 159) | def forward(self, lq, lk): method _relative_position_bucket (line 171) | def _relative_position_bucket(self, rel_pos): function init_weights (line 192) | def init_weights(m): class WanTextEncoder (line 209) | class WanTextEncoder(torch.nn.Module): method __init__ (line 211) | def __init__(self, method forward (line 245) | def forward(self, ids, mask=None): method state_dict_converter (line 257) | def state_dict_converter(): class WanTextEncoderStateDictConverter (line 261) | class WanTextEncoderStateDictConverter: method __init__ (line 262) | def __init__(self): method from_diffusers (line 265) | def from_diffusers(self, state_dict): method from_civitai (line 268) | def from_civitai(self, state_dict): FILE: diffsynth/models/wan_video_vae.py function check_is_instance (line 11) | def check_is_instance(model, module_class): function block_causal_mask (line 19) | def block_causal_mask(x, block_size): class CausalConv3d (line 33) | class CausalConv3d(nn.Conv3d): method __init__ (line 38) | def __init__(self, *args, **kwargs): method forward (line 44) | def forward(self, x, cache_x=None): class RMS_norm (line 55) | class RMS_norm(nn.Module): method __init__ (line 57) | def __init__(self, dim, channel_first=True, images=True, bias=False): method forward (line 67) | def forward(self, x): class Upsample (line 73) | class Upsample(nn.Upsample): method forward (line 75) | def forward(self, x): class Resample (line 82) | class Resample(nn.Module): method __init__ (line 84) | def __init__(self, dim, mode): method forward (line 120) | def forward(self, x, feat_cache=None, feat_idx=[0]): method init_weight (line 176) | def init_weight(self, conv): method init_weight2 (line 187) | def init_weight2(self, conv): class ResidualBlock (line 198) | class ResidualBlock(nn.Module): method __init__ (line 200) | def __init__(self, in_dim, out_dim, dropout=0.0): method forward (line 214) | def forward(self, x, feat_cache=None, feat_idx=[0]): class AttentionBlock (line 235) | class AttentionBlock(nn.Module): method __init__ (line 240) | def __init__(self, dim): method forward (line 252) | def forward(self, x): class Encoder3d (line 276) | class Encoder3d(nn.Module): method __init__ (line 278) | def __init__(self, method forward (line 328) | def forward(self, x, feat_cache=None, feat_idx=[0]): class Decoder3d (line 379) | class Decoder3d(nn.Module): method __init__ (line 381) | def __init__(self, method forward (line 432) | def forward(self, x, feat_cache=None, feat_idx=[0]): function count_conv3d (line 484) | def count_conv3d(model): class VideoVAE_ (line 492) | class VideoVAE_(nn.Module): method __init__ (line 494) | def __init__(self, method forward (line 519) | def forward(self, x): method encode (line 525) | def encode(self, x, scale): method decode (line 552) | def decode(self, z, scale): method reparameterize (line 577) | def reparameterize(self, mu, log_var): method sample (line 582) | def sample(self, imgs, deterministic=False): method clear_cache (line 589) | def clear_cache(self): class WanVideoVAE (line 599) | class WanVideoVAE(nn.Module): method __init__ (line 601) | def __init__(self, z_dim=16): method build_1d_mask (line 621) | def build_1d_mask(self, length, left_bound, right_bound, border_width): method build_mask (line 630) | def build_mask(self, data, is_bound, border_width): method tiled_decode (line 643) | def tiled_decode(self, hidden_states, device, tile_size, tile_stride): method tiled_encode (line 695) | def tiled_encode(self, video, device, tile_size, tile_stride): method single_encode (line 746) | def single_encode(self, video, device): method single_decode (line 752) | def single_decode(self, hidden_state, device): method encode (line 758) | def encode(self, videos, device, tiled=False, tile_size=(34, 34), tile... method decode (line 776) | def decode(self, hidden_states, device, tiled=False, tile_size=(34, 34... method state_dict_converter (line 792) | def state_dict_converter(): class WanVideoVAEStateDictConverter (line 796) | class WanVideoVAEStateDictConverter: method __init__ (line 798) | def __init__(self): method from_civitai (line 801) | def from_civitai(self, state_dict): FILE: diffsynth/pipelines/base.py class BasePipeline (line 8) | class BasePipeline(torch.nn.Module): method __init__ (line 10) | def __init__(self, device="cuda", torch_dtype=torch.float16, height_di... method check_resize_height_width (line 20) | def check_resize_height_width(self, height, width): method preprocess_image (line 30) | def preprocess_image(self, image): method preprocess_images (line 35) | def preprocess_images(self, images): method vae_output_to_image (line 39) | def vae_output_to_image(self, vae_output): method vae_output_to_video (line 45) | def vae_output_to_video(self, vae_output): method merge_latents (line 51) | def merge_latents(self, value, latents, masks, scales, blur_kernel_siz... method control_noise_via_local_prompts (line 66) | def control_noise_via_local_prompts(self, prompt_emb_global, prompt_em... method extend_prompt (line 79) | def extend_prompt(self, prompt, local_prompts, masks, mask_scales): method enable_cpu_offload (line 91) | def enable_cpu_offload(self): method load_models_to_device (line 95) | def load_models_to_device(self, loadmodel_names=[]): method generate_noise (line 124) | def generate_noise(self, shape, seed=None, device="cpu", dtype=torch.f... FILE: diffsynth/pipelines/cog_video.py class CogVideoPipeline (line 13) | class CogVideoPipeline(BasePipeline): method __init__ (line 15) | def __init__(self, device="cuda", torch_dtype=torch.float16): method fetch_models (line 26) | def fetch_models(self, model_manager: ModelManager, prompt_refiner_cla... method from_model_manager (line 36) | def from_model_manager(model_manager: ModelManager, prompt_refiner_cla... method tensor2video (line 45) | def tensor2video(self, frames): method encode_prompt (line 52) | def encode_prompt(self, prompt, positive=True): method prepare_extra_input (line 57) | def prepare_extra_input(self, latents): method __call__ (line 62) | def __call__( FILE: diffsynth/pipelines/dancer.py function lets_dance (line 7) | def lets_dance( function lets_dance_xl (line 119) | def lets_dance_xl( FILE: diffsynth/pipelines/flux_image.py class FluxImagePipeline (line 19) | class FluxImagePipeline(BasePipeline): method __init__ (line 21) | def __init__(self, device="cuda", torch_dtype=torch.float16): method enable_vram_management (line 37) | def enable_vram_management(self, num_persistent_param_in_dit=None): method denoising_model (line 136) | def denoising_model(self): method fetch_models (line 140) | def fetch_models(self, model_manager: ModelManager, controlnet_config_... method from_model_manager (line 167) | def from_model_manager(model_manager: ModelManager, controlnet_config_... method encode_image (line 176) | def encode_image(self, image, tiled=False, tile_size=64, tile_stride=32): method decode_image (line 181) | def decode_image(self, latent, tiled=False, tile_size=64, tile_stride=... method encode_prompt (line 187) | def encode_prompt(self, prompt, positive=True, t5_sequence_length=512): method prepare_extra_input (line 194) | def prepare_extra_input(self, latents=None, guidance=1.0): method apply_controlnet_mask_on_latents (line 200) | def apply_controlnet_mask_on_latents(self, latents, mask): method apply_controlnet_mask_on_image (line 209) | def apply_controlnet_mask_on_image(self, image, mask): method prepare_controlnet_input (line 218) | def prepare_controlnet_input(self, controlnet_image, controlnet_inpain... method prepare_ipadapter_inputs (line 242) | def prepare_ipadapter_inputs(self, images, height=384, width=384): method inpaint_fusion (line 248) | def inpaint_fusion(self, latents, inpaint_latents, pred_noise, fg_mask... method preprocess_masks (line 260) | def preprocess_masks(self, masks, height, width, dim): method prepare_entity_inputs (line 269) | def prepare_entity_inputs(self, entity_prompts, entity_masks, width, h... method prepare_latents (line 283) | def prepare_latents(self, input_image, height, width, seed, tiled, til... method prepare_ipadapter (line 296) | def prepare_ipadapter(self, ipadapter_images, ipadapter_scale): method prepare_controlnet (line 309) | def prepare_controlnet(self, controlnet_image, masks, controlnet_inpai... method prepare_eligen (line 324) | def prepare_eligen(self, prompt_emb_nega, eligen_entity_prompts, elige... method prepare_prompts (line 340) | def prepare_prompts(self, prompt, local_prompts, masks, mask_scales, t... method __call__ (line 353) | def __call__( class TeaCache (line 472) | class TeaCache: method __init__ (line 473) | def __init__(self, num_inference_steps, rel_l1_thresh): method check (line 482) | def check(self, dit: FluxDiT, hidden_states, conditioning): method store (line 506) | def store(self, hidden_states): method update (line 510) | def update(self, hidden_states): function lets_dance_flux (line 515) | def lets_dance_flux( FILE: diffsynth/pipelines/hunyuan_image.py class ImageSizeManager (line 15) | class ImageSizeManager: method __init__ (line 16) | def __init__(self): method _to_tuple (line 20) | def _to_tuple(self, x): method get_fill_resize_and_crop (line 27) | def get_fill_resize_and_crop(self, src, tgt): method get_meshgrid (line 48) | def get_meshgrid(self, start, *args): method get_2d_rotary_pos_embed (line 74) | def get_2d_rotary_pos_embed(self, embed_dim, start, *args, use_real=Tr... method get_2d_rotary_pos_embed_from_grid (line 81) | def get_2d_rotary_pos_embed_from_grid(self, embed_dim, grid, use_real=... method get_1d_rotary_pos_embed (line 97) | def get_1d_rotary_pos_embed(self, dim: int, pos, theta: float = 10000.... method calc_rope (line 112) | def calc_rope(self, height, width): class HunyuanDiTImagePipeline (line 125) | class HunyuanDiTImagePipeline(BasePipeline): method __init__ (line 127) | def __init__(self, device="cuda", torch_dtype=torch.float16): method denoising_model (line 141) | def denoising_model(self): method fetch_models (line 145) | def fetch_models(self, model_manager: ModelManager, prompt_refiner_cla... method from_model_manager (line 157) | def from_model_manager(model_manager: ModelManager, prompt_refiner_cla... method encode_image (line 166) | def encode_image(self, image, tiled=False, tile_size=64, tile_stride=32): method decode_image (line 171) | def decode_image(self, latent, tiled=False, tile_size=64, tile_stride=... method encode_prompt (line 177) | def encode_prompt(self, prompt, clip_skip=1, clip_skip_2=1, positive=T... method prepare_extra_input (line 193) | def prepare_extra_input(self, latents=None, tiled=False, tile_size=64,... method __call__ (line 210) | def __call__( FILE: diffsynth/pipelines/hunyuan_video.py class HunyuanVideoPipeline (line 15) | class HunyuanVideoPipeline(BasePipeline): method __init__ (line 17) | def __init__(self, device="cuda", torch_dtype=torch.float16): method enable_vram_management (line 30) | def enable_vram_management(self): method fetch_models (line 37) | def fetch_models(self, model_manager: ModelManager): method from_model_manager (line 47) | def from_model_manager(model_manager: ModelManager, torch_dtype=None, ... method generate_crop_size_list (line 56) | def generate_crop_size_list(self, base_size=256, patch_size=32, max_ra... method get_closest_ratio (line 71) | def get_closest_ratio(self, height: float, width: float, ratios: list,... method prepare_vae_images_inputs (line 78) | def prepare_vae_images_inputs(self, semantic_images, i2v_resolution="7... method encode_prompt (line 105) | def encode_prompt(self, prompt, positive=True, clip_sequence_length=77... method prepare_extra_input (line 112) | def prepare_extra_input(self, latents=None, guidance=1.0): method tensor2video (line 118) | def tensor2video(self, frames): method encode_video (line 125) | def encode_video(self, frames, tile_size=(17, 30, 30), tile_stride=(12... method __call__ (line 133) | def __call__( class TeaCache (line 251) | class TeaCache: method __init__ (line 252) | def __init__(self, num_inference_steps, rel_l1_thresh): method check (line 261) | def check(self, dit: HunyuanVideoDiT, img, vec): method store (line 287) | def store(self, hidden_states): method update (line 291) | def update(self, hidden_states): function lets_dance_hunyuan_video (line 297) | def lets_dance_hunyuan_video( function lets_dance_hunyuan_video_i2v (line 343) | def lets_dance_hunyuan_video_i2v( FILE: diffsynth/pipelines/omnigen_image.py class OmniGenCache (line 15) | class OmniGenCache(DynamicCache): method __init__ (line 16) | def __init__(self, method prefetch_layer (line 28) | def prefetch_layer(self, layer_idx: int): method evict_previous_layer (line 38) | def evict_previous_layer(self, layer_idx: int): method __getitem__ (line 50) | def __getitem__(self, layer_idx: int) -> List[Tuple[torch.Tensor]]: method update (line 74) | def update( class OmnigenImagePipeline (line 122) | class OmnigenImagePipeline(BasePipeline): method __init__ (line 124) | def __init__(self, device="cuda", torch_dtype=torch.float16): method denoising_model (line 135) | def denoising_model(self): method fetch_models (line 139) | def fetch_models(self, model_manager: ModelManager, prompt_refiner_cla... method from_model_manager (line 148) | def from_model_manager(model_manager: ModelManager, prompt_refiner_cla... method encode_image (line 157) | def encode_image(self, image, tiled=False, tile_size=64, tile_stride=32): method encode_images (line 162) | def encode_images(self, images, tiled=False, tile_size=64, tile_stride... method decode_image (line 167) | def decode_image(self, latent, tiled=False, tile_size=64, tile_stride=... method encode_prompt (line 173) | def encode_prompt(self, prompt, clip_skip=1, positive=True): method prepare_extra_input (line 178) | def prepare_extra_input(self, latents=None): method crop_position_ids_for_cache (line 182) | def crop_position_ids_for_cache(self, position_ids, num_tokens_for_img): method crop_attention_mask_for_cache (line 191) | def crop_attention_mask_for_cache(self, attention_mask, num_tokens_for... method __call__ (line 198) | def __call__( FILE: diffsynth/pipelines/pipeline_runner.py class SDVideoPipelineRunner (line 8) | class SDVideoPipelineRunner: method __init__ (line 9) | def __init__(self, in_streamlit=False): method load_pipeline (line 13) | def load_pipeline(self, model_list, textual_inversion_folder, device, ... method load_smoother (line 35) | def load_smoother(self, model_manager, smoother_configs): method synthesize_video (line 40) | def synthesize_video(self, model_manager, pipe, seed, smoother, **pipe... method load_video (line 53) | def load_video(self, video_file, image_folder, height, width, start_fr... method add_data_to_pipeline_inputs (line 63) | def add_data_to_pipeline_inputs(self, data, pipeline_inputs): method save_output (line 72) | def save_output(self, video, output_folder, fps, config): method run (line 82) | def run(self, config): FILE: diffsynth/pipelines/sd3_image.py class SD3ImagePipeline (line 10) | class SD3ImagePipeline(BasePipeline): method __init__ (line 12) | def __init__(self, device="cuda", torch_dtype=torch.float16): method denoising_model (line 26) | def denoising_model(self): method fetch_models (line 30) | def fetch_models(self, model_manager: ModelManager, prompt_refiner_cla... method from_model_manager (line 42) | def from_model_manager(model_manager: ModelManager, prompt_refiner_cla... method encode_image (line 51) | def encode_image(self, image, tiled=False, tile_size=64, tile_stride=32): method decode_image (line 56) | def decode_image(self, latent, tiled=False, tile_size=64, tile_stride=... method encode_prompt (line 62) | def encode_prompt(self, prompt, positive=True, t5_sequence_length=77): method prepare_extra_input (line 69) | def prepare_extra_input(self, latents=None): method __call__ (line 74) | def __call__( FILE: diffsynth/pipelines/sd_image.py class SDImagePipeline (line 14) | class SDImagePipeline(BasePipeline): method __init__ (line 16) | def __init__(self, device="cuda", torch_dtype=torch.float16): method denoising_model (line 31) | def denoising_model(self): method fetch_models (line 35) | def fetch_models(self, model_manager: ModelManager, controlnet_config_... method from_model_manager (line 61) | def from_model_manager(model_manager: ModelManager, controlnet_config_... method encode_image (line 70) | def encode_image(self, image, tiled=False, tile_size=64, tile_stride=32): method decode_image (line 75) | def decode_image(self, latent, tiled=False, tile_size=64, tile_stride=... method encode_prompt (line 81) | def encode_prompt(self, prompt, clip_skip=1, positive=True): method prepare_extra_input (line 86) | def prepare_extra_input(self, latents=None): method __call__ (line 91) | def __call__( FILE: diffsynth/pipelines/sd_video.py function lets_dance_with_long_video (line 14) | def lets_dance_with_long_video( class SDVideoPipeline (line 68) | class SDVideoPipeline(SDImagePipeline): method __init__ (line 70) | def __init__(self, device="cuda", torch_dtype=torch.float16, use_origi... method fetch_models (line 85) | def fetch_models(self, model_manager: ModelManager, controlnet_config_... method from_model_manager (line 116) | def from_model_manager(model_manager: ModelManager, controlnet_config_... method decode_video (line 125) | def decode_video(self, latents, tiled=False, tile_size=64, tile_stride... method encode_video (line 133) | def encode_video(self, processed_images, tiled=False, tile_size=64, ti... method __call__ (line 144) | def __call__( FILE: diffsynth/pipelines/sdxl_image.py class SDXLImagePipeline (line 16) | class SDXLImagePipeline(BasePipeline): method __init__ (line 18) | def __init__(self, device="cuda", torch_dtype=torch.float16): method denoising_model (line 35) | def denoising_model(self): method fetch_models (line 39) | def fetch_models(self, model_manager: ModelManager, controlnet_config_... method from_model_manager (line 75) | def from_model_manager(model_manager: ModelManager, controlnet_config_... method encode_image (line 84) | def encode_image(self, image, tiled=False, tile_size=64, tile_stride=32): method decode_image (line 89) | def decode_image(self, latent, tiled=False, tile_size=64, tile_stride=... method encode_prompt (line 95) | def encode_prompt(self, prompt, clip_skip=1, clip_skip_2=2, positive=T... method prepare_extra_input (line 105) | def prepare_extra_input(self, latents=None): method __call__ (line 112) | def __call__( FILE: diffsynth/pipelines/sdxl_video.py class SDXLVideoPipeline (line 15) | class SDXLVideoPipeline(SDXLImagePipeline): method __init__ (line 17) | def __init__(self, device="cuda", torch_dtype=torch.float16, use_origi... method fetch_models (line 34) | def fetch_models(self, model_manager: ModelManager, controlnet_config_... method from_model_manager (line 69) | def from_model_manager(model_manager: ModelManager, controlnet_config_... method decode_video (line 78) | def decode_video(self, latents, tiled=False, tile_size=64, tile_stride... method encode_video (line 86) | def encode_video(self, processed_images, tiled=False, tile_size=64, ti... method __call__ (line 97) | def __call__( FILE: diffsynth/pipelines/step_video.py class StepVideoPipeline (line 20) | class StepVideoPipeline(BasePipeline): method __init__ (line 22) | def __init__(self, device="cuda", torch_dtype=torch.float16): method enable_vram_management (line 33) | def enable_vram_management(self, num_persistent_param_in_dit=None): method fetch_models (line 118) | def fetch_models(self, model_manager: ModelManager): method from_model_manager (line 127) | def from_model_manager(model_manager: ModelManager, torch_dtype=None, ... method encode_prompt (line 135) | def encode_prompt(self, prompt, positive=True): method tensor2video (line 143) | def tensor2video(self, frames): method __call__ (line 151) | def __call__( FILE: diffsynth/pipelines/svd_video.py class SVDVideoPipeline (line 12) | class SVDVideoPipeline(BasePipeline): method __init__ (line 14) | def __init__(self, device="cuda", torch_dtype=torch.float16): method fetch_models (line 24) | def fetch_models(self, model_manager: ModelManager): method from_model_manager (line 32) | def from_model_manager(model_manager: ModelManager, **kwargs): method encode_image_with_clip (line 41) | def encode_image_with_clip(self, image): method encode_image_with_vae (line 52) | def encode_image_with_vae(self, image, noise_aug_strength, seed=None): method encode_video_with_vae (line 60) | def encode_video_with_vae(self, video): method tensor2video (line 69) | def tensor2video(self, frames): method calculate_noise_pred (line 76) | def calculate_noise_pred( method post_process_latents (line 102) | def post_process_latents(self, latents, post_normalize=True, contrast_... method __call__ (line 111) | def __call__( class SVDCLIPImageProcessor (line 192) | class SVDCLIPImageProcessor: method __init__ (line 193) | def __init__(self): method resize_with_antialiasing (line 196) | def resize_with_antialiasing(self, input, size, interpolation="bicubic... method _compute_padding (line 225) | def _compute_padding(self, kernel_size): method _filter2d (line 248) | def _filter2d(self, input, kernel): method _gaussian (line 271) | def _gaussian(self, window_size: int, sigma): method _gaussian_blur2d (line 287) | def _gaussian_blur2d(self, input, kernel_size, sigma): FILE: diffsynth/pipelines/wan_video.py class WanVideoPipeline (line 23) | class WanVideoPipeline(BasePipeline): method __init__ (line 25) | def __init__(self, device="cuda", torch_dtype=torch.float16, tokenizer... method enable_vram_management (line 38) | def enable_vram_management(self, num_persistent_param_in_dit=None): method fetch_models (line 126) | def fetch_models(self, model_manager: ModelManager): method from_model_manager (line 138) | def from_model_manager(model_manager: ModelManager, torch_dtype=None, ... method denoising_model (line 146) | def denoising_model(self): method encode_prompt (line 150) | def encode_prompt(self, prompt, positive=True): method encode_image (line 155) | def encode_image(self, image, num_frames, height, width): method tensor2video (line 173) | def tensor2video(self, frames): method prepare_extra_input (line 180) | def prepare_extra_input(self, latents=None): method encode_video (line 184) | def encode_video(self, input_video, tiled=True, tile_size=(34, 34), ti... method decode_video (line 189) | def decode_video(self, latents, tiled=True, tile_size=(34, 34), tile_s... method __call__ (line 195) | def __call__( class TeaCache (line 288) | class TeaCache: method __init__ (line 289) | def __init__(self, num_inference_steps, rel_l1_thresh, model_id): method check (line 309) | def check(self, dit: WanModel, x, t_mod): method store (line 331) | def store(self, hidden_states): method update (line 335) | def update(self, hidden_states): function model_fn_wan_video (line 341) | def model_fn_wan_video( FILE: diffsynth/pipelines/wan_video_syncammaster.py class WanVideoSynCamMasterPipeline (line 23) | class WanVideoSynCamMasterPipeline(BasePipeline): method __init__ (line 25) | def __init__(self, device="cuda", torch_dtype=torch.float16, tokenizer... method enable_vram_management (line 38) | def enable_vram_management(self, num_persistent_param_in_dit=None): method fetch_models (line 126) | def fetch_models(self, model_manager: ModelManager): method from_model_manager (line 138) | def from_model_manager(model_manager: ModelManager, torch_dtype=None, ... method denoising_model (line 146) | def denoising_model(self): method encode_prompt (line 150) | def encode_prompt(self, prompt, positive=True): method encode_image (line 155) | def encode_image(self, image, num_frames, height, width): method tensor2video (line 173) | def tensor2video(self, frames): method prepare_extra_input (line 180) | def prepare_extra_input(self, latents=None): method encode_video (line 184) | def encode_video(self, input_video, tiled=True, tile_size=(34, 34), ti... method decode_video (line 189) | def decode_video(self, latents, tiled=True, tile_size=(34, 34), tile_s... method __call__ (line 195) | def __call__( class TeaCache (line 297) | class TeaCache: method __init__ (line 298) | def __init__(self, num_inference_steps, rel_l1_thresh, model_id): method check (line 318) | def check(self, dit: WanModel, x, t_mod): method store (line 340) | def store(self, hidden_states): method update (line 344) | def update(self, hidden_states): function model_fn_wan_video (line 350) | def model_fn_wan_video( FILE: diffsynth/processors/FastBlend.py class FastBlendSmoother (line 10) | class FastBlendSmoother(VideoProcessor): method __init__ (line 11) | def __init__( method from_model_manager (line 30) | def from_model_manager(model_manager, **kwargs): method inference_fast (line 34) | def inference_fast(self, frames_guide, frames_style): method inference_balanced (line 61) | def inference_balanced(self, frames_guide, frames_style): method inference_accurate (line 98) | def inference_accurate(self, frames_guide, frames_style): method release_vram (line 124) | def release_vram(self): method __call__ (line 130) | def __call__(self, rendered_frames, original_frames=None, **kwargs): FILE: diffsynth/processors/PILEditor.py class ContrastEditor (line 5) | class ContrastEditor(VideoProcessor): method __init__ (line 6) | def __init__(self, rate=1.5): method from_model_manager (line 10) | def from_model_manager(model_manager, **kwargs): method __call__ (line 13) | def __call__(self, rendered_frames, **kwargs): class SharpnessEditor (line 18) | class SharpnessEditor(VideoProcessor): method __init__ (line 19) | def __init__(self, rate=1.5): method from_model_manager (line 23) | def from_model_manager(model_manager, **kwargs): method __call__ (line 26) | def __call__(self, rendered_frames, **kwargs): FILE: diffsynth/processors/RIFE.py class RIFESmoother (line 7) | class RIFESmoother(VideoProcessor): method __init__ (line 8) | def __init__(self, model, device="cuda", scale=1.0, batch_size=4, inte... method from_model_manager (line 21) | def from_model_manager(model_manager, **kwargs): method process_image (line 24) | def process_image(self, image): method process_images (line 33) | def process_images(self, images): method decode_images (line 38) | def decode_images(self, images): method process_tensors (line 43) | def process_tensors(self, input_tensor, scale=1.0, batch_size=4): method __call__ (line 55) | def __call__(self, rendered_frames, **kwargs): FILE: diffsynth/processors/base.py class VideoProcessor (line 1) | class VideoProcessor: method __init__ (line 2) | def __init__(self): method __call__ (line 5) | def __call__(self): FILE: diffsynth/processors/sequencial_processor.py class AutoVideoProcessor (line 4) | class AutoVideoProcessor(VideoProcessor): method __init__ (line 5) | def __init__(self): method from_model_manager (line 9) | def from_model_manager(model_manager, processor_type, **kwargs): class SequencialProcessor (line 26) | class SequencialProcessor(VideoProcessor): method __init__ (line 27) | def __init__(self, processors=[]): method from_model_manager (line 31) | def from_model_manager(model_manager, configs): method __call__ (line 38) | def __call__(self, rendered_frames, **kwargs): FILE: diffsynth/prompters/base_prompter.py function tokenize_long_prompt (line 6) | def tokenize_long_prompt(tokenizer, prompt, max_length=None): class BasePrompter (line 39) | class BasePrompter: method __init__ (line 40) | def __init__(self): method load_prompt_refiners (line 45) | def load_prompt_refiners(self, model_manager: ModelManager, refiner_cl... method load_prompt_extenders (line 50) | def load_prompt_extenders(self,model_manager:ModelManager,extender_cla... method process_prompt (line 57) | def process_prompt(self, prompt, positive=True): method extend_prompt (line 66) | def extend_prompt(self, prompt:str, positive=True): FILE: diffsynth/prompters/cog_prompter.py class CogPrompter (line 7) | class CogPrompter(BasePrompter): method __init__ (line 8) | def __init__( method fetch_models (line 20) | def fetch_models(self, text_encoder: FluxTextEncoder2 = None): method encode_prompt_using_t5 (line 24) | def encode_prompt_using_t5(self, prompt, text_encoder, tokenizer, max_... method encode_prompt (line 38) | def encode_prompt( FILE: diffsynth/prompters/flux_prompter.py class FluxPrompter (line 8) | class FluxPrompter(BasePrompter): method __init__ (line 9) | def __init__( method fetch_models (line 27) | def fetch_models(self, text_encoder_1: SD3TextEncoder1 = None, text_en... method encode_prompt_using_clip (line 32) | def encode_prompt_using_clip(self, prompt, text_encoder, tokenizer, ma... method encode_prompt_using_t5 (line 44) | def encode_prompt_using_t5(self, prompt, text_encoder, tokenizer, max_... method encode_prompt (line 56) | def encode_prompt( FILE: diffsynth/prompters/hunyuan_dit_prompter.py class HunyuanDiTPrompter (line 8) | class HunyuanDiTPrompter(BasePrompter): method __init__ (line 9) | def __init__( method fetch_models (line 29) | def fetch_models(self, text_encoder: HunyuanDiTCLIPTextEncoder = None,... method encode_prompt_using_signle_model (line 34) | def encode_prompt_using_signle_model(self, prompt, text_encoder, token... method encode_prompt (line 53) | def encode_prompt( FILE: diffsynth/prompters/hunyuan_video_prompter.py class HunyuanVideoPrompter (line 70) | class HunyuanVideoPrompter(BasePrompter): method __init__ (line 72) | def __init__( method fetch_models (line 94) | def fetch_models(self, method apply_text_to_template (line 109) | def apply_text_to_template(self, text, template): method encode_prompt_using_clip (line 119) | def encode_prompt_using_clip(self, prompt, max_length, device): method encode_prompt_using_llm (line 132) | def encode_prompt_using_llm(self, method encode_prompt_using_mllm (line 156) | def encode_prompt_using_mllm(self, method encode_prompt (line 236) | def encode_prompt(self, FILE: diffsynth/prompters/kolors_prompter.py class SPTokenizer (line 12) | class SPTokenizer: method __init__ (line 13) | def __init__(self, model_path: str): method tokenize (line 35) | def tokenize(self, s: str, encode_special_tokens=False): method encode (line 50) | def encode(self, s: str, bos: bool = False, eos: bool = False) -> List... method decode (line 59) | def decode(self, t: List[int]) -> str: method decode_tokens (line 73) | def decode_tokens(self, tokens: List[str]) -> str: method convert_token_to_id (line 77) | def convert_token_to_id(self, token): method convert_id_to_token (line 83) | def convert_id_to_token(self, index): class ChatGLMTokenizer (line 93) | class ChatGLMTokenizer(PreTrainedTokenizer): method __init__ (line 98) | def __init__(self, vocab_file, padding_side="left", clean_up_tokenizat... method get_command (line 114) | def get_command(self, token): method unk_token (line 121) | def unk_token(self) -> str: method pad_token (line 125) | def pad_token(self) -> str: method pad_token_id (line 129) | def pad_token_id(self): method eos_token (line 133) | def eos_token(self) -> str: method eos_token_id (line 137) | def eos_token_id(self): method vocab_size (line 141) | def vocab_size(self): method get_vocab (line 144) | def get_vocab(self): method _tokenize (line 150) | def _tokenize(self, text, **kwargs): method _convert_token_to_id (line 153) | def _convert_token_to_id(self, token): method _convert_id_to_token (line 157) | def _convert_id_to_token(self, index): method convert_tokens_to_string (line 161) | def convert_tokens_to_string(self, tokens: List[str]) -> str: method save_vocabulary (line 164) | def save_vocabulary(self, save_directory, filename_prefix=None): method get_prefix_tokens (line 192) | def get_prefix_tokens(self): method build_single_message (line 196) | def build_single_message(self, role, metadata, message): method build_chat_input (line 203) | def build_chat_input(self, query, history=None, role="user"): method build_inputs_with_special_tokens (line 216) | def build_inputs_with_special_tokens( method _pad (line 241) | def _pad( class KolorsPrompter (line 307) | class KolorsPrompter(BasePrompter): method __init__ (line 308) | def __init__( method fetch_models (line 320) | def fetch_models(self, text_encoder: ChatGLMModel = None): method encode_prompt_using_ChatGLM (line 324) | def encode_prompt_using_ChatGLM(self, prompt, text_encoder, tokenizer,... method encode_prompt (line 343) | def encode_prompt( FILE: diffsynth/prompters/omnigen_prompter.py function crop_arr (line 14) | def crop_arr(pil_image, max_image_size): class OmniGenPrompter (line 44) | class OmniGenPrompter: method __init__ (line 45) | def __init__(self, method from_pretrained (line 61) | def from_pretrained(cls, model_name): method process_image (line 72) | def process_image(self, image): method process_multi_modal_prompt (line 75) | def process_multi_modal_prompt(self, text, input_images): method add_prefix_instruction (line 112) | def add_prefix_instruction(self, prompt): method __call__ (line 121) | def __call__(self, class OmniGenCollator (line 172) | class OmniGenCollator: method __init__ (line 173) | def __init__(self, pad_token_id=2, hidden_size=3072): method create_position (line 177) | def create_position(self, attention_mask, num_tokens_for_output_images): method create_mask (line 187) | def create_mask(self, attention_mask, num_tokens_for_output_images): method adjust_attention_for_input_images (line 226) | def adjust_attention_for_input_images(self, attention_mask, image_sizes): method pad_input_ids (line 233) | def pad_input_ids(self, input_ids, image_sizes): method process_mllm_input (line 259) | def process_mllm_input(self, mllm_inputs, target_img_size): method __call__ (line 287) | def __call__(self, features): class OmniGenSeparateCollator (line 314) | class OmniGenSeparateCollator(OmniGenCollator): method __call__ (line 315) | def __call__(self, features): FILE: diffsynth/prompters/omost.py function safe_str (line 95) | def safe_str(x): function closest_name (line 98) | def closest_name(input_str, options): class Canvas (line 110) | class Canvas: method from_bot_response (line 112) | def from_bot_response(response: str): method __init__ (line 124) | def __init__(self): method set_global_description (line 132) | def set_global_description(self, description: str, detailed_descriptio... method add_local_description (line 153) | def add_local_description(self, location: str, offset: str, area: str,... method process (line 198) | def process(self): class OmostPromter (line 235) | class OmostPromter(torch.nn.Module): method __init__ (line 237) | def __init__(self,model = None,tokenizer = None, template = "",device=... method from_model_manager (line 259) | def from_model_manager(model_manager: ModelManager): method __call__ (line 270) | def __call__(self,prompt_dict:dict): FILE: diffsynth/prompters/prompt_refiners.py class BeautifulPrompt (line 6) | class BeautifulPrompt(torch.nn.Module): method __init__ (line 7) | def __init__(self, tokenizer_path=None, model=None, template=""): method from_model_manager (line 15) | def from_model_manager(model_manager: ModelManager): method __call__ (line 32) | def __call__(self, raw_prompt, positive=True, **kwargs): class QwenPrompt (line 57) | class QwenPrompt(torch.nn.Module): method __init__ (line 60) | def __init__(self, tokenizer_path=None, model=None, system_prompt=""): method from_model_manager (line 68) | def from_model_manager(model_nameger: ModelManager): method __call__ (line 79) | def __call__(self, raw_prompt, positive=True, **kwargs): class Translator (line 111) | class Translator(torch.nn.Module): method __init__ (line 112) | def __init__(self, tokenizer_path=None, model=None): method from_model_manager (line 119) | def from_model_manager(model_manager: ModelManager): method __call__ (line 125) | def __call__(self, prompt, **kwargs): FILE: diffsynth/prompters/sd3_prompter.py class SD3Prompter (line 8) | class SD3Prompter(BasePrompter): method __init__ (line 9) | def __init__( method fetch_models (line 33) | def fetch_models(self, text_encoder_1: SD3TextEncoder1 = None, text_en... method encode_prompt_using_clip (line 39) | def encode_prompt_using_clip(self, prompt, text_encoder, tokenizer, ma... method encode_prompt_using_t5 (line 51) | def encode_prompt_using_t5(self, prompt, text_encoder, tokenizer, max_... method encode_prompt (line 66) | def encode_prompt( FILE: diffsynth/prompters/sd_prompter.py class SDPrompter (line 9) | class SDPrompter(BasePrompter): method __init__ (line 10) | def __init__(self, tokenizer_path=None): method fetch_models (line 21) | def fetch_models(self, text_encoder: SDTextEncoder = None): method add_textual_inversions_to_model (line 25) | def add_textual_inversions_to_model(self, textual_inversion_dict, text... method add_textual_inversions_to_tokenizer (line 39) | def add_textual_inversions_to_tokenizer(self, textual_inversion_dict, ... method load_textual_inversions (line 48) | def load_textual_inversions(self, model_paths): method encode_prompt (line 63) | def encode_prompt(self, prompt, clip_skip=1, device="cuda", positive=T... FILE: diffsynth/prompters/sdxl_prompter.py class SDXLPrompter (line 9) | class SDXLPrompter(BasePrompter): method __init__ (line 10) | def __init__( method fetch_models (line 28) | def fetch_models(self, text_encoder: SDXLTextEncoder = None, text_enco... method encode_prompt (line 33) | def encode_prompt( FILE: diffsynth/prompters/stepvideo_prompter.py class StepVideoPrompter (line 8) | class StepVideoPrompter(BasePrompter): method __init__ (line 10) | def __init__( method fetch_models (line 21) | def fetch_models(self, text_encoder_1: HunyuanDiTCLIPTextEncoder = Non... method encode_prompt_using_clip (line 25) | def encode_prompt_using_clip(self, prompt, max_length, device): method encode_prompt_using_llm (line 40) | def encode_prompt_using_llm(self, prompt, max_length, device): method encode_prompt (line 44) | def encode_prompt(self, FILE: diffsynth/prompters/wan_prompter.py function basic_clean (line 11) | def basic_clean(text): function whitespace_clean (line 17) | def whitespace_clean(text): function canonicalize (line 23) | def canonicalize(text, keep_punctuation_exact_string=None): class HuggingfaceTokenizer (line 36) | class HuggingfaceTokenizer: method __init__ (line 38) | def __init__(self, name, seq_len=None, clean=None, **kwargs): method __call__ (line 48) | def __call__(self, sequence, **kwargs): method _clean (line 74) | def _clean(self, text): class WanPrompter (line 84) | class WanPrompter(BasePrompter): method __init__ (line 86) | def __init__(self, tokenizer_path=None, text_len=512): method fetch_tokenizer (line 92) | def fetch_tokenizer(self, tokenizer_path=None): method fetch_models (line 96) | def fetch_models(self, text_encoder: WanTextEncoder = None): method encode_prompt (line 99) | def encode_prompt(self, prompt, positive=True, device="cuda"): FILE: diffsynth/schedulers/continuous_ode.py class ContinuousODEScheduler (line 4) | class ContinuousODEScheduler(): method __init__ (line 6) | def __init__(self, num_inference_steps=100, sigma_max=700.0, sigma_min... method set_timesteps (line 13) | def set_timesteps(self, num_inference_steps=100, denoising_strength=1.... method step (line 21) | def step(self, model_output, timestep, sample, to_final=False): method return_to_timestep (line 36) | def return_to_timestep(self, timestep, sample, sample_stablized): method add_noise (line 41) | def add_noise(self, original_samples, noise, timestep): method training_target (line 48) | def training_target(self, sample, noise, timestep): method training_weight (line 55) | def training_weight(self, timestep): FILE: diffsynth/schedulers/ddim.py class EnhancedDDIMScheduler (line 4) | class EnhancedDDIMScheduler(): method __init__ (line 6) | def __init__(self, num_train_timesteps=1000, beta_start=0.00085, beta_... method rescale_zero_terminal_snr (line 22) | def rescale_zero_terminal_snr(self, alphas_cumprod): method set_timesteps (line 41) | def set_timesteps(self, num_inference_steps, denoising_strength=1.0, *... method denoise (line 53) | def denoise(self, model_output, sample, alpha_prod_t, alpha_prod_t_prev): method step (line 67) | def step(self, model_output, timestep, sample, to_final=False): method return_to_timestep (line 81) | def return_to_timestep(self, timestep, sample, sample_stablized): method add_noise (line 87) | def add_noise(self, original_samples, noise, timestep): method training_target (line 94) | def training_target(self, sample, noise, timestep): method training_weight (line 104) | def training_weight(self, timestep): FILE: diffsynth/schedulers/flow_match.py class FlowMatchScheduler (line 5) | class FlowMatchScheduler(): method __init__ (line 7) | def __init__(self, num_inference_steps=100, num_train_timesteps=1000, ... method set_timesteps (line 18) | def set_timesteps(self, num_inference_steps=100, denoising_strength=1.... method step (line 40) | def step(self, model_output, timestep, sample, to_final=False, **kwargs): method return_to_timestep (line 53) | def return_to_timestep(self, timestep, sample, sample_stablized): method add_noise (line 62) | def add_noise(self, original_samples, noise, timestep): method training_target (line 71) | def training_target(self, sample, noise, timestep): method training_weight (line 76) | def training_weight(self, timestep): FILE: diffsynth/trainers/text_to_image.py class LightningModelForT2ILoRA (line 10) | class LightningModelForT2ILoRA(pl.LightningModule): method __init__ (line 11) | def __init__( method load_models (line 25) | def load_models(self): method freeze_parameters (line 30) | def freeze_parameters(self): method add_lora_to_model (line 37) | def add_lora_to_model(self, model, lora_rank=4, lora_alpha=4, lora_tar... method training_step (line 67) | def training_step(self, batch, batch_idx): method configure_optimizers (line 98) | def configure_optimizers(self): method on_save_checkpoint (line 104) | def on_save_checkpoint(self, checkpoint): function add_general_parsers (line 119) | def add_general_parsers(parser): function launch_training_task (line 267) | def launch_training_task(model, args): FILE: diffsynth/vram_management/layers.py function cast_to (line 5) | def cast_to(weight, dtype, device): class AutoWrappedModule (line 11) | class AutoWrappedModule(torch.nn.Module): method __init__ (line 12) | def __init__(self, module: torch.nn.Module, offload_dtype, offload_dev... method offload (line 23) | def offload(self): method onload (line 28) | def onload(self): method forward (line 33) | def forward(self, *args, **kwargs): class AutoWrappedLinear (line 41) | class AutoWrappedLinear(torch.nn.Linear): method __init__ (line 42) | def __init__(self, module: torch.nn.Linear, offload_dtype, offload_dev... method offload (line 55) | def offload(self): method onload (line 60) | def onload(self): method forward (line 65) | def forward(self, x, *args, **kwargs): function enable_vram_management_recursively (line 74) | def enable_vram_management_recursively(model: torch.nn.Module, module_ma... function enable_vram_management (line 92) | def enable_vram_management(model: torch.nn.Module, module_map: dict, mod... FILE: inference_syncammaster.py class Camera (line 16) | class Camera(object): method __init__ (line 17) | def __init__(self, c2w): class TextCameraDataset (line 22) | class TextCameraDataset(torch.utils.data.Dataset): method __init__ (line 23) | def __init__(self, base_path, metadata_path, args, max_num_frames=81, ... method crop_and_resize (line 44) | def crop_and_resize(self, image): method load_frames_using_imageio (line 55) | def load_frames_using_imageio(self, file_path, max_num_frames, start_f... method is_image (line 82) | def is_image(self, file_path): method load_video (line 89) | def load_video(self, file_path): method parse_matrix (line 95) | def parse_matrix(self, matrix_str): method get_relative_pose (line 104) | def get_relative_pose(self, cam_params): method __getitem__ (line 121) | def __getitem__(self, data_id): method __len__ (line 163) | def __len__(self): function parse_args (line 166) | def parse_args(): FILE: train_syncammaster.py class TextVideoDataset (line 21) | class TextVideoDataset(torch.utils.data.Dataset): method __init__ (line 22) | def __init__(self, base_path, metadata_path, max_num_frames=81, frame_... method crop_and_resize (line 42) | def crop_and_resize(self, image): method load_frames_using_imageio (line 53) | def load_frames_using_imageio(self, file_path, max_num_frames, start_f... method load_video (line 80) | def load_video(self, file_path): method is_image (line 86) | def is_image(self, file_path): method load_image (line 93) | def load_image(self, file_path): method __getitem__ (line 102) | def __getitem__(self, data_id): method __len__ (line 124) | def __len__(self): class LightningModelForDataProcess (line 129) | class LightningModelForDataProcess(pl.LightningModule): method __init__ (line 130) | def __init__(self, text_encoder_path, vae_path, image_encoder_path=Non... method test_step (line 141) | def test_step(self, batch, batch_idx): class Camera (line 165) | class Camera(object): method __init__ (line 166) | def __init__(self, c2w): class TensorDataset (line 173) | class TensorDataset(torch.utils.data.Dataset): method __init__ (line 174) | def __init__(self, base_path, metadata_path, steps_per_epoch): method parse_matrix (line 184) | def parse_matrix(self, matrix_str): method get_relative_pose (line 193) | def get_relative_pose(self, cam_params): method __getitem__ (line 208) | def __getitem__(self, index): method __len__ (line 266) | def __len__(self): class LightningModelForTrain (line 271) | class LightningModelForTrain(pl.LightningModule): method __init__ (line 272) | def __init__( method freeze_parameters (line 327) | def freeze_parameters(self): method training_step (line 334) | def training_step(self, batch, batch_idx): method configure_optimizers (line 373) | def configure_optimizers(self): method on_save_checkpoint (line 379) | def on_save_checkpoint(self, checkpoint): function parse_args (line 393) | def parse_args(): function data_process (line 561) | def data_process(args): function train (line 594) | def train(args): FILE: vis_cam.py class CameraPoseVisualizer (line 9) | class CameraPoseVisualizer: method __init__ (line 10) | def __init__(self, xlim, ylim, zlim): method extrinsic2pyramid (line 23) | def extrinsic2pyramid(self, extrinsic, color_map='red', hw_ratio=9/16,... method customize_legend (line 41) | def customize_legend(self, list_label): method colorbar (line 49) | def colorbar(self, max_frame_length): method show (line 54) | def show(self): function get_args (line 60) | def get_args(): function get_c2w (line 74) | def get_c2w(w2cs, transform_matrix, relative_c2w=True): function parse_matrix (line 89) | def parse_matrix(matrix_str):