Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/cswry/VOSR
/ functions
Functions
180 in github.com/cswry/VOSR
⨍
Functions
180
◇
Types & classes
33
↓ 21 callers
Method
interpolate
(self, cond, uncond, alpha, interp_type='linear')
vosr.py:63
↓ 13 callers
Method
encode
(self, x: torch.Tensor, return_dict: bool = True)
models/qwenimage_vae2d.py:311
↓ 8 callers
Method
__init__
(self, dim: int, channel_first: bool = True, bias: bool = False)
models/qwenimage_vae2d.py:22
↓ 8 callers
Method
decode
(self, z: torch.Tensor, return_dict: bool = True)
models/qwenimage_vae2d.py:319
↓ 5 callers
Method
__init__
( self, dim: int, num_heads: int = 8, qkv_bias: bool = False, qk_norm:
models/lightningdit.py:112
↓ 4 callers
Method
__init__
Initialize the RMSNorm normalization layer. Args: dim (int): The dimension of the input tensor. eps (float,
models/rmsnorm.py:35
↓ 4 callers
Method
sample_multistep_fm
(self, model, lq, venc_fea=None, n_steps: int = 25, schedule: str = "linear")
vosr.py:301
↓ 3 callers
Function
_decode_latent
(vae, sr_latent, args, latents_mean, latents_std, light_decoder=None)
inference_vosr.py:182
↓ 3 callers
Function
_decode_latent
(vae, sr_latent, args, latents_mean, latents_std, light_decoder=None)
inference_vosr_onestep.py:182
↓ 3 callers
Function
_zero_like
Create zero tensor(s) matching x, which can be Tensor or list of Tensors.
vosr.py:17
↓ 3 callers
Function
broadcat
(tensors, dim = -1)
models/pos_embed.py:20
↓ 3 callers
Function
get_venc_features
(venc, lq_tensor, args)
inference_vosr.py:162
↓ 3 callers
Function
get_venc_features
(venc, lq_tensor, args)
inference_vosr_onestep.py:162
↓ 3 callers
Function
rotate_half
(x)
models/pos_embed.py:38
↓ 2 callers
Function
_encode_latent
(vae, x, args, device)
inference_vosr.py:173
↓ 2 callers
Function
_encode_latent
(vae, x, args, device)
inference_vosr_onestep.py:173
↓ 2 callers
Function
_make_tile_grid
Return sorted, deduplicated starting positions that cover *length*.
inference_vosr.py:203
↓ 2 callers
Function
_make_tile_grid
Return sorted, deduplicated starting positions that cover *length*.
inference_vosr_onestep.py:203
↓ 2 callers
Method
_prepare_cfg_conditions_distill
Same as _prepare_cfg_conditions but uses args.weak_cond_strength_aelq (scalar) for distill losses.
vosr.py:103
↓ 2 callers
Function
_set_indices
x[indices] = src[indices] for Tensor or list of Tensors.
vosr.py:24
↓ 2 callers
Method
_teacher_target
Compute teacher/self-distill target v with CFG.
vosr.py:123
↓ 2 callers
Function
build_webdataset_pipeline
(args, split='train')
dataloaders/realsr_dataset.py:178
↓ 2 callers
Method
degrade_process
img_gt: GPU Tensor of shape (B, C, H, W) in [0, 1].
dataloaders/realesrgan_gpu.py:195
↓ 2 callers
Function
get_1d_sincos_pos_embed_from_grid
embed_dim: output dimension for each position pos: a list of positions to be encoded: size (M,) out: (M, D)
models/lightningdit.py:665
↓ 2 callers
Function
load_model_weights_with_interpolation
(accelerator, target_model, state_dict, model_name="model")
train_vosr_distill.py:51
↓ 2 callers
Function
modulate_adasin
(x, shift, scale)
models/lightningdit.py:98
↓ 2 callers
Function
preprocess_raw_image
(x, args)
train_vosr.py:292
↓ 2 callers
Function
preprocess_raw_image
(x, args)
train_vosr_distill.py:308
↓ 2 callers
Function
repeat_kv
torch.repeat_interleave(x, dim=2, repeats=n_rep)
models/rmsnorm.py:164
↓ 2 callers
Function
requires_grad
Set requires_grad flag for all parameters in a model.
train_vosr_distill.py:215
↓ 2 callers
Method
sample_onestep
(self, model, lq, venc_fea=None, n_steps: int = 8, schedule: str = "linear")
vosr.py:279
↓ 2 callers
Method
sample_t_r_v1
(self, B, device)
vosr.py:69
↓ 2 callers
Function
stopgrad
(x)
vosr.py:13
↓ 2 callers
Method
unpatchify
x: (N, T, patch_size**2 * C) imgs: (N, H, W, C)
models/lightningdit.py:464
↓ 1 callers
Method
__init__
( self, dim, pt_seq_len, ft_seq_len=None, custom_freqs = None,
models/pos_embed.py:47
↓ 1 callers
Method
__init__
( self, in_features: int, hidden_features: Optional[int] = None, out_features:
models/swiglu_ffn.py:16
↓ 1 callers
Function
_beta_ratio
(size, alpha: float, beta: float, device="cpu")
vosr.py:9
↓ 1 callers
Function
_clear_stale_distributed_env
()
inference_vosr.py:110
↓ 1 callers
Function
_clear_stale_distributed_env
()
inference_vosr_onestep.py:110
↓ 1 callers
Function
_gaussian_weights
2-D Gaussian blend mask (1, C, tile_h, tile_w) peaked at the centre.
inference_vosr.py:191
↓ 1 callers
Function
_gaussian_weights
2-D Gaussian blend mask (1, C, tile_h, tile_w) peaked at the centre.
inference_vosr_onestep.py:191
↓ 1 callers
Method
_get_dynamic_rope
Dynamically generate RoPE for variable-size inputs. Args: hw_seq_len: patch grid side length (H // patch_size)
models/lightningdit.py:523
↓ 1 callers
Function
_inference_accelerator_stub
()
inference_vosr.py:119
↓ 1 callers
Function
_inference_accelerator_stub
()
inference_vosr_onestep.py:119
↓ 1 callers
Method
_load_rgb
(self, path)
dataloaders/realsr_dataset.py:98
↓ 1 callers
Method
_norm
Apply the RMSNorm normalization to the input tensor. Args: x (torch.Tensor): The input tensor. Returns:
models/rmsnorm.py:52
↓ 1 callers
Method
_prepare_cfg_conditions
Prepare lq_weak/lq_noised/lq_mixed and z_weak/z_noised/z_mixed for CFG training. Fixed: use_aelq=True, use_venc=True, weak_cond_strength_venc=
vosr.py:77
↓ 1 callers
Method
_rcgm_consistency
Compute RCGM consistency loss.
vosr.py:206
↓ 1 callers
Function
_resolve_ckpt_dir
Given a weight file like .../checkpoint-00010000/clean_weights/ema_model.safetensors, walk up to find the checkpoint-XXXXXXXX directory and p
train_vosr.py:88
↓ 1 callers
Function
_resolve_ckpt_dir
Given a weight file like .../checkpoint-00010000/clean_weights/ema_model.safetensors, walk up to find the checkpoint-XXXXXXXX directory and p
train_vosr_distill.py:87
↓ 1 callers
Function
adain_color_fix
(target, source)
inference_vosr.py:59
↓ 1 callers
Function
adain_color_fix
(target, source)
inference_vosr_onestep.py:59
↓ 1 callers
Function
all_expected_outputs_exist
(image_paths, out_dirs)
inference_vosr.py:48
↓ 1 callers
Function
all_expected_outputs_exist
(image_paths, out_dirs)
inference_vosr_onestep.py:48
↓ 1 callers
Function
apply_rotary_emb
Apply rotary embeddings to input tensors using the given frequency tensor. This function applies rotary embeddings to the given query 'xq' a
models/rmsnorm.py:132
↓ 1 callers
Method
color_jitter_pt
(self, img, brightness, contrast, saturation, hue)
dataloaders/realesrgan_gpu.py:92
↓ 1 callers
Function
create_logger
Create a logger that writes to a log file and stdout.
train_vosr.py:221
↓ 1 callers
Function
create_logger
Create a logger that writes to a log file and stdout.
train_vosr_distill.py:236
↓ 1 callers
Function
find_latest_checkpoint
Resolve checkpoint path and parse global step. - If args.resume_ckpt is a .safetensors / .pth file, trace up to find the checkpoint-XXX
train_vosr.py:107
↓ 1 callers
Function
find_latest_checkpoint
Resolve checkpoint path and parse global step. - If args.resume_ckpt is a .safetensors / .pth file, trace up to find the checkpoint-XXX
train_vosr_distill.py:106
↓ 1 callers
Function
get_2d_sincos_pos_embed_from_grid
(embed_dim, grid)
models/lightningdit.py:654
↓ 1 callers
Method
initialize_weights
(self)
models/lightningdit.py:427
↓ 1 callers
Function
list_lq_images
(input_path)
inference_vosr.py:35
↓ 1 callers
Function
list_lq_images
(input_path)
inference_vosr_onestep.py:35
↓ 1 callers
Function
load_config
(config_path)
train_vosr.py:299
↓ 1 callers
Function
load_config
(config_path)
train_vosr_distill.py:315
↓ 1 callers
Function
load_config_with_cli
(ckpt_path, parser)
inference_vosr.py:84
↓ 1 callers
Function
load_config_with_cli
(ckpt_path, parser)
inference_vosr_onestep.py:84
↓ 1 callers
Function
load_dataset_config
(path)
train_vosr.py:305
↓ 1 callers
Function
load_dataset_config
(path)
train_vosr_distill.py:321
↓ 1 callers
Function
load_dinov2
(args, device)
inference_vosr.py:132
↓ 1 callers
Function
load_dinov2
(args, device)
train_vosr.py:250
↓ 1 callers
Function
load_dinov2
(args, device)
inference_vosr_onestep.py:132
↓ 1 callers
Function
load_dinov2
(args, device)
train_vosr_distill.py:266
↓ 1 callers
Function
load_model_weights_with_interpolation
(accelerator, target_model, state_dict, model_name="model")
train_vosr.py:52
↓ 1 callers
Method
loss_fm
(self, model, lq, hq, z=None, weight_dtype=None)
vosr.py:141
↓ 1 callers
Method
loss_fm_distill_rcgm_improved
(self, model, lq, hq, z=None, model_tea=None)
vosr.py:245
↓ 1 callers
Method
loss_fm_distill_shortcut_improved
(self, model, lq, hq, z=None, model_tea=None)
vosr.py:168
↓ 1 callers
Function
main
()
inference_vosr.py:338
↓ 1 callers
Function
main
(config_path)
train_vosr.py:325
↓ 1 callers
Function
main
()
inference_vosr_onestep.py:334
↓ 1 callers
Function
main
(config_path)
train_vosr_distill.py:341
↓ 1 callers
Function
modulate
(x, shift, scale)
models/lightningdit.py:103
↓ 1 callers
Function
normalize_report_to
(report_to)
train_vosr.py:178
↓ 1 callers
Function
normalize_report_to
(report_to)
train_vosr_distill.py:179
↓ 1 callers
Function
opt_parse
(opt_path)
dataloaders/realesrgan_gpu.py:46
↓ 1 callers
Function
ordered_yaml
Support OrderedDict for yaml. Returns: yaml Loader and Dumper.
dataloaders/realesrgan_gpu.py:22
↓ 1 callers
Function
precompute_freqs_cis
Precompute the frequency tensor for complex exponentials (cis) with given dimensions. This function calculates a frequency tensor with compl
models/rmsnorm.py:80
↓ 1 callers
Function
preprocess_raw_image
(x, args)
inference_vosr.py:125
↓ 1 callers
Function
preprocess_raw_image
(x, args)
inference_vosr_onestep.py:125
↓ 1 callers
Method
random_kernels
(self)
dataloaders/realesrgan_gpu.py:133
↓ 1 callers
Function
report_to_wandb
(report_to)
train_vosr.py:189
↓ 1 callers
Function
report_to_wandb
(report_to)
train_vosr_distill.py:190
↓ 1 callers
Function
requires_grad
Set requires_grad flag for all parameters in a model.
train_vosr.py:214
↓ 1 callers
Function
reshape_for_broadcast
Reshape frequency tensor for broadcasting it with another tensor. This function reshapes the frequency tensor to have the same shape as the
models/rmsnorm.py:107
↓ 1 callers
Function
tiled_latent_inference
Latent-space tiled inference for VOSR DiT (multi-step FM with CFG). 1. VAE-encode the full image once. 2. For each tile, crop the corres
inference_vosr.py:214
↓ 1 callers
Function
tiled_latent_inference
Latent-space tiled inference for VOSR DiT. 1. VAE-encode the full image once (no tile seams from encoder). 2. For each tile, crop the co
inference_vosr_onestep.py:229
↓ 1 callers
Method
timestep_embedding
Create sinusoidal timestep embeddings. Args: t: A 1-D Tensor of N indices, one per batch element. These may be fractional
models/lightningdit.py:185
↓ 1 callers
Function
update_ema
Step the EMA model towards the current model. Handles DDP (module.) and torch.compile (_orig_mod.) name prefixes.
train_vosr.py:236
↓ 1 callers
Function
update_ema
Step the EMA model towards the current model. Strips DDP (module.) and torch.compile (_orig_mod.) name prefixes.
train_vosr_distill.py:251
next →
1–100 of 180, ranked by callers