SYMBOL INDEX (2187 symbols across 192 files) FILE: iopaint/__init__.py function fix_window_pytorch (line 21) | def fix_window_pytorch(): function entry_point (line 49) | def entry_point(): FILE: iopaint/api.py function api_middleware (line 70) | def api_middleware(app: FastAPI): function diffuser_callback (line 138) | def diffuser_callback(pipe, step: int, timestep: int, callback_kwargs: D... class Api (line 148) | class Api: method __init__ (line 149) | def __init__(self, app: FastAPI, config: ApiConfig): method add_api_route (line 183) | def add_api_route(self, path: str, endpoint, **kwargs): method api_save_image (line 186) | def api_save_image(self, file: UploadFile): method api_current_model (line 205) | def api_current_model(self) -> ModelInfo: method api_switch_model (line 208) | def api_switch_model(self, req: SwitchModelRequest) -> ModelInfo: method api_switch_plugin_model (line 214) | def api_switch_plugin_model(self, req: SwitchPluginModelRequest): method api_server_config (line 225) | def api_server_config(self) -> ServerConfigResponse: method api_input_image (line 254) | def api_input_image(self) -> FileResponse: method api_geninfo (line 262) | def api_geninfo(self, file: UploadFile) -> GenInfoResponse: method api_inpaint (line 271) | def api_inpaint(self, req: InpaintRequest): method api_run_plugin_gen_image (line 306) | def api_run_plugin_gen_image(self, req: RunPluginRequest): method api_run_plugin_gen_mask (line 334) | def api_run_plugin_gen_mask(self, req: RunPluginRequest): method api_samplers (line 350) | def api_samplers(self) -> List[str]: method api_adjust_mask (line 353) | def api_adjust_mask(self, req: AdjustMaskRequest): method launch (line 358) | def launch(self): method _build_file_manager (line 367) | def _build_file_manager(self) -> Optional[FileManager]: method _build_plugins (line 381) | def _build_plugins(self) -> Dict[str, BasePlugin]: method _build_model_manager (line 400) | def _build_model_manager(self): FILE: iopaint/batch_processing.py function glob_images (line 26) | def glob_images(path: Path) -> Dict[str, Path]: function batch_inpaint (line 38) | def batch_inpaint( FILE: iopaint/benchmark.py function run_model (line 34) | def run_model(model, size): function benchmark (line 52) | def benchmark(model, times: int, empty_cache: bool): function get_args_parser (line 91) | def get_args_parser(): FILE: iopaint/cli.py function install_plugins_packages (line 20) | def install_plugins_packages(): function download (line 27) | def download( function list_model (line 44) | def list_model( function run (line 60) | def run( function start (line 99) | def start( function start_web_config (line 234) | def start_web_config( FILE: iopaint/download.py function cli_download_model (line 22) | def cli_download_model(model: str): function folder_name_to_show_name (line 44) | def folder_name_to_show_name(name: str) -> str: function get_sd_model_type (line 49) | def get_sd_model_type(model_abs_path: str) -> Optional[ModelType]: function get_sdxl_model_type (line 77) | def get_sdxl_model_type(model_abs_path: str) -> Optional[ModelType]: function scan_single_file_diffusion_models (line 108) | def scan_single_file_diffusion_models(cache_dir) -> List[ModelInfo]: function scan_inpaint_models (line 182) | def scan_inpaint_models(model_dir: Path) -> List[ModelInfo]: function scan_diffusers_models (line 200) | def scan_diffusers_models() -> List[ModelInfo]: function _scan_converted_diffusers_models (line 253) | def _scan_converted_diffusers_models(cache_dir) -> List[ModelInfo]: function scan_converted_diffusers_models (line 297) | def scan_converted_diffusers_models(cache_dir) -> List[ModelInfo]: function scan_models (line 307) | def scan_models() -> List[ModelInfo]: FILE: iopaint/file_manager/file_manager.py class FileManager (line 18) | class FileManager: method __init__ (line 19) | def __init__(self, app: FastAPI, input_dir: Path, mask_dir: Path, outp... method api_medias (line 36) | def api_medias(self, tab: MediaTab) -> List[MediasResponse]: method api_media_file (line 40) | def api_media_file(self, tab: MediaTab, filename: str) -> FileResponse: method api_media_thumbnail_file (line 45) | def api_media_thumbnail_file( method _get_dir (line 62) | def _get_dir(self, tab: MediaTab) -> Path: method _get_file (line 72) | def _get_file(self, tab: MediaTab, filename: str) -> Path: method thumbnail_directory (line 79) | def thumbnail_directory(self) -> Path: method _media_names (line 83) | def _media_names(directory: Path) -> List[MediasResponse]: method get_thumbnail (line 102) | def get_thumbnail( method get_raw_data (line 160) | def get_raw_data(self, image, **options): method colormode (line 171) | def colormode(image, colormode="RGB"): method background (line 185) | def background(original_image, color=0xFF): method _get_format (line 195) | def _get_format(self, image, **options): method _create_thumbnail (line 203) | def _create_thumbnail(self, image, size, crop="fit", background=None): FILE: iopaint/file_manager/storage_backends.py class BaseStorageBackend (line 7) | class BaseStorageBackend(ABC): method __init__ (line 8) | def __init__(self, app=None): method read (line 12) | def read(self, filepath, mode="rb", **kwargs): method exists (line 16) | def exists(self, filepath): method save (line 20) | def save(self, filepath, data): class FilesystemStorageBackend (line 24) | class FilesystemStorageBackend(BaseStorageBackend): method read (line 25) | def read(self, filepath, mode="rb", **kwargs): method exists (line 29) | def exists(self, filepath): method save (line 32) | def save(self, filepath, data): FILE: iopaint/file_manager/utils.py function generate_filename (line 8) | def generate_filename(directory: Path, original_filename, *options) -> str: function parse_size (line 17) | def parse_size(size): function aspect_to_string (line 42) | def aspect_to_string(size): function glob_img (line 52) | def glob_img(p: Union[Path, str], recursive: bool = False): FILE: iopaint/helper.py function md5sum (line 19) | def md5sum(filename): function switch_mps_device (line 27) | def switch_mps_device(model_name, device): function get_cache_path_by_url (line 34) | def get_cache_path_by_url(url): function download_model (line 45) | def download_model(url, model_md5: str = None): function ceil_modulo (line 74) | def ceil_modulo(x, mod): function handle_error (line 80) | def handle_error(model_path, model_md5, e): function load_jit_model (line 101) | def load_jit_model(url_or_path, device, model_md5: str): function load_model (line 116) | def load_model(model: torch.nn.Module, url_or_path, device, model_md5): function numpy_to_bytes (line 133) | def numpy_to_bytes(image_numpy: np.ndarray, ext: str) -> bytes: function pil_to_bytes (line 143) | def pil_to_bytes(pil_img, ext: str, quality: int = 95, infos={}) -> bytes: function load_img (line 158) | def load_img(img_bytes, gray: bool = False, return_info: bool = False): function norm_img (line 187) | def norm_img(np_img): function resize_max_size (line 195) | def resize_max_size( function pad_img_to_modulo (line 209) | def pad_img_to_modulo( function boxes_from_mask (line 246) | def boxes_from_mask(mask: np.ndarray) -> List[np.ndarray]: function only_keep_largest_contour (line 270) | def only_keep_largest_contour(mask: np.ndarray) -> List[np.ndarray]: function is_mac (line 296) | def is_mac(): function get_image_ext (line 300) | def get_image_ext(img_bytes): function decode_base64_to_image (line 307) | def decode_base64_to_image( function encode_pil_to_base64 (line 341) | def encode_pil_to_base64(image: Image, quality: int, infos: Dict) -> bytes: function concat_alpha_channel (line 351) | def concat_alpha_channel(rgb_np_img, alpha_channel) -> np.ndarray: function adjust_mask (line 363) | def adjust_mask(mask: np.ndarray, kernel_size: int, operate): function gen_frontend_mask (line 393) | def gen_frontend_mask(bgr_or_gray_mask): FILE: iopaint/installer.py function install (line 5) | def install(package): function install_plugins_package (line 9) | def install_plugins_package(): FILE: iopaint/model/anytext/anytext_model.py class AnyText (line 11) | class AnyText(DiffusionInpaintModel): method download (line 17) | def download(local_files_only=False): method init_model (line 35) | def init_model(self, device, **kwargs): method forward (line 47) | def forward(self, image, mask, config: InpaintRequest): FILE: iopaint/model/anytext/anytext_pipeline.py function check_limits (line 38) | def check_limits(tensor): class AnyTextPipeline (line 49) | class AnyTextPipeline: method __init__ (line 50) | def __init__(self, ckpt_path, font_path, device, use_fp16=True): method __call__ (line 72) | def __call__( method modify_prompt (line 338) | def modify_prompt(self, prompt): method separate_pos_imgs (line 364) | def separate_pos_imgs(self, img, sort_priority, gap=102): method find_polygon (line 379) | def find_polygon(self, image, min_rect=False): method arr2tensor (line 397) | def arr2tensor(self, arr, bs): FILE: iopaint/model/anytext/cldm/cldm.py function count_parameters (line 30) | def count_parameters(model): class ControlledUnetModel (line 34) | class ControlledUnetModel(UNetModel): method forward (line 35) | def forward(self, x, timesteps=None, context=None, control=None, only_... class ControlNet (line 62) | class ControlNet(nn.Module): method __init__ (line 63) | def __init__( method make_zero_conv (line 317) | def make_zero_conv(self, channels): method forward (line 320) | def forward(self, x, hint, text_info, timesteps, context, **kwargs): class ControlLDM (line 352) | class ControlLDM(LatentDiffusion): method __init__ (line 354) | def __init__(self, control_stage_config, control_key, glyph_key, posit... method get_input (line 390) | def get_input(self, batch, k, bs=None, *args, **kwargs): method apply_model (line 442) | def apply_model(self, x_noisy, t, cond, *args, **kwargs): method instantiate_embedding_manager (line 455) | def instantiate_embedding_manager(self, config, embedder): method get_unconditional_conditioning (line 460) | def get_unconditional_conditioning(self, N): method get_learned_conditioning (line 463) | def get_learned_conditioning(self, c): method fill_caption (line 489) | def fill_caption(self, batch, place_holder='*'): method log_images (line 504) | def log_images(self, batch, N=4, n_row=2, sample=False, ddim_steps=50,... method sample_log (line 592) | def sample_log(self, cond, batch_size, ddim, ddim_steps, **kwargs): method configure_optimizers (line 599) | def configure_optimizers(self): method low_vram_shift (line 620) | def low_vram_shift(self, is_diffusing): FILE: iopaint/model/anytext/cldm/ddim_hacked.py class DDIMSampler (line 15) | class DDIMSampler(object): method __init__ (line 16) | def __init__(self, model, device, schedule="linear", **kwargs): method register_buffer (line 23) | def register_buffer(self, name, attr): method make_schedule (line 29) | def make_schedule( method sample (line 90) | def sample( method ddim_sampling (line 169) | def ddim_sampling( method p_sample_ddim (line 268) | def p_sample_ddim( method encode (line 352) | def encode( method stochastic_encode (line 429) | def stochastic_encode(self, x0, t, use_original_steps=False, noise=None): method decode (line 447) | def decode( FILE: iopaint/model/anytext/cldm/embedding_manager.py function get_clip_token_for_string (line 11) | def get_clip_token_for_string(tokenizer, string): function get_bert_token_for_string (line 19) | def get_bert_token_for_string(tokenizer, string): function get_clip_vision_emb (line 26) | def get_clip_vision_emb(encoder, processor, img): function get_recog_emb (line 35) | def get_recog_emb(encoder, img_list): function pad_H (line 42) | def pad_H(x): class EncodeNet (line 49) | class EncodeNet(nn.Module): method __init__ (line 50) | def __init__(self, in_channels, out_channels): method forward (line 65) | def forward(self, x): class EmbeddingManager (line 75) | class EmbeddingManager(nn.Module): method __init__ (line 76) | def __init__( method encode_text (line 111) | def encode_text(self, text_info): method forward (line 146) | def forward( method embedding_parameters (line 164) | def embedding_parameters(self): FILE: iopaint/model/anytext/cldm/hack.py function disable_verbosity (line 11) | def disable_verbosity(): function enable_sliced_attention (line 17) | def enable_sliced_attention(): function hack_everything (line 23) | def hack_everything(clip_skip=0): function _hacked_clip_forward (line 32) | def _hacked_clip_forward(self, text): function _hacked_sliced_attentin_forward (line 72) | def _hacked_sliced_attentin_forward(self, x, context=None, mask=None): FILE: iopaint/model/anytext/cldm/model.py function get_state_dict (line 8) | def get_state_dict(d): function load_state_dict (line 12) | def load_state_dict(ckpt_path, location="cpu"): function create_model (line 27) | def create_model(config_path, device, cond_stage_path=None, use_fp16=Fal... FILE: iopaint/model/anytext/cldm/recognizer.py function min_bounding_rect (line 16) | def min_bounding_rect(img): function create_predictor (line 43) | def create_predictor(model_dir=None, model_lang="ch", is_onnx=False): function _check_image_file (line 93) | def _check_image_file(path): function get_image_file_list (line 98) | def get_image_file_list(img_file): class TextRecognizer (line 115) | class TextRecognizer(object): method __init__ (line 116) | def __init__(self, args, predictor): method resize_norm_img (line 126) | def resize_norm_img(self, img, max_wh_ratio): method pred_imglist (line 151) | def pred_imglist(self, img_list, show_debug=False, is_ori=False): method get_char_dict (line 210) | def get_char_dict(self, character_dict_path): method get_text (line 221) | def get_text(self, order): method decode (line 225) | def decode(self, mat): method get_ctcloss (line 234) | def get_ctcloss(self, preds, gt_text, weight): function main (line 254) | def main(): FILE: iopaint/model/anytext/ldm/models/autoencoder.py class AutoencoderKL (line 12) | class AutoencoderKL(torch.nn.Module): method __init__ (line 13) | def __init__(self, method init_from_ckpt (line 51) | def init_from_ckpt(self, path, ignore_keys=list()): method ema_scope (line 63) | def ema_scope(self, context=None): method on_train_batch_end (line 77) | def on_train_batch_end(self, *args, **kwargs): method encode (line 81) | def encode(self, x): method decode (line 87) | def decode(self, z): method forward (line 92) | def forward(self, input, sample_posterior=True): method get_input (line 101) | def get_input(self, batch, k): method training_step (line 108) | def training_step(self, batch, batch_idx, optimizer_idx): method validation_step (line 129) | def validation_step(self, batch, batch_idx): method _validation_step (line 135) | def _validation_step(self, batch, batch_idx, postfix=""): method configure_optimizers (line 149) | def configure_optimizers(self): method get_last_layer (line 162) | def get_last_layer(self): method log_images (line 166) | def log_images(self, batch, only_inputs=False, log_ema=False, **kwargs): method to_rgb (line 191) | def to_rgb(self, x): class IdentityFirstStage (line 200) | class IdentityFirstStage(torch.nn.Module): method __init__ (line 201) | def __init__(self, *args, vq_interface=False, **kwargs): method encode (line 205) | def encode(self, x, *args, **kwargs): method decode (line 208) | def decode(self, x, *args, **kwargs): method quantize (line 211) | def quantize(self, x, *args, **kwargs): method forward (line 216) | def forward(self, x, *args, **kwargs): FILE: iopaint/model/anytext/ldm/models/diffusion/ddim.py class DDIMSampler (line 10) | class DDIMSampler(object): method __init__ (line 11) | def __init__(self, model, schedule="linear", **kwargs): method register_buffer (line 17) | def register_buffer(self, name, attr): method make_schedule (line 23) | def make_schedule(self, ddim_num_steps, ddim_discretize="uniform", ddi... method sample (line 55) | def sample(self, method ddim_sampling (line 124) | def ddim_sampling(self, cond, shape, method p_sample_ddim (line 185) | def p_sample_ddim(self, x, c, t, index, repeat_noise=False, use_origin... method encode (line 272) | def encode(self, x0, c, t_enc, use_original_steps=False, return_interm... method stochastic_encode (line 319) | def stochastic_encode(self, x0, t, use_original_steps=False, noise=None): method decode (line 335) | def decode(self, x_latent, cond, t_start, unconditional_guidance_scale... FILE: iopaint/model/anytext/ldm/models/diffusion/ddpm.py function print_grad (line 47) | def print_grad(grad): function disabled_train (line 64) | def disabled_train(self, mode=True): function uniform_on_device (line 70) | def uniform_on_device(r1, r2, shape, device): class DDPM (line 74) | class DDPM(torch.nn.Module): method __init__ (line 76) | def __init__( method register_schedule (line 186) | def register_schedule( method ema_scope (line 291) | def ema_scope(self, context=None): method init_from_ckpt (line 306) | def init_from_ckpt(self, path, ignore_keys=list(), only_model=False): method q_mean_variance (line 379) | def q_mean_variance(self, x_start, t): method predict_start_from_noise (line 393) | def predict_start_from_noise(self, x_t, t, noise): method predict_start_from_z_and_v (line 400) | def predict_start_from_z_and_v(self, x_t, t, v): method predict_eps_from_z_and_v (line 408) | def predict_eps_from_z_and_v(self, x_t, t, v): method q_posterior (line 415) | def q_posterior(self, x_start, x_t, t): method p_mean_variance (line 426) | def p_mean_variance(self, x, t, clip_denoised: bool): method p_sample (line 441) | def p_sample(self, x, t, clip_denoised=True, repeat_noise=False): method p_sample_loop (line 452) | def p_sample_loop(self, shape, return_intermediates=False): method sample (line 474) | def sample(self, batch_size=16, return_intermediates=False): method q_sample (line 482) | def q_sample(self, x_start, t, noise=None): method get_v (line 490) | def get_v(self, x, noise, t): method get_loss (line 496) | def get_loss(self, pred, target, mean=True): method p_losses (line 511) | def p_losses(self, x_start, t, noise=None): method forward (line 544) | def forward(self, x, *args, **kwargs): method get_input (line 552) | def get_input(self, batch, k): method shared_step (line 560) | def shared_step(self, batch): method training_step (line 565) | def training_step(self, batch, batch_idx): method validation_step (line 599) | def validation_step(self, batch, batch_idx): method on_train_batch_end (line 611) | def on_train_batch_end(self, *args, **kwargs): method _get_rows_from_list (line 615) | def _get_rows_from_list(self, samples): method log_images (line 623) | def log_images(self, batch, N=8, n_row=2, sample=True, return_keys=Non... method configure_optimizers (line 662) | def configure_optimizers(self): class LatentDiffusion (line 671) | class LatentDiffusion(DDPM): method __init__ (line 674) | def __init__( method make_cond_schedule (line 741) | def make_cond_schedule( method on_train_batch_start (line 755) | def on_train_batch_start(self, batch, batch_idx, dataloader_idx): method register_schedule (line 778) | def register_schedule( method instantiate_first_stage (line 795) | def instantiate_first_stage(self, config): method instantiate_cond_stage (line 802) | def instantiate_cond_stage(self, config): method _get_denoise_row_from_list (line 823) | def _get_denoise_row_from_list( method get_first_stage_encoding (line 840) | def get_first_stage_encoding(self, encoder_posterior): method get_learned_conditioning (line 851) | def get_learned_conditioning(self, c): method meshgrid (line 866) | def meshgrid(self, h, w): method delta_border (line 873) | def delta_border(self, h, w): method get_weighting (line 889) | def get_weighting(self, h, w, Ly, Lx, device): method get_fold_unfold (line 910) | def get_fold_unfold( method get_input (line 995) | def get_input( method decode_first_stage (line 1068) | def decode_first_stage(self, z, predict_cids=False, force_not_quantize... method decode_first_stage_grad (line 1078) | def decode_first_stage_grad(self, z, predict_cids=False, force_not_qua... method encode_first_stage (line 1089) | def encode_first_stage(self, x): method shared_step (line 1092) | def shared_step(self, batch, **kwargs): method forward (line 1097) | def forward(self, x, c, *args, **kwargs): method apply_model (line 1111) | def apply_model(self, x_noisy, t, cond, return_ids=False): method _predict_eps_from_xstart (line 1130) | def _predict_eps_from_xstart(self, x_t, t, pred_xstart): method _prior_bpd (line 1136) | def _prior_bpd(self, x_start): method p_mean_variance (line 1152) | def p_mean_variance( method p_sample (line 1198) | def p_sample( method progressive_denoising (line 1252) | def progressive_denoising( method p_sample_loop (line 1346) | def p_sample_loop( method sample (line 1417) | def sample( method sample_log (line 1460) | def sample_log(self, cond, batch_size, ddim, ddim_steps, **kwargs): method get_unconditional_conditioning (line 1476) | def get_unconditional_conditioning(self, batch_size, null_label=None): method log_images (line 1503) | def log_images( method configure_optimizers (line 1694) | def configure_optimizers(self): method to_rgb (line 1720) | def to_rgb(self, x): class DiffusionWrapper (line 1729) | class DiffusionWrapper(torch.nn.Module): method __init__ (line 1730) | def __init__(self, diff_model_config, conditioning_key): method forward (line 1747) | def forward( class LatentUpscaleDiffusion (line 1783) | class LatentUpscaleDiffusion(LatentDiffusion): method __init__ (line 1784) | def __init__( method instantiate_low_stage (line 1799) | def instantiate_low_stage(self, config): method get_input (line 1807) | def get_input(self, batch, k, cond_key=None, bs=None, log_mode=False): method log_images (line 1835) | def log_images( class LatentFinetuneDiffusion (line 1975) | class LatentFinetuneDiffusion(LatentDiffusion): method __init__ (line 1981) | def __init__( method init_from_ckpt (line 2008) | def init_from_ckpt(self, path, ignore_keys=list(), only_model=False): method log_images (line 2046) | def log_images( class LatentInpaintDiffusion (line 2164) | class LatentInpaintDiffusion(LatentFinetuneDiffusion): method __init__ (line 2171) | def __init__( method get_input (line 2183) | def get_input( method log_images (line 2223) | def log_images(self, *args, **kwargs): class LatentDepth2ImageDiffusion (line 2233) | class LatentDepth2ImageDiffusion(LatentFinetuneDiffusion): method __init__ (line 2238) | def __init__(self, depth_stage_config, concat_keys=("midas_in",), *arg... method get_input (line 2244) | def get_input( method log_images (line 2288) | def log_images(self, *args, **kwargs): class LatentUpscaleFinetuneDiffusion (line 2298) | class LatentUpscaleFinetuneDiffusion(LatentFinetuneDiffusion): method __init__ (line 2303) | def __init__( method instantiate_low_stage (line 2321) | def instantiate_low_stage(self, config): method get_input (line 2329) | def get_input( method log_images (line 2377) | def log_images(self, *args, **kwargs): FILE: iopaint/model/anytext/ldm/models/diffusion/dpm_solver/dpm_solver.py class NoiseScheduleVP (line 7) | class NoiseScheduleVP: method __init__ (line 8) | def __init__( method marginal_log_mean_coeff (line 106) | def marginal_log_mean_coeff(self, t): method marginal_alpha (line 120) | def marginal_alpha(self, t): method marginal_std (line 126) | def marginal_std(self, t): method marginal_lambda (line 132) | def marginal_lambda(self, t): method inverse_lambda (line 140) | def inverse_lambda(self, lamb): function model_wrapper (line 161) | def model_wrapper( class DPM_Solver (line 319) | class DPM_Solver: method __init__ (line 320) | def __init__(self, model_fn, noise_schedule, predict_x0=False, thresho... method noise_prediction_fn (line 346) | def noise_prediction_fn(self, x, t): method data_prediction_fn (line 352) | def data_prediction_fn(self, x, t): method model_fn (line 367) | def model_fn(self, x, t): method get_time_steps (line 376) | def get_time_steps(self, skip_type, t_T, t_0, N, device): method get_orders_and_timesteps_for_singlestep_solver (line 405) | def get_orders_and_timesteps_for_singlestep_solver(self, steps, order,... method denoise_to_zero_fn (line 463) | def denoise_to_zero_fn(self, x, s): method dpm_solver_first_update (line 469) | def dpm_solver_first_update(self, x, s, t, model_s=None, return_interm... method singlestep_dpm_solver_second_update (line 515) | def singlestep_dpm_solver_second_update(self, x, s, t, r1=0.5, model_s... method singlestep_dpm_solver_third_update (line 599) | def singlestep_dpm_solver_third_update(self, x, s, t, r1=1. / 3., r2=2... method multistep_dpm_solver_second_update (line 723) | def multistep_dpm_solver_second_update(self, x, model_prev_list, t_pre... method multistep_dpm_solver_third_update (line 780) | def multistep_dpm_solver_third_update(self, x, model_prev_list, t_prev... method singlestep_dpm_solver_update (line 827) | def singlestep_dpm_solver_update(self, x, s, t, order, return_intermed... method multistep_dpm_solver_update (line 855) | def multistep_dpm_solver_update(self, x, model_prev_list, t_prev_list,... method dpm_solver_adaptive (line 878) | def dpm_solver_adaptive(self, x, order, t_T, t_0, h_init=0.05, atol=0.... method sample (line 939) | def sample(self, x, steps=20, t_start=None, t_end=None, order=3, skip_... function interpolate_fn (line 1104) | def interpolate_fn(x, xp, yp): function expand_dims (line 1145) | def expand_dims(v, dims): FILE: iopaint/model/anytext/ldm/models/diffusion/dpm_solver/sampler.py class DPMSolverSampler (line 13) | class DPMSolverSampler(object): method __init__ (line 14) | def __init__(self, model, **kwargs): method register_buffer (line 20) | def register_buffer(self, name, attr): method sample (line 27) | def sample(self, FILE: iopaint/model/anytext/ldm/models/diffusion/plms.py class PLMSSampler (line 12) | class PLMSSampler(object): method __init__ (line 13) | def __init__(self, model, schedule="linear", **kwargs): method register_buffer (line 19) | def register_buffer(self, name, attr): method make_schedule (line 25) | def make_schedule(self, ddim_num_steps, ddim_discretize="uniform", ddi... method sample (line 59) | def sample(self, method plms_sampling (line 118) | def plms_sampling(self, cond, shape, method p_sample_plms (line 178) | def p_sample_plms(self, x, c, t, index, repeat_noise=False, use_origin... FILE: iopaint/model/anytext/ldm/models/diffusion/sampling_util.py function append_dims (line 5) | def append_dims(x, target_dims): function norm_thresholding (line 14) | def norm_thresholding(x0, value): function spatial_norm_thresholding (line 19) | def spatial_norm_thresholding(x0, value): FILE: iopaint/model/anytext/ldm/modules/attention.py function exists (line 18) | def exists(val): function uniq (line 22) | def uniq(arr): function default (line 26) | def default(val, d): function max_neg_value (line 32) | def max_neg_value(t): function init_ (line 36) | def init_(tensor): class GEGLU (line 44) | class GEGLU(nn.Module): method __init__ (line 45) | def __init__(self, dim_in, dim_out): method forward (line 49) | def forward(self, x): class FeedForward (line 54) | class FeedForward(nn.Module): method __init__ (line 55) | def __init__(self, dim, dim_out=None, mult=4, glu=False, dropout=0.0): method forward (line 69) | def forward(self, x): function zero_module (line 73) | def zero_module(module): function Normalize (line 82) | def Normalize(in_channels): class SpatialSelfAttention (line 88) | class SpatialSelfAttention(nn.Module): method __init__ (line 89) | def __init__(self, in_channels): method forward (line 107) | def forward(self, x): class CrossAttention (line 133) | class CrossAttention(nn.Module): method __init__ (line 134) | def __init__(self, query_dim, context_dim=None, heads=8, dim_head=64, ... method forward (line 150) | def forward(self, x, context=None, mask=None): class SDPACrossAttention (line 184) | class SDPACrossAttention(CrossAttention): method forward (line 185) | def forward(self, x, context=None, mask=None): class BasicTransformerBlock (line 227) | class BasicTransformerBlock(nn.Module): method __init__ (line 228) | def __init__( method forward (line 267) | def forward(self, x, context=None): method _forward (line 272) | def _forward(self, x, context=None): class SpatialTransformer (line 284) | class SpatialTransformer(nn.Module): method __init__ (line 294) | def __init__( method forward (line 341) | def forward(self, x, context=None): FILE: iopaint/model/anytext/ldm/modules/diffusionmodules/model.py function get_timestep_embedding (line 9) | def get_timestep_embedding(timesteps, embedding_dim): function nonlinearity (line 30) | def nonlinearity(x): function Normalize (line 35) | def Normalize(in_channels, num_groups=32): class Upsample (line 41) | class Upsample(nn.Module): method __init__ (line 42) | def __init__(self, in_channels, with_conv): method forward (line 50) | def forward(self, x): class Downsample (line 57) | class Downsample(nn.Module): method __init__ (line 58) | def __init__(self, in_channels, with_conv): method forward (line 67) | def forward(self, x): class ResnetBlock (line 77) | class ResnetBlock(nn.Module): method __init__ (line 78) | def __init__( method forward (line 114) | def forward(self, x, temb): class AttnBlock (line 137) | class AttnBlock(nn.Module): method __init__ (line 138) | def __init__(self, in_channels): method forward (line 156) | def forward(self, x): class AttnBlock2_0 (line 183) | class AttnBlock2_0(nn.Module): method __init__ (line 184) | def __init__(self, in_channels): method forward (line 202) | def forward(self, x): function make_attn (line 231) | def make_attn(in_channels, attn_type="vanilla", attn_kwargs=None): class Model (line 246) | class Model(nn.Module): method __init__ (line 247) | def __init__( method forward (line 368) | def forward(self, x, t=None, context=None): method get_last_layer (line 417) | def get_last_layer(self): class Encoder (line 421) | class Encoder(nn.Module): method __init__ (line 422) | def __init__( method forward (line 510) | def forward(self, x): class Decoder (line 538) | class Decoder(nn.Module): method __init__ (line 539) | def __init__( method forward (line 634) | def forward(self, z): class SimpleDecoder (line 670) | class SimpleDecoder(nn.Module): method __init__ (line 671) | def __init__(self, in_channels, out_channels, *args, **kwargs): method forward (line 704) | def forward(self, x): class UpsampleDecoder (line 717) | class UpsampleDecoder(nn.Module): method __init__ (line 718) | def __init__( method forward (line 761) | def forward(self, x): class LatentRescaler (line 775) | class LatentRescaler(nn.Module): method __init__ (line 776) | def __init__(self, factor, in_channels, mid_channels, out_channels, de... method forward (line 813) | def forward(self, x): class MergedRescaleEncoder (line 831) | class MergedRescaleEncoder(nn.Module): method __init__ (line 832) | def __init__( method forward (line 869) | def forward(self, x): class MergedRescaleDecoder (line 875) | class MergedRescaleDecoder(nn.Module): method __init__ (line 876) | def __init__( method forward (line 912) | def forward(self, x): class Upsampler (line 918) | class Upsampler(nn.Module): method __init__ (line 919) | def __init__(self, in_size, out_size, in_channels, out_channels, ch_mu... method forward (line 944) | def forward(self, x): class Resize (line 950) | class Resize(nn.Module): method __init__ (line 951) | def __init__(self, in_channels=None, learned=False, mode="bilinear"): method forward (line 966) | def forward(self, x, scale_factor=1.0): FILE: iopaint/model/anytext/ldm/modules/diffusionmodules/openaimodel.py function convert_module_to_f16 (line 23) | def convert_module_to_f16(x): function convert_module_to_f32 (line 26) | def convert_module_to_f32(x): class AttentionPool2d (line 31) | class AttentionPool2d(nn.Module): method __init__ (line 36) | def __init__( method forward (line 50) | def forward(self, x): class TimestepBlock (line 61) | class TimestepBlock(nn.Module): method forward (line 67) | def forward(self, x, emb): class TimestepEmbedSequential (line 73) | class TimestepEmbedSequential(nn.Sequential, TimestepBlock): method forward (line 79) | def forward(self, x, emb, context=None): class Upsample (line 90) | class Upsample(nn.Module): method __init__ (line 99) | def __init__(self, channels, use_conv, dims=2, out_channels=None, padd... method forward (line 108) | def forward(self, x): class TransposedUpsample (line 120) | class TransposedUpsample(nn.Module): method __init__ (line 122) | def __init__(self, channels, out_channels=None, ks=5): method forward (line 129) | def forward(self,x): class Downsample (line 133) | class Downsample(nn.Module): method __init__ (line 142) | def __init__(self, channels, use_conv, dims=2, out_channels=None,paddi... method forward (line 157) | def forward(self, x): class ResBlock (line 162) | class ResBlock(TimestepBlock): method __init__ (line 178) | def __init__( method forward (line 242) | def forward(self, x, emb): method _forward (line 254) | def _forward(self, x, emb): class AttentionBlock (line 277) | class AttentionBlock(nn.Module): method __init__ (line 284) | def __init__( method forward (line 313) | def forward(self, x): method _forward (line 317) | def _forward(self, x): function count_flops_attn (line 326) | def count_flops_attn(model, _x, y): class QKVAttentionLegacy (line 346) | class QKVAttentionLegacy(nn.Module): method __init__ (line 351) | def __init__(self, n_heads): method forward (line 355) | def forward(self, qkv): method count_flops (line 374) | def count_flops(model, _x, y): class QKVAttention (line 378) | class QKVAttention(nn.Module): method __init__ (line 383) | def __init__(self, n_heads): method forward (line 387) | def forward(self, qkv): method count_flops (line 408) | def count_flops(model, _x, y): class UNetModel (line 412) | class UNetModel(nn.Module): method __init__ (line 442) | def __init__( method convert_to_fp16 (line 738) | def convert_to_fp16(self): method convert_to_fp32 (line 746) | def convert_to_fp32(self): method forward (line 754) | def forward(self, x, timesteps=None, context=None, y=None,**kwargs): FILE: iopaint/model/anytext/ldm/modules/diffusionmodules/upscaling.py class AbstractLowScaleModel (line 10) | class AbstractLowScaleModel(nn.Module): method __init__ (line 12) | def __init__(self, noise_schedule_config=None): method register_schedule (line 17) | def register_schedule(self, beta_schedule="linear", timesteps=1000, method q_sample (line 44) | def q_sample(self, x_start, t, noise=None): method forward (line 49) | def forward(self, x): method decode (line 52) | def decode(self, x): class SimpleImageConcat (line 56) | class SimpleImageConcat(AbstractLowScaleModel): method __init__ (line 58) | def __init__(self): method forward (line 62) | def forward(self, x): class ImageConcatWithNoiseAugmentation (line 67) | class ImageConcatWithNoiseAugmentation(AbstractLowScaleModel): method __init__ (line 68) | def __init__(self, noise_schedule_config, max_noise_level=1000, to_cud... method forward (line 72) | def forward(self, x, noise_level=None): FILE: iopaint/model/anytext/ldm/modules/diffusionmodules/util.py function make_beta_schedule (line 21) | def make_beta_schedule(schedule, n_timestep, linear_start=1e-4, linear_e... function make_ddim_timesteps (line 46) | def make_ddim_timesteps(ddim_discr_method, num_ddim_timesteps, num_ddpm_... function make_ddim_sampling_parameters (line 63) | def make_ddim_sampling_parameters(alphacums, ddim_timesteps, eta, verbos... function betas_for_alpha_bar (line 77) | def betas_for_alpha_bar(num_diffusion_timesteps, alpha_bar, max_beta=0.9... function extract_into_tensor (line 96) | def extract_into_tensor(a, t, x_shape): function checkpoint (line 102) | def checkpoint(func, inputs, params, flag): class CheckpointFunction (line 119) | class CheckpointFunction(torch.autograd.Function): method forward (line 121) | def forward(ctx, run_function, length, *args): method backward (line 133) | def backward(ctx, *output_grads): function timestep_embedding (line 154) | def timestep_embedding(timesteps, dim, max_period=10000, repeat_only=Fal... function zero_module (line 177) | def zero_module(module): function scale_module (line 186) | def scale_module(module, scale): function mean_flat (line 195) | def mean_flat(tensor): function normalization (line 202) | def normalization(channels): class SiLU (line 212) | class SiLU(nn.Module): method forward (line 213) | def forward(self, x): class GroupNorm32 (line 217) | class GroupNorm32(nn.GroupNorm): method forward (line 218) | def forward(self, x): function conv_nd (line 222) | def conv_nd(dims, *args, **kwargs): function linear (line 235) | def linear(*args, **kwargs): function avg_pool_nd (line 242) | def avg_pool_nd(dims, *args, **kwargs): class HybridConditioner (line 255) | class HybridConditioner(nn.Module): method __init__ (line 257) | def __init__(self, c_concat_config, c_crossattn_config): method forward (line 262) | def forward(self, c_concat, c_crossattn): function noise_like (line 268) | def noise_like(shape, device, repeat=False): FILE: iopaint/model/anytext/ldm/modules/distributions/distributions.py class AbstractDistribution (line 5) | class AbstractDistribution: method sample (line 6) | def sample(self): method mode (line 9) | def mode(self): class DiracDistribution (line 13) | class DiracDistribution(AbstractDistribution): method __init__ (line 14) | def __init__(self, value): method sample (line 17) | def sample(self): method mode (line 20) | def mode(self): class DiagonalGaussianDistribution (line 24) | class DiagonalGaussianDistribution(object): method __init__ (line 25) | def __init__(self, parameters, deterministic=False): method sample (line 35) | def sample(self): method kl (line 39) | def kl(self, other=None): method nll (line 53) | def nll(self, sample, dims=[1,2,3]): method mode (line 61) | def mode(self): function normal_kl (line 65) | def normal_kl(mean1, logvar1, mean2, logvar2): FILE: iopaint/model/anytext/ldm/modules/ema.py class LitEma (line 5) | class LitEma(nn.Module): method __init__ (line 6) | def __init__(self, model, decay=0.9999, use_num_upates=True): method reset_num_updates (line 25) | def reset_num_updates(self): method forward (line 29) | def forward(self, model): method copy_to (line 50) | def copy_to(self, model): method store (line 59) | def store(self, parameters): method restore (line 68) | def restore(self, parameters): FILE: iopaint/model/anytext/ldm/modules/encoders/modules.py function _expand_mask (line 17) | def _expand_mask(mask, dtype, tgt_len=None): function _build_causal_attention_mask (line 33) | def _build_causal_attention_mask(bsz, seq_len, dtype): class AbstractEncoder (line 43) | class AbstractEncoder(nn.Module): method __init__ (line 44) | def __init__(self): method encode (line 47) | def encode(self, *args, **kwargs): class IdentityEncoder (line 51) | class IdentityEncoder(AbstractEncoder): method encode (line 52) | def encode(self, x): class ClassEmbedder (line 56) | class ClassEmbedder(nn.Module): method __init__ (line 57) | def __init__(self, embed_dim, n_classes=1000, key="class", ucg_rate=0.1): method forward (line 64) | def forward(self, batch, key=None, disable_dropout=False): method get_unconditional_conditioning (line 76) | def get_unconditional_conditioning(self, bs, device="cuda"): function disabled_train (line 85) | def disabled_train(self, mode=True): class FrozenT5Embedder (line 91) | class FrozenT5Embedder(AbstractEncoder): method __init__ (line 94) | def __init__( method freeze (line 105) | def freeze(self): method forward (line 111) | def forward(self, text): method encode (line 127) | def encode(self, text): class FrozenCLIPEmbedder (line 131) | class FrozenCLIPEmbedder(AbstractEncoder): method __init__ (line 136) | def __init__( method freeze (line 159) | def freeze(self): method forward (line 165) | def forward(self, text): method encode (line 187) | def encode(self, text): class FrozenCLIPT5Encoder (line 191) | class FrozenCLIPT5Encoder(AbstractEncoder): method __init__ (line 192) | def __init__( method encode (line 210) | def encode(self, text): method forward (line 213) | def forward(self, text): class FrozenCLIPEmbedderT3 (line 219) | class FrozenCLIPEmbedderT3(AbstractEncoder): method __init__ (line 222) | def __init__( method freeze (line 391) | def freeze(self): method forward (line 396) | def forward(self, text, **kwargs): method encode (line 410) | def encode(self, text, **kwargs): FILE: iopaint/model/anytext/ldm/util.py function log_txt_as_img (line 11) | def log_txt_as_img(wh, xc, size=10): function ismap (line 35) | def ismap(x): function isimage (line 41) | def isimage(x): function exists (line 47) | def exists(x): function default (line 51) | def default(val, d): function mean_flat (line 57) | def mean_flat(tensor): function count_params (line 65) | def count_params(model, verbose=False): function instantiate_from_config (line 72) | def instantiate_from_config(config, **kwargs): function get_obj_from_str (line 82) | def get_obj_from_str(string, reload=False): class AdamWwithEMAandWings (line 90) | class AdamWwithEMAandWings(optim.Optimizer): method __init__ (line 92) | def __init__(self, params, lr=1.e-3, betas=(0.9, 0.999), eps=1.e-8, #... method __setstate__ (line 113) | def __setstate__(self, state): method step (line 119) | def step(self, closure=None): FILE: iopaint/model/anytext/ocr_recog/RNN.py class Swish (line 5) | class Swish(nn.Module): method __int__ (line 6) | def __int__(self): method forward (line 9) | def forward(self,x): class Im2Im (line 12) | class Im2Im(nn.Module): method __init__ (line 13) | def __init__(self, in_channels, **kwargs): method forward (line 17) | def forward(self, x): class Im2Seq (line 20) | class Im2Seq(nn.Module): method __init__ (line 21) | def __init__(self, in_channels, **kwargs): method forward (line 25) | def forward(self, x): class EncoderWithRNN (line 32) | class EncoderWithRNN(nn.Module): method __init__ (line 33) | def __init__(self, in_channels,**kwargs): method forward (line 39) | def forward(self, x): class SequenceEncoder (line 44) | class SequenceEncoder(nn.Module): method __init__ (line 45) | def __init__(self, in_channels, encoder_type='rnn', **kwargs): method forward (line 66) | def forward(self, x): class ConvBNLayer (line 77) | class ConvBNLayer(nn.Module): method __init__ (line 78) | def __init__(self, method forward (line 100) | def forward(self, inputs): class EncoderWithSVTR (line 107) | class EncoderWithSVTR(nn.Module): method __init__ (line 108) | def __init__( method _init_weights (line 159) | def _init_weights(self, m): method forward (line 180) | def forward(self, x): FILE: iopaint/model/anytext/ocr_recog/RecCTCHead.py class CTCHead (line 4) | class CTCHead(nn.Module): method __init__ (line 5) | def __init__(self, method forward (line 34) | def forward(self, x, labels=None): FILE: iopaint/model/anytext/ocr_recog/RecModel.py class RecModel (line 12) | class RecModel(nn.Module): method __init__ (line 13) | def __init__(self, config): method load_3rd_state_dict (line 30) | def load_3rd_state_dict(self, _3rd_name, _state): method forward (line 35) | def forward(self, x): method encode (line 41) | def encode(self, x): FILE: iopaint/model/anytext/ocr_recog/RecMv1_enhance.py class ConvBNLayer (line 7) | class ConvBNLayer(nn.Module): method __init__ (line 8) | def __init__(self, method forward (line 34) | def forward(self, inputs): class DepthwiseSeparable (line 42) | class DepthwiseSeparable(nn.Module): method __init__ (line 43) | def __init__(self, method forward (line 71) | def forward(self, inputs): class MobileNetV1Enhance (line 79) | class MobileNetV1Enhance(nn.Module): method __init__ (line 80) | def __init__(self, method forward (line 196) | def forward(self, inputs): function hardsigmoid (line 202) | def hardsigmoid(x): class SEModule (line 205) | class SEModule(nn.Module): method __init__ (line 206) | def __init__(self, channel, reduction=4): method forward (line 224) | def forward(self, inputs): FILE: iopaint/model/anytext/ocr_recog/RecSVTR.py function drop_path (line 8) | def drop_path(x, drop_prob=0., training=False): class Swish (line 23) | class Swish(nn.Module): method __int__ (line 24) | def __int__(self): method forward (line 27) | def forward(self,x): class ConvBNLayer (line 31) | class ConvBNLayer(nn.Module): method __init__ (line 32) | def __init__(self, method forward (line 54) | def forward(self, inputs): class DropPath (line 61) | class DropPath(nn.Module): method __init__ (line 65) | def __init__(self, drop_prob=None): method forward (line 69) | def forward(self, x): class Identity (line 73) | class Identity(nn.Module): method __init__ (line 74) | def __init__(self): method forward (line 77) | def forward(self, input): class Mlp (line 81) | class Mlp(nn.Module): method __init__ (line 82) | def __init__(self, method forward (line 99) | def forward(self, x): class ConvMixer (line 108) | class ConvMixer(nn.Module): method __init__ (line 109) | def __init__( method forward (line 127) | def forward(self, x): class Attention (line 136) | class Attention(nn.Module): method __init__ (line 137) | def __init__(self, method forward (line 177) | def forward(self, x): class Block (line 198) | class Block(nn.Module): method __init__ (line 199) | def __init__(self, method forward (line 251) | def forward(self, x): class PatchEmbed (line 261) | class PatchEmbed(nn.Module): method __init__ (line 265) | def __init__(self, method forward (line 322) | def forward(self, x): class SubSample (line 330) | class SubSample(nn.Module): method __init__ (line 331) | def __init__(self, method forward (line 361) | def forward(self, x): class SVTRNet (line 378) | class SVTRNet(nn.Module): method __init__ (line 379) | def __init__( method _init_weights (line 533) | def _init_weights(self, m): method forward_features (line 542) | def forward_features(self, x): method forward (line 564) | def forward(self, x): FILE: iopaint/model/anytext/ocr_recog/common.py class Hswish (line 8) | class Hswish(nn.Module): method __init__ (line 9) | def __init__(self, inplace=True): method forward (line 13) | def forward(self, x): class Hsigmoid (line 18) | class Hsigmoid(nn.Module): method __init__ (line 19) | def __init__(self, inplace=True): method forward (line 23) | def forward(self, x): class GELU (line 28) | class GELU(nn.Module): method __init__ (line 29) | def __init__(self, inplace=True): method forward (line 33) | def forward(self, x): class Swish (line 37) | class Swish(nn.Module): method __init__ (line 38) | def __init__(self, inplace=True): method forward (line 42) | def forward(self, x): class Activation (line 50) | class Activation(nn.Module): method __init__ (line 51) | def __init__(self, act_type, inplace=True): method forward (line 73) | def forward(self, inputs): FILE: iopaint/model/anytext/utils.py function save_images (line 8) | def save_images(img_list, folder): function check_channels (line 24) | def check_channels(image): function resize_image (line 33) | def resize_image(img, max_length=768): function insert_spaces (line 48) | def insert_spaces(string, nSpace): function draw_glyph (line 57) | def draw_glyph(font, text): function draw_glyph2 (line 78) | def draw_glyph2( FILE: iopaint/model/base.py class InpaintModel (line 20) | class InpaintModel: method __init__ (line 27) | def __init__(self, device, **kwargs): method init_model (line 38) | def init_model(self, device, **kwargs): ... method is_downloaded (line 42) | def is_downloaded() -> bool: method forward (line 46) | def forward(self, image, mask, config: InpaintRequest): method download (line 55) | def download(): ... method _pad_forward (line 57) | def _pad_forward(self, image, mask, config: InpaintRequest): method forward_pre_process (line 80) | def forward_pre_process(self, image, mask, config): method forward_post_process (line 83) | def forward_post_process(self, result, image, mask, config): method __call__ (line 87) | def __call__(self, image, mask, config: InpaintRequest): method _crop_box (line 142) | def _crop_box(self, image, mask, box, config: InpaintRequest): method _calculate_cdf (line 194) | def _calculate_cdf(self, histogram): method _calculate_lookup (line 199) | def _calculate_lookup(self, source_cdf, reference_cdf): method _match_histograms (line 210) | def _match_histograms(self, source, reference, mask): method _apply_cropper (line 237) | def _apply_cropper(self, image, mask, config: InpaintRequest): method _run_box (line 257) | def _run_box(self, image, mask, box, config: InpaintRequest): class DiffusionInpaintModel (line 273) | class DiffusionInpaintModel(InpaintModel): method __init__ (line 274) | def __init__(self, device, **kwargs): method __call__ (line 280) | def __call__(self, image, mask, config: InpaintRequest): method _do_outpainting (line 299) | def _do_outpainting(self, image, config: InpaintRequest): method _scaled_pad_forward (line 363) | def _scaled_pad_forward(self, image, mask, config: InpaintRequest): method set_scheduler (line 382) | def set_scheduler(self, config: InpaintRequest): method forward_pre_process (line 391) | def forward_pre_process(self, image, mask, config): method forward_post_process (line 398) | def forward_post_process(self, result, image, mask, config): FILE: iopaint/model/brushnet/brushnet.py class BrushNetOutput (line 31) | class BrushNetOutput(BaseOutput): class BrushNetModel (line 55) | class BrushNetModel(ModelMixin, ConfigMixin): method __init__ (line 132) | def __init__( method from_unet (line 445) | def from_unet( method attn_processors (line 526) | def attn_processors(self) -> Dict[str, AttentionProcessor]: method set_attn_processor (line 550) | def set_attn_processor(self, processor: Union[AttentionProcessor, Dict... method set_default_attn_processor (line 585) | def set_default_attn_processor(self): method set_attention_slice (line 601) | def set_attention_slice(self, slice_size: Union[str, int, List[int]]) ... method _set_gradient_checkpointing (line 666) | def _set_gradient_checkpointing(self, module, value: bool = False) -> ... method forward (line 670) | def forward( function zero_module (line 923) | def zero_module(module): FILE: iopaint/model/brushnet/brushnet_unet_forward.py function brushnet_unet_forward (line 13) | def brushnet_unet_forward( FILE: iopaint/model/brushnet/brushnet_wrapper.py class BrushNetWrapper (line 27) | class BrushNetWrapper(DiffusionInpaintModel): method init_model (line 31) | def init_model(self, device: torch.device, **kwargs): method switch_brushnet_method (line 136) | def switch_brushnet_method(self, new_method: str): method forward (line 145) | def forward(self, image, mask, config: InpaintRequest): FILE: iopaint/model/brushnet/brushnet_xl_wrapper.py class BrushNetXLWrapper (line 28) | class BrushNetXLWrapper(DiffusionInpaintModel): method init_model (line 34) | def init_model(self, device: torch.device, **kwargs): method switch_brushnet_method (line 140) | def switch_brushnet_method(self, new_method: str): method forward (line 149) | def forward(self, image, mask, config: InpaintRequest): FILE: iopaint/model/brushnet/pipeline_brushnet.py function retrieve_timesteps (line 85) | def retrieve_timesteps( class StableDiffusionBrushNetPipeline (line 129) | class StableDiffusionBrushNetPipeline( method __init__ (line 177) | def __init__( method _encode_prompt (line 224) | def _encode_prompt( method encode_prompt (line 257) | def encode_prompt( method encode_image (line 439) | def encode_image(self, image, device, num_images_per_prompt, output_hi... method prepare_ip_adapter_image_embeds (line 464) | def prepare_ip_adapter_image_embeds( method run_safety_checker (line 516) | def run_safety_checker(self, image, device, dtype): method decode_latents (line 531) | def decode_latents(self, latents): method prepare_extra_step_kwargs (line 543) | def prepare_extra_step_kwargs(self, generator, eta): method check_inputs (line 560) | def check_inputs( method check_image (line 675) | def check_image(self, image, mask, prompt, prompt_embeds): method prepare_image (line 731) | def prepare_image( method prepare_latents (line 762) | def prepare_latents(self, batch_size, num_channels_latents, height, wi... method get_guidance_scale_embedding (line 780) | def get_guidance_scale_embedding(self, w, embedding_dim=512, dtype=tor... method guidance_scale (line 809) | def guidance_scale(self): method clip_skip (line 813) | def clip_skip(self): method do_classifier_free_guidance (line 820) | def do_classifier_free_guidance(self): method cross_attention_kwargs (line 824) | def cross_attention_kwargs(self): method num_timesteps (line 828) | def num_timesteps(self): method __call__ (line 833) | def __call__( FILE: iopaint/model/brushnet/pipeline_brushnet_sd_xl.py class StableDiffusionXLBrushNetPipeline (line 103) | class StableDiffusionXLBrushNetPipeline( method __init__ (line 166) | def __init__( method encode_prompt (line 213) | def encode_prompt( method encode_image (line 448) | def encode_image(self, image, device, num_images_per_prompt, output_hi... method prepare_ip_adapter_image_embeds (line 473) | def prepare_ip_adapter_image_embeds( method prepare_extra_step_kwargs (line 525) | def prepare_extra_step_kwargs(self, generator, eta): method check_inputs (line 542) | def check_inputs( method check_image (line 733) | def check_image(self, image, mask, prompt, prompt_embeds): method prepare_image (line 791) | def prepare_image( method prepare_latents (line 822) | def prepare_latents(self, batch_size, num_channels_latents, height, wi... method _get_add_time_ids (line 840) | def _get_add_time_ids( method upcast_vae (line 859) | def upcast_vae(self): method get_guidance_scale_embedding (line 879) | def get_guidance_scale_embedding(self, w, embedding_dim=512, dtype=tor... method guidance_scale (line 908) | def guidance_scale(self): method clip_skip (line 912) | def clip_skip(self): method do_classifier_free_guidance (line 919) | def do_classifier_free_guidance(self): method cross_attention_kwargs (line 923) | def cross_attention_kwargs(self): method denoising_end (line 927) | def denoising_end(self): method num_timesteps (line 931) | def num_timesteps(self): method __call__ (line 936) | def __call__( FILE: iopaint/model/brushnet/unet_2d_blocks.py class MidBlock2D (line 10) | class MidBlock2D(nn.Module): method __init__ (line 11) | def __init__( method forward (line 66) | def forward( function DownBlock2D_forward (line 98) | def DownBlock2D_forward( function CrossAttnDownBlock2D_forward (line 141) | def CrossAttnDownBlock2D_forward( function CrossAttnUpBlock2D_forward (line 217) | def CrossAttnUpBlock2D_forward( function UpBlock2D_forward (line 314) | def UpBlock2D_forward( FILE: iopaint/model/controlnet.py class ControlNet (line 26) | class ControlNet(DiffusionInpaintModel): method lcm_lora_id (line 32) | def lcm_lora_id(self): method init_model (line 45) | def init_model(self, device: torch.device, **kwargs): method switch_controlnet_method (line 139) | def switch_controlnet_method(self, new_method: str): method _get_control_image (line 148) | def _get_control_image(self, image, mask): method forward (line 161) | def forward(self, image, mask, config: InpaintRequest): FILE: iopaint/model/ddim_sampler.py class DDIMSampler (line 10) | class DDIMSampler(object): method __init__ (line 11) | def __init__(self, model, schedule="linear"): method register_buffer (line 17) | def register_buffer(self, name, attr): method make_schedule (line 20) | def make_schedule( method sample (line 82) | def sample(self, steps, conditioning, batch_size, shape): method ddim_sampling (line 99) | def ddim_sampling( method p_sample_ddim (line 144) | def p_sample_ddim( FILE: iopaint/model/fcf.py function upfirdn2d (line 39) | def upfirdn2d(x, f, up=1, down=1, padding=0, flip_filter=False, gain=1, ... function _upfirdn2d_ref (line 46) | def _upfirdn2d_ref(x, f, up=1, down=1, padding=0, flip_filter=False, gai... class EncoderEpilogue (line 94) | class EncoderEpilogue(torch.nn.Module): method __init__ (line 95) | def __init__( method forward (line 139) | def forward(self, x, cmap, force_fp32=False): class EncoderBlock (line 162) | class EncoderBlock(torch.nn.Module): method __init__ (line 163) | def __init__( method forward (line 252) | def forward(self, x, img, force_fp32=False): class EncoderNetwork (line 292) | class EncoderNetwork(torch.nn.Module): method __init__ (line 293) | def __init__( method forward (line 369) | def forward(self, img, c, **block_kwargs): function fma (line 390) | def fma(a, b, c): # => a * b + c class _FusedMultiplyAdd (line 394) | class _FusedMultiplyAdd(torch.autograd.Function): # a * b + c method forward (line 396) | def forward(ctx, a, b, c): # pylint: disable=arguments-differ method backward (line 403) | def backward(ctx, dout): # pylint: disable=arguments-differ function _unbroadcast (line 422) | def _unbroadcast(x, shape): function modulated_conv2d (line 438) | def modulated_conv2d( class SynthesisLayer (line 516) | class SynthesisLayer(torch.nn.Module): method __init__ (line 517) | def __init__( method forward (line 560) | def forward(self, x, w, noise_mode="none", fused_modconv=True, gain=1): class ToRGBLayer (line 599) | class ToRGBLayer(torch.nn.Module): method __init__ (line 600) | def __init__( method forward (line 623) | def forward(self, x, w, fused_modconv=True): class SynthesisForeword (line 636) | class SynthesisForeword(torch.nn.Module): method __init__ (line 637) | def __init__( method forward (line 668) | def forward(self, x, ws, feats, img, force_fp32=False): class SELayer (line 703) | class SELayer(nn.Module): method __init__ (line 704) | def __init__(self, channel, reduction=16): method forward (line 714) | def forward(self, x): class FourierUnit (line 722) | class FourierUnit(nn.Module): method __init__ (line 723) | def __init__( method forward (line 764) | def forward(self, x): class SpectralTransform (line 840) | class SpectralTransform(nn.Module): method __init__ (line 841) | def __init__( method forward (line 873) | def forward(self, x): class FFC (line 896) | class FFC(nn.Module): method __init__ (line 897) | def __init__( method forward (line 982) | def forward(self, x, fname=None): class FFC_BN_ACT (line 1007) | class FFC_BN_ACT(nn.Module): method __init__ (line 1008) | def __init__( method forward (line 1053) | def forward(self, x, fname=None): class FFCResnetBlock (line 1063) | class FFCResnetBlock(nn.Module): method __init__ (line 1064) | def __init__( method forward (line 1103) | def forward(self, x, fname=None): class ConcatTupleLayer (line 1124) | class ConcatTupleLayer(nn.Module): method forward (line 1125) | def forward(self, x): class FFCBlock (line 1134) | class FFCBlock(torch.nn.Module): method __init__ (line 1135) | def __init__( method forward (line 1163) | def forward(self, gen_ft, mask, fname=None): class FFCSkipLayer (line 1179) | class FFCSkipLayer(torch.nn.Module): method __init__ (line 1180) | def __init__( method forward (line 1199) | def forward(self, gen_ft, mask, fname=None): class SynthesisBlock (line 1204) | class SynthesisBlock(torch.nn.Module): method __init__ (line 1205) | def __init__( method forward (line 1296) | def forward( class SynthesisNetwork (line 1384) | class SynthesisNetwork(torch.nn.Module): method __init__ (line 1385) | def __init__( method forward (line 1439) | def forward(self, x_global, mask, feats, ws, fname=None, **block_kwargs): class MappingNetwork (line 1472) | class MappingNetwork(torch.nn.Module): method __init__ (line 1473) | def __init__( method forward (line 1520) | def forward( class Generator (line 1562) | class Generator(torch.nn.Module): method __init__ (line 1563) | def __init__( method forward (line 1599) | def forward( class FcF (line 1624) | class FcF(InpaintModel): method init_model (line 1631) | def init_model(self, device, **kwargs): method download (line 1660) | def download(): method is_downloaded (line 1664) | def is_downloaded() -> bool: method __call__ (line 1668) | def __call__(self, image, mask, config: InpaintRequest): method forward (line 1708) | def forward(self, image, mask, config: InpaintRequest): FILE: iopaint/model/helper/controlnet_preprocess.py function make_canny_control_image (line 10) | def make_canny_control_image(image: np.ndarray) -> Image: function make_openpose_control_image (line 19) | def make_openpose_control_image(image: np.ndarray) -> Image: function resize_image (line 27) | def resize_image(input_image, resolution): function make_depth_control_image (line 44) | def make_depth_control_image(image: np.ndarray) -> Image: function make_inpaint_control_image (line 59) | def make_inpaint_control_image(image: np.ndarray, mask: np.ndarray) -> t... FILE: iopaint/model/helper/cpu_text_encoder.py class CPUTextEncoderWrapper (line 7) | class CPUTextEncoderWrapper(PreTrainedModel): method __init__ (line 8) | def __init__(self, text_encoder, torch_dtype): method __call__ (line 19) | def __call__(self, x, **kwargs): method dtype (line 32) | def dtype(self): method device (line 36) | def device(self) -> torch.device: FILE: iopaint/model/helper/g_diffuser_bot.py function expand_image (line 5) | def expand_image(cv2_img, top: int, right: int, bottom: int, left: int): FILE: iopaint/model/instruct_pix2pix.py class InstructPix2Pix (line 12) | class InstructPix2Pix(DiffusionInpaintModel): method init_model (line 17) | def init_model(self, device: torch.device, **kwargs): method forward (line 44) | def forward(self, image, mask, config: InpaintRequest): FILE: iopaint/model/kandinsky.py class Kandinsky (line 12) | class Kandinsky(DiffusionInpaintModel): method init_model (line 16) | def init_model(self, device: torch.device, **kwargs): method forward (line 32) | def forward(self, image, mask, config: InpaintRequest): class Kandinsky22 (line 64) | class Kandinsky22(Kandinsky): FILE: iopaint/model/lama.py class LaMa (line 31) | class LaMa(InpaintModel): method download (line 37) | def download(): method init_model (line 40) | def init_model(self, device, **kwargs): method is_downloaded (line 44) | def is_downloaded() -> bool: method forward (line 47) | def forward(self, image, mask, config: InpaintRequest): class AnimeLaMa (line 68) | class AnimeLaMa(LaMa): method download (line 72) | def download(): method init_model (line 75) | def init_model(self, device, **kwargs): method is_downloaded (line 81) | def is_downloaded() -> bool: FILE: iopaint/model/ldm.py class DDPM (line 51) | class DDPM(nn.Module): method __init__ (line 53) | def __init__( method register_schedule (line 84) | def register_schedule( class LatentDiffusion (line 177) | class LatentDiffusion(DDPM): method __init__ (line 178) | def __init__( method make_cond_schedule (line 200) | def make_cond_schedule( method register_schedule (line 213) | def register_schedule( method apply_model (line 230) | def apply_model(self, x_noisy, t, cond): class LDM (line 237) | class LDM(InpaintModel): method __init__ (line 242) | def __init__(self, device, fp16: bool = True, **kwargs): method init_model (line 247) | def init_model(self, device, **kwargs): method download (line 265) | def download(): method is_downloaded (line 271) | def is_downloaded() -> bool: method forward (line 280) | def forward(self, image, mask, config: InpaintRequest): method _norm (line 335) | def _norm(self, tensor): FILE: iopaint/model/manga.py class Manga (line 32) | class Manga(InpaintModel): method init_model (line 37) | def init_model(self, device, **kwargs): method download (line 47) | def download(): method is_downloaded (line 52) | def is_downloaded() -> bool: method forward (line 59) | def forward(self, image, mask, config: InpaintRequest): FILE: iopaint/model/mat.py class ModulatedConv2d (line 34) | class ModulatedConv2d(nn.Module): method __init__ (line 35) | def __init__( method forward (line 69) | def forward(self, x, style): class StyleConv (line 96) | class StyleConv(torch.nn.Module): method __init__ (line 97) | def __init__( method forward (line 140) | def forward(self, x, style, noise_mode="random", gain=1): class ToRGB (line 165) | class ToRGB(torch.nn.Module): method __init__ (line 166) | def __init__( method forward (line 191) | def forward(self, x, style, skip=None): function get_style_code (line 203) | def get_style_code(a, b): class DecBlockFirst (line 207) | class DecBlockFirst(nn.Module): method __init__ (line 208) | def __init__( method forward (line 242) | def forward(self, x, ws, gs, E_features, noise_mode="random"): class DecBlockFirstV2 (line 253) | class DecBlockFirstV2(nn.Module): method __init__ (line 254) | def __init__( method forward (line 289) | def forward(self, x, ws, gs, E_features, noise_mode="random"): method __init__ (line 1280) | def __init__( method forward (line 1318) | def forward(self, x, ws, gs, E_features, noise_mode="random"): class DecBlock (line 301) | class DecBlock(nn.Module): method __init__ (line 302) | def __init__( method forward (line 345) | def forward(self, x, img, ws, gs, E_features, noise_mode="random"): method __init__ (line 1331) | def __init__( method forward (line 1374) | def forward(self, x, img, ws, gs, E_features, noise_mode="random"): class MappingNet (line 357) | class MappingNet(torch.nn.Module): method __init__ (line 358) | def __init__( method forward (line 407) | def forward( class DisFromRGB (line 444) | class DisFromRGB(nn.Module): method __init__ (line 445) | def __init__( method forward (line 456) | def forward(self, x): class DisBlock (line 460) | class DisBlock(nn.Module): method __init__ (line 461) | def __init__( method forward (line 486) | def forward(self, x): class Discriminator (line 495) | class Discriminator(torch.nn.Module): method __init__ (line 496) | def __init__( method forward (line 554) | def forward(self, images_in, masks_in, c): method __init__ (line 1770) | def __init__( method forward (line 1851) | def forward(self, images_in, masks_in, images_stg1, c): function nf (line 568) | def nf(stage, channel_base=32768, channel_decay=1.0, channel_max=512): class Mlp (line 573) | class Mlp(nn.Module): method __init__ (line 574) | def __init__( method forward (line 592) | def forward(self, x): function window_partition (line 598) | def window_partition(x, window_size): function window_reverse (line 614) | def window_reverse(windows, window_size: int, H: int, W: int): class Conv2dLayerPartial (line 633) | class Conv2dLayerPartial(nn.Module): method __init__ (line 634) | def __init__( method forward (line 671) | def forward(self, x, mask=None): class WindowAttention (line 694) | class WindowAttention(nn.Module): method __init__ (line 707) | def __init__( method forward (line 732) | def forward(self, x, mask_windows=None, mask=None): class SwinTransformerBlock (line 781) | class SwinTransformerBlock(nn.Module): method __init__ (line 799) | def __init__( method calculate_mask (line 863) | def calculate_mask(self, x_size): method forward (line 894) | def forward(self, x, x_size, mask=None): class PatchMerging (line 975) | class PatchMerging(nn.Module): method __init__ (line 976) | def __init__(self, in_channels, out_channels, down=2): method forward (line 987) | def forward(self, x, x_size, mask=None): class PatchUpsampling (line 1001) | class PatchUpsampling(nn.Module): method __init__ (line 1002) | def __init__(self, in_channels, out_channels, up=2): method forward (line 1013) | def forward(self, x, x_size, mask=None): class BasicLayer (line 1026) | class BasicLayer(nn.Module): method __init__ (line 1045) | def __init__( method forward (line 1104) | def forward(self, x, x_size, mask=None): class ToToken (line 1122) | class ToToken(nn.Module): method __init__ (line 1123) | def __init__(self, in_channels=3, dim=128, kernel_size=5, stride=1): method forward (line 1133) | def forward(self, x, mask): class EncFromRGB (line 1139) | class EncFromRGB(nn.Module): method __init__ (line 1140) | def __init__( method forward (line 1157) | def forward(self, x): class ConvBlockDown (line 1164) | class ConvBlockDown(nn.Module): method __init__ (line 1165) | def __init__( method forward (line 1184) | def forward(self, x): function token2feature (line 1191) | def token2feature(x, x_size): function feature2token (line 1198) | def feature2token(x): class Encoder (line 1204) | class Encoder(nn.Module): method __init__ (line 1205) | def __init__( method forward (line 1227) | def forward(self, x): class ToStyle (line 1237) | class ToStyle(nn.Module): method __init__ (line 1238) | def __init__(self, in_channels, out_channels, activation, drop_rate): method forward (line 1270) | def forward(self, x): class DecBlockFirstV2 (line 1279) | class DecBlockFirstV2(nn.Module): method __init__ (line 254) | def __init__( method forward (line 289) | def forward(self, x, ws, gs, E_features, noise_mode="random"): method __init__ (line 1280) | def __init__( method forward (line 1318) | def forward(self, x, ws, gs, E_features, noise_mode="random"): class DecBlock (line 1330) | class DecBlock(nn.Module): method __init__ (line 302) | def __init__( method forward (line 345) | def forward(self, x, img, ws, gs, E_features, noise_mode="random"): method __init__ (line 1331) | def __init__( method forward (line 1374) | def forward(self, x, img, ws, gs, E_features, noise_mode="random"): class Decoder (line 1386) | class Decoder(nn.Module): method __init__ (line 1387) | def __init__( method forward (line 1411) | def forward(self, x, ws, gs, E_features, noise_mode="random"): class DecStyleBlock (line 1420) | class DecStyleBlock(nn.Module): method __init__ (line 1421) | def __init__( method forward (line 1464) | def forward(self, x, img, style, skip, noise_mode="random"): class FirstStage (line 1473) | class FirstStage(nn.Module): method __init__ (line 1474) | def __init__( method forward (line 1577) | def forward(self, images_in, masks_in, ws, noise_mode="random"): class SynthesisNet (line 1632) | class SynthesisNet(nn.Module): method __init__ (line 1633) | def __init__( method forward (line 1681) | def forward(self, images_in, masks_in, ws, noise_mode="random", return... class Generator (line 1714) | class Generator(nn.Module): method __init__ (line 1715) | def __init__( method forward (line 1746) | def forward( class Discriminator (line 1769) | class Discriminator(torch.nn.Module): method __init__ (line 496) | def __init__( method forward (line 554) | def forward(self, images_in, masks_in, c): method __init__ (line 1770) | def __init__( method forward (line 1851) | def forward(self, images_in, masks_in, images_stg1, c): class MAT (line 1878) | class MAT(InpaintModel): method init_model (line 1885) | def init_model(self, device, **kwargs): method download (line 1908) | def download(): method is_downloaded (line 1912) | def is_downloaded() -> bool: method forward (line 1915) | def forward(self, image, mask, config: InpaintRequest): FILE: iopaint/model/mi_gan.py class MIGAN (line 24) | class MIGAN(InpaintModel): method init_model (line 31) | def init_model(self, device, **kwargs): method download (line 35) | def download(): method is_downloaded (line 39) | def is_downloaded() -> bool: method __call__ (line 43) | def __call__(self, image, mask, config: InpaintRequest): method forward (line 83) | def forward(self, image, mask, config: InpaintRequest): FILE: iopaint/model/opencv2.py class OpenCV2 (line 8) | class OpenCV2(InpaintModel): method is_downloaded (line 14) | def is_downloaded() -> bool: method forward (line 17) | def forward(self, image, mask, config: InpaintRequest): FILE: iopaint/model/original_sd_configs/__init__.py function get_config_files (line 7) | def get_config_files() -> Dict[str, Path]: FILE: iopaint/model/paint_by_example.py class PaintByExample (line 13) | class PaintByExample(DiffusionInpaintModel): method init_model (line 18) | def init_model(self, device: torch.device, **kwargs): method forward (line 44) | def forward(self, image, mask, config: InpaintRequest): FILE: iopaint/model/plms_sampler.py class PLMSSampler (line 8) | class PLMSSampler(object): method __init__ (line 9) | def __init__(self, model, schedule="linear", **kwargs): method register_buffer (line 15) | def register_buffer(self, name, attr): method make_schedule (line 18) | def make_schedule(self, ddim_num_steps, ddim_discretize="uniform", ddi... method sample (line 52) | def sample(self, method plms_sampling (line 109) | def plms_sampling(self, cond, shape, method p_sample_plms (line 162) | def p_sample_plms(self, x, c, t, index, repeat_noise=False, use_origin... FILE: iopaint/model/power_paint/pipeline_powerpaint.py function prepare_mask_and_masked_image (line 53) | def prepare_mask_and_masked_image( class StableDiffusionInpaintPipeline (line 188) | class StableDiffusionInpaintPipeline( method __init__ (line 223) | def __init__( method enable_model_cpu_offload (line 342) | def enable_model_cpu_offload(self, gpu_id=0): method _encode_prompt (line 377) | def _encode_prompt( method run_safety_checker (line 608) | def run_safety_checker(self, image, device, dtype): method prepare_extra_step_kwargs (line 627) | def prepare_extra_step_kwargs(self, generator, eta): method check_inputs (line 648) | def check_inputs( method prepare_latents (line 708) | def prepare_latents( method _encode_vae_image (line 774) | def _encode_vae_image(self, image: torch.Tensor, generator: torch.Gene... method prepare_mask_latents (line 792) | def prepare_mask_latents( method get_timesteps (line 847) | def get_timesteps(self, num_inference_steps, strength, device): method __call__ (line 857) | def __call__( FILE: iopaint/model/power_paint/power_paint.py class PowerPaint (line 20) | class PowerPaint(DiffusionInpaintModel): method init_model (line 26) | def init_model(self, device: torch.device, **kwargs): method forward (line 66) | def forward(self, image, mask, config: InpaintRequest): FILE: iopaint/model/power_paint/power_paint_v2.py class PowerPaintV2 (line 31) | class PowerPaintV2(DiffusionInpaintModel): method init_model (line 37) | def init_model(self, device: torch.device, **kwargs): method forward (line 144) | def forward(self, image, mask, config: InpaintRequest): FILE: iopaint/model/power_paint/powerpaint_tokenizer.py function add_task_to_prompt (line 9) | def add_task_to_prompt(prompt, negative_prompt, task: PowerPaintTask): function task_to_prompt (line 39) | def task_to_prompt(task: PowerPaintTask): class PowerPaintTokenizer (line 51) | class PowerPaintTokenizer: method __init__ (line 52) | def __init__(self, tokenizer: CLIPTokenizer): method __getattr__ (line 64) | def __getattr__(self, name: str) -> Any: method try_adding_tokens (line 80) | def try_adding_tokens(self, tokens: Union[str, List[str]], *args, **kw... method get_token_info (line 93) | def get_token_info(self, token: str) -> dict: method add_placeholder_token (line 108) | def add_placeholder_token( method replace_placeholder_tokens_in_text (line 139) | def replace_placeholder_tokens_in_text( method replace_text_with_placeholder_tokens (line 178) | def replace_text_with_placeholder_tokens( method __call__ (line 202) | def __call__( method encode (line 226) | def encode(self, text: Union[str, List[str]], *args, **kwargs): method decode (line 236) | def decode( FILE: iopaint/model/power_paint/v2/BrushNet_CA.py class BrushNetOutput (line 37) | class BrushNetOutput(BaseOutput): class BrushNetModel (line 61) | class BrushNetModel(ModelMixin, ConfigMixin): method __init__ (line 138) | def __init__( method from_unet (line 496) | def from_unet( method attn_processors (line 621) | def attn_processors(self) -> Dict[str, AttentionProcessor]: method set_attn_processor (line 651) | def set_attn_processor( method set_default_attn_processor (line 688) | def set_default_attn_processor(self): method set_attention_slice (line 710) | def set_attention_slice(self, slice_size: Union[str, int, List[int]]) ... method _set_gradient_checkpointing (line 781) | def _set_gradient_checkpointing(self, module, value: bool = False) -> ... method forward (line 785) | def forward( function zero_module (line 1091) | def zero_module(module): FILE: iopaint/model/power_paint/v2/pipeline_PowerPaint_Brushnet_CA.py function retrieve_timesteps (line 103) | def retrieve_timesteps( class StableDiffusionPowerPaintBrushNetPipeline (line 149) | class StableDiffusionPowerPaintBrushNetPipeline( method __init__ (line 197) | def __init__( method _encode_prompt (line 248) | def _encode_prompt( method encode_prompt (line 479) | def encode_prompt( method encode_image (line 691) | def encode_image( method prepare_ip_adapter_image_embeds (line 724) | def prepare_ip_adapter_image_embeds( method run_safety_checker (line 794) | def run_safety_checker(self, image, device, dtype): method decode_latents (line 813) | def decode_latents(self, latents): method prepare_extra_step_kwargs (line 825) | def prepare_extra_step_kwargs(self, generator, eta): method check_inputs (line 846) | def check_inputs( method check_image (line 974) | def check_image(self, image, mask, prompt, prompt_embeds): method prepare_image (line 1038) | def prepare_image( method prepare_latents (line 1071) | def prepare_latents( method get_guidance_scale_embedding (line 1104) | def get_guidance_scale_embedding(self, w, embedding_dim=512, dtype=tor... method guidance_scale (line 1133) | def guidance_scale(self): method clip_skip (line 1137) | def clip_skip(self): method do_classifier_free_guidance (line 1144) | def do_classifier_free_guidance(self): method cross_attention_kwargs (line 1148) | def cross_attention_kwargs(self): method num_timesteps (line 1152) | def num_timesteps(self): method __call__ (line 1157) | def __call__( FILE: iopaint/model/power_paint/v2/unet_2d_blocks.py function CrossAttnDownBlock2D_forward (line 23) | def CrossAttnDownBlock2D_forward( function DownBlock2D_forward (line 107) | def DownBlock2D_forward( function CrossAttnUpBlock2D_forward (line 158) | def CrossAttnUpBlock2D_forward( function UpBlock2D_forward (line 261) | def UpBlock2D_forward( FILE: iopaint/model/power_paint/v2/unet_2d_condition.py function UNet2DConditionModel_forward (line 30) | def UNet2DConditionModel_forward( FILE: iopaint/model/sd.py class SD (line 18) | class SD(DiffusionInpaintModel): method init_model (line 23) | def init_model(self, device: torch.device, **kwargs): method forward (line 82) | def forward(self, image, mask, config: InpaintRequest): class SD15 (line 112) | class SD15(SD): class Anything4 (line 117) | class Anything4(SD): class RealisticVision14 (line 122) | class RealisticVision14(SD): class SD2 (line 127) | class SD2(SD): FILE: iopaint/model/sdxl.py class SDXL (line 22) | class SDXL(DiffusionInpaintModel): method init_model (line 29) | def init_model(self, device: torch.device, **kwargs): method forward (line 83) | def forward(self, image, mask, config: InpaintRequest): FILE: iopaint/model/utils.py function make_beta_schedule (line 32) | def make_beta_schedule( function make_ddim_sampling_parameters (line 67) | def make_ddim_sampling_parameters(alphacums, ddim_timesteps, eta, verbos... function make_ddim_timesteps (line 87) | def make_ddim_timesteps( function noise_like (line 110) | def noise_like(shape, device, repeat=False): function timestep_embedding (line 118) | def timestep_embedding(device, timesteps, dim, max_period=10000, repeat_... function normalize_2nd_moment (line 145) | def normalize_2nd_moment(x, dim=1): class EasyDict (line 151) | class EasyDict(dict): method __getattr__ (line 154) | def __getattr__(self, name: str) -> Any: method __setattr__ (line 160) | def __setattr__(self, name: str, value: Any) -> None: method __delattr__ (line 163) | def __delattr__(self, name: str) -> None: function _bias_act_ref (line 167) | def _bias_act_ref(x, b=None, dim=1, act="linear", alpha=None, gain=None,... function bias_act (line 198) | def bias_act( function _get_filter_size (line 237) | def _get_filter_size(f): function _get_weight_shape (line 251) | def _get_weight_shape(w): function _parse_scaling (line 256) | def _parse_scaling(scaling): function _parse_padding (line 266) | def _parse_padding(padding): function setup_filter (line 278) | def setup_filter( function _ntuple (line 332) | def _ntuple(n): function upfirdn2d (line 419) | def upfirdn2d(x, f, up=1, down=1, padding=0, flip_filter=False, gain=1, ... function _upfirdn2d_ref (line 466) | def _upfirdn2d_ref(x, f, up=1, down=1, padding=0, flip_filter=False, gai... function downsample2d (line 519) | def downsample2d(x, f, down=2, padding=0, flip_filter=False, gain=1, imp... function upsample2d (line 561) | def upsample2d(x, f, up=2, padding=0, flip_filter=False, gain=1, impl="c... class MinibatchStdLayer (line 609) | class MinibatchStdLayer(torch.nn.Module): method __init__ (line 610) | def __init__(self, group_size, num_channels=1): method forward (line 615) | def forward(self, x): class FullyConnectedLayer (line 638) | class FullyConnectedLayer(torch.nn.Module): method __init__ (line 639) | def __init__( method forward (line 662) | def forward(self, x): function _conv2d_wrapper (line 678) | def _conv2d_wrapper( function conv2d_resample (line 717) | def conv2d_resample( class Conv2dLayer (line 854) | class Conv2dLayer(torch.nn.Module): method __init__ (line 855) | def __init__( method forward (line 901) | def forward(self, x, gain=1): function torch_gc (line 920) | def torch_gc(): function set_seed (line 927) | def set_seed(seed: int): function get_scheduler (line 934) | def get_scheduler(sd_sampler, scheduler_config): function is_local_files_only (line 974) | def is_local_files_only(**kwargs) -> bool: function handle_from_pretrained_exceptions (line 980) | def handle_from_pretrained_exceptions(func, **kwargs): function get_torch_dtype (line 1009) | def get_torch_dtype(device, no_half: bool): function enable_low_mem (line 1021) | def enable_low_mem(pipe, enable: bool): FILE: iopaint/model/zits.py function resize (line 47) | def resize(img, height, width, center_crop=False): function to_tensor (line 66) | def to_tensor(img, scale=True, norm=False): function load_masked_position_encoding (line 83) | def load_masked_position_encoding(mask): function load_image (line 146) | def load_image(img, mask, device, sigma256=3.0): function to_device (line 212) | def to_device(data, device): class ZITS (line 224) | class ZITS(InpaintModel): method __init__ (line 231) | def __init__(self, device, **kwargs): method init_model (line 241) | def init_model(self, device, **kwargs): method download (line 256) | def download(): method is_downloaded (line 265) | def is_downloaded() -> bool: method wireframe_edge_and_line (line 274) | def wireframe_edge_and_line(self, items, enable: bool): method forward (line 346) | def forward(self, image, mask, config: InpaintRequest): method wireframe_forward (line 377) | def wireframe_forward(self, images, h, w, masks, mask_th=0.925): method sample_edge_line_logits (line 430) | def sample_edge_line_logits( FILE: iopaint/model_manager.py class ModelManager (line 17) | class ModelManager: method __init__ (line 18) | def __init__(self, name: str, device: torch.device, **kwargs): method current_model (line 43) | def current_model(self) -> ModelInfo: method init_model (line 46) | def init_model(self, name: str, device, **kwargs): method __call__ (line 93) | def __call__(self, image, mask, config: InpaintRequest): method scan_models (line 113) | def scan_models(self) -> List[ModelInfo]: method switch (line 118) | def switch(self, new_name: str): method switch_brushnet_method (line 149) | def switch_brushnet_method(self, config): method switch_controlnet_method (line 193) | def switch_controlnet_method(self, config): method enable_disable_powerpaint_v2 (line 231) | def enable_disable_powerpaint_v2(self, config: InpaintRequest): method enable_disable_lcm_lora (line 250) | def enable_disable_lcm_lora(self, config: InpaintRequest): FILE: iopaint/plugins/__init__.py function build_plugins (line 14) | def build_plugins( FILE: iopaint/plugins/anime_seg.py class REBNCONV (line 13) | class REBNCONV(nn.Module): method __init__ (line 14) | def __init__(self, in_ch=3, out_ch=3, dirate=1, stride=1): method forward (line 23) | def forward(self, x): function _upsample_like (line 31) | def _upsample_like(src, tar): class RSU7 (line 38) | class RSU7(nn.Module): method __init__ (line 39) | def __init__(self, in_ch=3, mid_ch=12, out_ch=3, img_size=512): method forward (line 74) | def forward(self, x): class RSU6 (line 120) | class RSU6(nn.Module): method __init__ (line 121) | def __init__(self, in_ch=3, mid_ch=12, out_ch=3): method forward (line 148) | def forward(self, x): class RSU5 (line 187) | class RSU5(nn.Module): method __init__ (line 188) | def __init__(self, in_ch=3, mid_ch=12, out_ch=3): method forward (line 211) | def forward(self, x): class RSU4 (line 244) | class RSU4(nn.Module): method __init__ (line 245) | def __init__(self, in_ch=3, mid_ch=12, out_ch=3): method forward (line 264) | def forward(self, x): class RSU4F (line 291) | class RSU4F(nn.Module): method __init__ (line 292) | def __init__(self, in_ch=3, mid_ch=12, out_ch=3): method forward (line 307) | def forward(self, x): class ISNetDIS (line 325) | class ISNetDIS(nn.Module): method __init__ (line 326) | def __init__(self, in_ch=3, out_ch=1): method forward (line 358) | def forward(self, x): class AnimeSeg (line 416) | class AnimeSeg(BasePlugin): method __init__ (line 422) | def __init__(self): method gen_image (line 431) | def gen_image(self, rgb_np_img, req: RunPluginRequest) -> np.ndarray: method gen_mask (line 440) | def gen_mask(self, rgb_np_img, req: RunPluginRequest) -> np.ndarray: method forward (line 444) | def forward(self, rgb_np_img): FILE: iopaint/plugins/base_plugin.py class BasePlugin (line 7) | class BasePlugin: method __init__ (line 12) | def __init__(self): method gen_image (line 18) | def gen_image(self, rgb_np_img, req: RunPluginRequest) -> np.ndarray: method gen_mask (line 22) | def gen_mask(self, rgb_np_img, req: RunPluginRequest) -> np.ndarray: method check_dep (line 26) | def check_dep(self): method switch_model (line 29) | def switch_model(self, new_model_name: str): FILE: iopaint/plugins/basicsr/arch_util.py function default_init_weights (line 10) | def default_init_weights( function make_layer (line 45) | def make_layer( function pixel_unshuffle (line 64) | def pixel_unshuffle(x: torch.Tensor, scale: int) -> torch.Tensor: FILE: iopaint/plugins/basicsr/img_util.py function img2tensor (line 9) | def img2tensor(imgs, bgr2rgb=True, float32=True): function tensor2img (line 38) | def tensor2img(tensor, rgb2bgr=True, out_type=np.uint8, min_max=(0, 1)): function tensor2img_fast (line 97) | def tensor2img_fast(tensor, rgb2bgr=True, min_max=(0, 1)): function imfrombytes (line 114) | def imfrombytes(content, flag='color', float32=False): function imwrite (line 135) | def imwrite(img, file_path, params=None, auto_mkdir=True): function crop_border (line 156) | def crop_border(imgs, crop_border): FILE: iopaint/plugins/basicsr/rrdbnet_arch.py class ResidualDenseBlock (line 8) | class ResidualDenseBlock(nn.Module): method __init__ (line 18) | def __init__(self, num_feat: int = 64, num_grow_ch: int = 32) -> None: method forward (line 33) | def forward(self, x: torch.Tensor) -> torch.Tensor: class RRDB (line 43) | class RRDB(nn.Module): method __init__ (line 53) | def __init__(self, num_feat: int, num_grow_ch: int = 32) -> None: method forward (line 59) | def forward(self, x: torch.Tensor) -> torch.Tensor: class RRDBNet (line 67) | class RRDBNet(nn.Module): method __init__ (line 87) | def __init__( method forward (line 115) | def forward(self, x: torch.Tensor) -> torch.Tensor: FILE: iopaint/plugins/briarmbg.py class REBNCONV (line 11) | class REBNCONV(nn.Module): method __init__ (line 12) | def __init__(self, in_ch=3, out_ch=3, dirate=1, stride=1): method forward (line 21) | def forward(self, x): function _upsample_like (line 29) | def _upsample_like(src, tar): class RSU7 (line 36) | class RSU7(nn.Module): method __init__ (line 37) | def __init__(self, in_ch=3, mid_ch=12, out_ch=3, img_size=512): method forward (line 72) | def forward(self, x): class RSU6 (line 118) | class RSU6(nn.Module): method __init__ (line 119) | def __init__(self, in_ch=3, mid_ch=12, out_ch=3): method forward (line 146) | def forward(self, x): class RSU5 (line 185) | class RSU5(nn.Module): method __init__ (line 186) | def __init__(self, in_ch=3, mid_ch=12, out_ch=3): method forward (line 209) | def forward(self, x): class RSU4 (line 242) | class RSU4(nn.Module): method __init__ (line 243) | def __init__(self, in_ch=3, mid_ch=12, out_ch=3): method forward (line 262) | def forward(self, x): class RSU4F (line 289) | class RSU4F(nn.Module): method __init__ (line 290) | def __init__(self, in_ch=3, mid_ch=12, out_ch=3): method forward (line 305) | def forward(self, x): class myrebnconv (line 323) | class myrebnconv(nn.Module): method __init__ (line 324) | def __init__( method forward (line 348) | def forward(self, x): class BriaRMBG (line 352) | class BriaRMBG(nn.Module): method __init__ (line 353) | def __init__(self, in_ch=3, out_ch=1): method forward (line 392) | def forward(self, x): function resize_image (line 466) | def resize_image(image): function create_briarmbg_session (line 473) | def create_briarmbg_session(): function briarmbg_process (line 483) | def briarmbg_process(device, bgr_np_image, session, only_mask=False): FILE: iopaint/plugins/briarmbg2.py class Config (line 29) | class Config: method __init__ (line 30) | def __init__(self) -> None: method print_task (line 234) | def print_task(self) -> None: class Mlp (line 239) | class Mlp(nn.Module): method __init__ (line 240) | def __init__( method _init_weights (line 259) | def _init_weights(self, m): method forward (line 274) | def forward(self, x, H, W): method __init__ (line 871) | def __init__( method forward (line 887) | def forward(self, x): class Attention (line 284) | class Attention(nn.Module): method __init__ (line 285) | def __init__( method _init_weights (line 319) | def _init_weights(self, m): method forward (line 334) | def forward(self, x, H, W): class Block (line 384) | class Block(nn.Module): method __init__ (line 385) | def __init__( method _init_weights (line 423) | def _init_weights(self, m): method forward (line 438) | def forward(self, x, H, W): class OverlapPatchEmbed (line 445) | class OverlapPatchEmbed(nn.Module): method __init__ (line 448) | def __init__( method _init_weights (line 470) | def _init_weights(self, m): method forward (line 485) | def forward(self, x): class PyramidVisionTransformerImpr (line 494) | class PyramidVisionTransformerImpr(nn.Module): method __init__ (line 495) | def __init__( method _init_weights (line 636) | def _init_weights(self, m): method init_weights (line 651) | def init_weights(self, pretrained=None): method reset_drop_path (line 656) | def reset_drop_path(self, drop_path_rate): method freeze_patch_emb (line 674) | def freeze_patch_emb(self): method no_weight_decay (line 678) | def no_weight_decay(self): method get_classifier (line 687) | def get_classifier(self): method reset_classifier (line 690) | def reset_classifier(self, num_classes, global_pool=""): method forward_features (line 696) | def forward_features(self, x): method forward (line 736) | def forward(self, x): class DWConv (line 743) | class DWConv(nn.Module): method __init__ (line 744) | def __init__(self, dim=768): method forward (line 748) | def forward(self, x, H, W): class pvt_v2_b0 (line 757) | class pvt_v2_b0(PyramidVisionTransformerImpr): method __init__ (line 758) | def __init__(self, **kwargs): class pvt_v2_b1 (line 773) | class pvt_v2_b1(PyramidVisionTransformerImpr): method __init__ (line 774) | def __init__(self, **kwargs): class pvt_v2_b2 (line 790) | class pvt_v2_b2(PyramidVisionTransformerImpr): method __init__ (line 791) | def __init__(self, in_channels=3, **kwargs): class pvt_v2_b3 (line 808) | class pvt_v2_b3(PyramidVisionTransformerImpr): method __init__ (line 809) | def __init__(self, **kwargs): class pvt_v2_b4 (line 825) | class pvt_v2_b4(PyramidVisionTransformerImpr): method __init__ (line 826) | def __init__(self, **kwargs): class pvt_v2_b5 (line 842) | class pvt_v2_b5(PyramidVisionTransformerImpr): method __init__ (line 843) | def __init__(self, **kwargs): class Mlp (line 868) | class Mlp(nn.Module): method __init__ (line 240) | def __init__( method _init_weights (line 259) | def _init_weights(self, m): method forward (line 274) | def forward(self, x, H, W): method __init__ (line 871) | def __init__( method forward (line 887) | def forward(self, x): function window_partition (line 896) | def window_partition(x, window_size): function window_reverse (line 913) | def window_reverse(windows, window_size, H, W): class WindowAttention (line 932) | class WindowAttention(nn.Module): method __init__ (line 946) | def __init__( method forward (line 996) | def forward(self, x, mask=None): class SwinTransformerBlock (line 1063) | class SwinTransformerBlock(nn.Module): method __init__ (line 1081) | def __init__( method forward (line 1130) | def forward(self, x, mask_matrix): class PatchMerging (line 1200) | class PatchMerging(nn.Module): method __init__ (line 1208) | def __init__(self, dim, norm_layer=nn.LayerNorm): method forward (line 1214) | def forward(self, x, H, W): class BasicLayer (line 1244) | class BasicLayer(nn.Module): method __init__ (line 1263) | def __init__( method forward (line 1313) | def forward(self, x, H, W): class PatchEmbed (line 1364) | class PatchEmbed(nn.Module): method __init__ (line 1374) | def __init__(self, patch_size=4, in_channels=3, embed_dim=96, norm_lay... method forward (line 1390) | def forward(self, x): class SwinTransformer (line 1409) | class SwinTransformer(nn.Module): method __init__ (line 1438) | def __init__( method _freeze_stages (line 1530) | def _freeze_stages(self): method forward (line 1547) | def forward(self, x): method train (line 1579) | def train(self, mode=True): function swin_v1_t (line 1585) | def swin_v1_t(): function swin_v1_s (line 1592) | def swin_v1_s(): function swin_v1_b (line 1599) | def swin_v1_b(): function swin_v1_l (line 1606) | def swin_v1_l(): class DeformableConv2d (line 1620) | class DeformableConv2d(nn.Module): method __init__ (line 1621) | def __init__( method forward (line 1667) | def forward(self, x): function build_act_layer (line 1691) | def build_act_layer(act_layer): function build_norm_layer (line 1702) | def build_norm_layer( class to_channels_first (line 1723) | class to_channels_first(nn.Module): method __init__ (line 1724) | def __init__(self): method forward (line 1727) | def forward(self, x): class to_channels_last (line 1731) | class to_channels_last(nn.Module): method __init__ (line 1732) | def __init__(self): method forward (line 1735) | def forward(self, x): function build_backbone (line 1765) | def build_backbone(bb_name, pretrained=True, params_settings=""): function load_weights (line 1819) | def load_weights(model, model_name): class BasicDecBlk (line 1863) | class BasicDecBlk(nn.Module): method __init__ (line 1864) | def __init__(self, in_channels=64, out_channels=64, inter_channels=64): method forward (line 1881) | def forward(self, x): class ResBlk (line 1892) | class ResBlk(nn.Module): method __init__ (line 1893) | def __init__(self, in_channels=64, out_channels=None, inter_channels=64): method forward (line 1917) | def forward(self, x): class BasicLatBlk (line 1943) | class BasicLatBlk(nn.Module): method __init__ (line 1944) | def __init__(self, in_channels=64, out_channels=64, inter_channels=64): method forward (line 1949) | def forward(self, x): class _ASPPModule (line 1966) | class _ASPPModule(nn.Module): method __init__ (line 1967) | def __init__(self, in_channels, planes, kernel_size, padding, dilation): method forward (line 1981) | def forward(self, x): class ASPP (line 1988) | class ASPP(nn.Module): method __init__ (line 1989) | def __init__(self, in_channels=64, out_channels=None, output_stride=16): method forward (line 2042) | def forward(self, x): class _ASPPModuleDeformable (line 2059) | class _ASPPModuleDeformable(nn.Module): method __init__ (line 2060) | def __init__(self, in_channels, planes, kernel_size, padding): method forward (line 2073) | def forward(self, x): class ASPPDeformable (line 2080) | class ASPPDeformable(nn.Module): method __init__ (line 2081) | def __init__(self, in_channels, out_channels=None, parallel_block_size... method forward (line 2123) | def forward(self, x): class RefinerPVTInChannels4 (line 2140) | class RefinerPVTInChannels4(nn.Module): method __init__ (line 2141) | def __init__(self, in_channels=3 + 1): method forward (line 2166) | def forward(self, x): class Refiner (line 2188) | class Refiner(nn.Module): method __init__ (line 2189) | def __init__(self, in_channels=3 + 1): method forward (line 2220) | def forward(self, x): class Decoder (line 2243) | class Decoder(nn.Module): method __init__ (line 2244) | def __init__(self, channels): method forward (line 2265) | def forward(self, features): method __init__ (line 2608) | def __init__(self, channels): method get_patches_batch (line 2726) | def get_patches_batch(self, x, p): method forward (line 2743) | def forward(self, features): class RefUNet (line 2292) | class RefUNet(nn.Module): method __init__ (line 2294) | def __init__(self, in_channels=3 + 1): method forward (line 2350) | def forward(self, x): class StemLayer (line 2383) | class StemLayer(nn.Module): method __init__ (line 2392) | def __init__( method forward (line 2415) | def forward(self, x): class BiRefNetConfig (line 2427) | class BiRefNetConfig(PretrainedConfig): method __init__ (line 2430) | def __init__(self, bb_pretrained=False, **kwargs): class BiRefNet (line 2435) | class BiRefNet(PreTrainedModel): method __init__ (line 2438) | def __init__(self, bb_pretrained=True, config=BiRefNetConfig()): method forward_enc (line 2494) | def forward_enc(self, x): method forward_ori (line 2589) | def forward_ori(self, x): method forward (line 2601) | def forward(self, x): class Decoder (line 2607) | class Decoder(nn.Module): method __init__ (line 2244) | def __init__(self, channels): method forward (line 2265) | def forward(self, features): method __init__ (line 2608) | def __init__(self, channels): method get_patches_batch (line 2726) | def get_patches_batch(self, x, p): method forward (line 2743) | def forward(self, features): class SimpleConvs (line 2914) | class SimpleConvs(nn.Module): method __init__ (line 2915) | def __init__(self, in_channels: int, out_channels: int, inter_channels... method forward (line 2920) | def forward(self, x): function create_briarmbg2_session (line 2924) | def create_briarmbg2_session(): function briarmbg2_process (line 2929) | def briarmbg2_process(device, bgr_np_image, session, only_mask=False): FILE: iopaint/plugins/facexlib/detection/__init__.py function init_detection_model (line 8) | def init_detection_model(model_name, half=False, device='cuda', model_ro... FILE: iopaint/plugins/facexlib/detection/align_trans.py class FaceWarpException (line 13) | class FaceWarpException(Exception): method __str__ (line 15) | def __str__(self): function get_reference_facial_points (line 19) | def get_reference_facial_points(output_size=None, inner_padding_factor=0... function get_affine_transform_matrix (line 112) | def get_affine_transform_matrix(src_pts, dst_pts): function warp_and_crop_face (line 145) | def warp_and_crop_face(src_img, facial_pts, reference_pts=None, crop_siz... FILE: iopaint/plugins/facexlib/detection/matlab_cp2tform.py class MatlabCp2tormException (line 7) | class MatlabCp2tormException(Exception): method __str__ (line 9) | def __str__(self): function tformfwd (line 13) | def tformfwd(trans, uv): function tforminv (line 37) | def tforminv(trans, uv): function findNonreflectiveSimilarity (line 60) | def findNonreflectiveSimilarity(uv, xy, options=None): function findSimilarity (line 94) | def findSimilarity(uv, xy, options=None): function get_similarity_transform (line 130) | def get_similarity_transform(src_pts, dst_pts, reflective=True): function cvt_tform_mat_for_cv2 (line 170) | def cvt_tform_mat_for_cv2(trans): function get_similarity_transform_for_cv2 (line 198) | def get_similarity_transform_for_cv2(src_pts, dst_pts, reflective=True): FILE: iopaint/plugins/facexlib/detection/retinaface.py function generate_config (line 28) | def generate_config(network_name): class RetinaFace (line 75) | class RetinaFace(nn.Module): method __init__ (line 76) | def __init__(self, network_name="resnet50", half=False, phase="test", ... method forward (line 130) | def forward(self, inputs): method __detect_faces (line 163) | def __detect_faces(self, inputs): method transform (line 196) | def transform(self, image, use_origin_size): method detect_faces (line 225) | def detect_faces( method __align_multi (line 270) | def __align_multi(self, image, boxes, landmarks, limit=None): method align_multi (line 289) | def align_multi(self, img, conf_threshold=0.8, limit=None): method batched_transform (line 296) | def batched_transform(self, frames, use_origin_size): method batched_detect_faces (line 348) | def batched_detect_faces( FILE: iopaint/plugins/facexlib/detection/retinaface_net.py function conv_bn (line 6) | def conv_bn(inp, oup, stride=1, leaky=0): function conv_bn_no_relu (line 12) | def conv_bn_no_relu(inp, oup, stride): function conv_bn1X1 (line 19) | def conv_bn1X1(inp, oup, stride, leaky=0): function conv_dw (line 25) | def conv_dw(inp, oup, stride, leaky=0.1): class SSH (line 36) | class SSH(nn.Module): method __init__ (line 38) | def __init__(self, in_channel, out_channel): method forward (line 52) | def forward(self, input): class FPN (line 66) | class FPN(nn.Module): method __init__ (line 68) | def __init__(self, in_channels_list, out_channels): method forward (line 80) | def forward(self, input): class MobileNetV1 (line 100) | class MobileNetV1(nn.Module): method __init__ (line 102) | def __init__(self): method forward (line 127) | def forward(self, x): class ClassHead (line 138) | class ClassHead(nn.Module): method __init__ (line 140) | def __init__(self, inchannels=512, num_anchors=3): method forward (line 145) | def forward(self, x): class BboxHead (line 152) | class BboxHead(nn.Module): method __init__ (line 154) | def __init__(self, inchannels=512, num_anchors=3): method forward (line 158) | def forward(self, x): class LandmarkHead (line 165) | class LandmarkHead(nn.Module): method __init__ (line 167) | def __init__(self, inchannels=512, num_anchors=3): method forward (line 171) | def forward(self, x): function make_class_head (line 178) | def make_class_head(fpn_num=3, inchannels=64, anchor_num=2): function make_bbox_head (line 185) | def make_bbox_head(fpn_num=3, inchannels=64, anchor_num=2): function make_landmark_head (line 192) | def make_landmark_head(fpn_num=3, inchannels=64, anchor_num=2): FILE: iopaint/plugins/facexlib/detection/retinaface_utils.py class PriorBox (line 8) | class PriorBox(object): method __init__ (line 10) | def __init__(self, cfg, image_size=None, phase='train'): method forward (line 19) | def forward(self): function py_cpu_nms (line 39) | def py_cpu_nms(dets, thresh): function point_form (line 50) | def point_form(boxes): function center_size (line 65) | def center_size(boxes): function intersect (line 79) | def intersect(box_a, box_b): function jaccard (line 98) | def jaccard(box_a, box_b): function matrix_iou (line 117) | def matrix_iou(a, b): function matrix_iof (line 130) | def matrix_iof(a, b): function match (line 142) | def match(threshold, truths, priors, variances, labels, landms, loc_t, c... function encode (line 200) | def encode(matched, priors, variances): function encode_landm (line 224) | def encode_landm(matched, priors, variances): function decode (line 254) | def decode(loc, priors, variances): function decode_landm (line 274) | def decode_landm(pre, priors, variances): function batched_decode (line 297) | def batched_decode(b_loc, priors, variances): function batched_decode_landm (line 320) | def batched_decode_landm(pre, priors, variances): function log_sum_exp (line 343) | def log_sum_exp(x): function nms (line 357) | def nms(boxes, scores, overlap=0.5, top_k=200): FILE: iopaint/plugins/facexlib/parsing/__init__.py function init_parsing_model (line 8) | def init_parsing_model(model_name='bisenet', half=False, device='cuda', ... FILE: iopaint/plugins/facexlib/parsing/bisenet.py class ConvBNReLU (line 8) | class ConvBNReLU(nn.Module): method __init__ (line 10) | def __init__(self, in_chan, out_chan, ks=3, stride=1, padding=1): method forward (line 15) | def forward(self, x): class BiSeNetOutput (line 21) | class BiSeNetOutput(nn.Module): method __init__ (line 23) | def __init__(self, in_chan, mid_chan, num_class): method forward (line 28) | def forward(self, x): class AttentionRefinementModule (line 34) | class AttentionRefinementModule(nn.Module): method __init__ (line 36) | def __init__(self, in_chan, out_chan): method forward (line 43) | def forward(self, x): class ContextPath (line 53) | class ContextPath(nn.Module): method __init__ (line 55) | def __init__(self): method forward (line 64) | def forward(self, x): class FeatureFusionModule (line 87) | class FeatureFusionModule(nn.Module): method __init__ (line 89) | def __init__(self, in_chan, out_chan): method forward (line 97) | def forward(self, fsp, fcp): class BiSeNet (line 110) | class BiSeNet(nn.Module): method __init__ (line 112) | def __init__(self, num_class): method forward (line 120) | def forward(self, x, return_feat=False): FILE: iopaint/plugins/facexlib/parsing/parsenet.py class NormLayer (line 8) | class NormLayer(nn.Module): method __init__ (line 16) | def __init__(self, channels, normalize_shape=None, norm_type='bn'): method forward (line 35) | def forward(self, x, ref=None): class ReluLayer (line 42) | class ReluLayer(nn.Module): method __init__ (line 54) | def __init__(self, channels, relu_type='relu'): method forward (line 70) | def forward(self, x): class ConvLayer (line 74) | class ConvLayer(nn.Module): method __init__ (line 76) | def __init__(self, method forward (line 103) | def forward(self, x): class ResidualBlock (line 113) | class ResidualBlock(nn.Module): method __init__ (line 118) | def __init__(self, c_in, c_out, relu_type='prelu', norm_type='bn', sca... method forward (line 132) | def forward(self, x): class ParseNet (line 140) | class ParseNet(nn.Module): method __init__ (line 142) | def __init__(self, method forward (line 188) | def forward(self, x): FILE: iopaint/plugins/facexlib/parsing/resnet.py function conv3x3 (line 5) | def conv3x3(in_planes, out_planes, stride=1): class BasicBlock (line 10) | class BasicBlock(nn.Module): method __init__ (line 12) | def __init__(self, in_chan, out_chan, stride=1): method forward (line 26) | def forward(self, x): function create_layer_basic (line 41) | def create_layer_basic(in_chan, out_chan, bnum, stride=1): class ResNet18 (line 48) | class ResNet18(nn.Module): method __init__ (line 50) | def __init__(self): method forward (line 60) | def forward(self, x): FILE: iopaint/plugins/facexlib/utils/face_restoration_helper.py function get_largest_face (line 12) | def get_largest_face(det_faces, h, w): function get_center_face (line 33) | def get_center_face(det_faces, h=0, w=0, center=None): class FaceRestoreHelper (line 49) | class FaceRestoreHelper(object): method __init__ (line 52) | def __init__( method set_upscale_factor (line 124) | def set_upscale_factor(self, upscale_factor): method read_image (line 127) | def read_image(self, img): method get_face_landmarks_5 (line 142) | def get_face_landmarks_5( method align_warp_face (line 278) | def align_warp_face(self, save_cropped_path=None, border_mode="constan... method get_inverse_affine (line 317) | def get_inverse_affine(self, save_inverse_affine_path=None): method add_restored_face (line 329) | def add_restored_face(self, face): method paste_faces_to_input_image (line 332) | def paste_faces_to_input_image(self, save_path=None, upsample_img=None): method clean_all (line 466) | def clean_all(self): FILE: iopaint/plugins/facexlib/utils/face_utils.py function compute_increased_bbox (line 6) | def compute_increased_bbox(bbox, increase_area, preserve_aspect=True): function get_valid_bboxes (line 23) | def get_valid_bboxes(bboxes, h, w): function align_crop_face_landmarks (line 31) | def align_crop_face_landmarks(img, function paste_face_back (line 190) | def paste_face_back(img, face, inverse_affine): FILE: iopaint/plugins/facexlib/utils/misc.py function imwrite (line 11) | def imwrite(img, file_path, params=None, auto_mkdir=True): function img2tensor (line 30) | def img2tensor(imgs, bgr2rgb=True, float32=True): function load_file_from_url (line 59) | def load_file_from_url(url, model_dir=None, progress=True, file_name=Non... function scandir (line 81) | def scandir(dir_path, suffix=None, recursive=False, full_path=False): FILE: iopaint/plugins/gfpgan/archs/gfpganv1_clean_arch.py class StyleGAN2GeneratorCSFT (line 10) | class StyleGAN2GeneratorCSFT(StyleGAN2GeneratorClean): method __init__ (line 24) | def __init__(self, out_size, num_style_feat=512, num_mlp=8, channel_mu... method forward (line 33) | def forward(self, class ResBlock (line 119) | class ResBlock(nn.Module): method __init__ (line 128) | def __init__(self, in_channels, out_channels, mode='down'): method forward (line 139) | def forward(self, x): class GFPGANv1Clean (line 151) | class GFPGANv1Clean(nn.Module): method __init__ (line 172) | def __init__( method forward (line 275) | def forward(self, x, return_latents=False, return_rgb=True, randomize_... FILE: iopaint/plugins/gfpgan/archs/restoreformer_arch.py class VectorQuantizer (line 9) | class VectorQuantizer(nn.Module): method __init__ (line 21) | def __init__(self, n_e, e_dim, beta): method forward (line 30) | def forward(self, z): method get_codebook_entry (line 94) | def get_codebook_entry(self, indices, shape): function nonlinearity (line 113) | def nonlinearity(x): function Normalize (line 118) | def Normalize(in_channels): class Upsample (line 124) | class Upsample(nn.Module): method __init__ (line 125) | def __init__(self, in_channels, with_conv): method forward (line 133) | def forward(self, x): class Downsample (line 140) | class Downsample(nn.Module): method __init__ (line 141) | def __init__(self, in_channels, with_conv): method forward (line 150) | def forward(self, x): class ResnetBlock (line 160) | class ResnetBlock(nn.Module): method __init__ (line 161) | def __init__( method forward (line 197) | def forward(self, x, temb): class MultiHeadAttnBlock (line 220) | class MultiHeadAttnBlock(nn.Module): method __init__ (line 221) | def __init__(self, in_channels, head_size=1): method forward (line 247) | def forward(self, x, y=None): class MultiHeadEncoder (line 290) | class MultiHeadEncoder(nn.Module): method __init__ (line 291) | def __init__( method forward (line 377) | def forward(self, x): class MultiHeadDecoder (line 415) | class MultiHeadDecoder(nn.Module): method __init__ (line 416) | def __init__( method forward (line 507) | def forward(self, z): class MultiHeadDecoderTransformer (line 542) | class MultiHeadDecoderTransformer(nn.Module): method __init__ (line 543) | def __init__( method forward (line 634) | def forward(self, z, hs): class RestoreFormer (line 672) | class RestoreFormer(nn.Module): method __init__ (line 673) | def __init__( method encode (line 743) | def encode(self, x): method decode (line 749) | def decode(self, quant, hs): method forward (line 755) | def forward(self, input, **kwargs): FILE: iopaint/plugins/gfpgan/archs/stylegan2_clean_arch.py class NormStyleCode (line 10) | class NormStyleCode(nn.Module): method forward (line 11) | def forward(self, x): class ModulatedConv2d (line 23) | class ModulatedConv2d(nn.Module): method __init__ (line 38) | def __init__( method forward (line 74) | def forward(self, x, style): method __repr__ (line 112) | def __repr__(self): class StyleConv (line 119) | class StyleConv(nn.Module): method __init__ (line 131) | def __init__( method forward (line 153) | def forward(self, x, style, noise=None): class ToRGB (line 168) | class ToRGB(nn.Module): method __init__ (line 177) | def __init__(self, in_channels, num_style_feat, upsample=True): method forward (line 190) | def forward(self, x, style, skip=None): class ConstantInput (line 212) | class ConstantInput(nn.Module): method __init__ (line 220) | def __init__(self, num_channel, size): method forward (line 224) | def forward(self, batch): class StyleGAN2GeneratorClean (line 229) | class StyleGAN2GeneratorClean(nn.Module): method __init__ (line 240) | def __init__( method make_noise (line 330) | def make_noise(self): method get_latent (line 341) | def get_latent(self, x): method mean_latent (line 344) | def mean_latent(self, num_latent): method forward (line 351) | def forward( FILE: iopaint/plugins/gfpgan_plugin.py class GFPGANPlugin (line 10) | class GFPGANPlugin(BasePlugin): method __init__ (line 14) | def __init__(self, device, upscaler=None): method gen_image (line 37) | def gen_image(self, rgb_np_img, req: RunPluginRequest) -> np.ndarray: FILE: iopaint/plugins/gfpganer.py class MyGFPGANer (line 13) | class MyGFPGANer: method __init__ (line 29) | def __init__( method enhance (line 91) | def enhance( FILE: iopaint/plugins/interactive_seg.py class InteractiveSeg (line 81) | class InteractiveSeg(BasePlugin): method __init__ (line 85) | def __init__(self, model_name, device): method _init_session (line 91) | def _init_session(self, model_name: str): method switch_model (line 112) | def switch_model(self, new_model_name): method gen_mask (line 122) | def gen_mask(self, rgb_np_img, req: RunPluginRequest) -> np.ndarray: method forward (line 127) | def forward(self, rgb_np_img, clicks: List[List], img_md5: str): FILE: iopaint/plugins/realesrgan.py class RealESRGANer (line 15) | class RealESRGANer: method __init__ (line 30) | def __init__( method dni (line 86) | def dni(self, net_a, net_b, dni_weight, key="params", loc="cpu"): method pre_process (line 97) | def pre_process(self, img): method process (line 123) | def process(self): method tile_process (line 127) | def tile_process(self): method post_process (line 202) | def post_process(self): method enhance (line 224) | def enhance(self, img, outscale=None, alpha_upsampler="realesrgan"): class SRVGGNetCompact (line 305) | class SRVGGNetCompact(nn.Module): method __init__ (line 320) | def __init__( method forward (line 366) | def forward(self, x): class RealESRGANUpscaler (line 378) | class RealESRGANUpscaler(BasePlugin): method __init__ (line 382) | def __init__(self, name, device, no_half=False): method _init_model (line 389) | def _init_model(self, name): method switch_model (line 451) | def switch_model(self, new_model_name: str): method gen_image (line 457) | def gen_image(self, rgb_np_img, req: RunPluginRequest) -> np.ndarray: method forward (line 465) | def forward(self, bgr_np_img, scale: float): FILE: iopaint/plugins/remove_bg.py function _rmbg_remove (line 12) | def _rmbg_remove(device, *args, **kwargs): class RemoveBG (line 18) | class RemoveBG(BasePlugin): method __init__ (line 23) | def __init__(self, model_name, device): method _init_session (line 42) | def _init_session(self, model_name: str): method switch_model (line 67) | def switch_model(self, new_model_name): method gen_image (line 78) | def gen_image(self, rgb_np_img, req: RunPluginRequest) -> np.ndarray: method gen_mask (line 86) | def gen_mask(self, rgb_np_img, req: RunPluginRequest) -> np.ndarray: method check_dep (line 95) | def check_dep(self): method device_warning (line 104) | def device_warning(self): FILE: iopaint/plugins/restoreformer.py class RestoreFormerPlugin (line 10) | class RestoreFormerPlugin(BasePlugin): method __init__ (line 14) | def __init__(self, device, upscaler=None): method gen_image (line 32) | def gen_image(self, rgb_np_img, req: RunPluginRequest) -> np.ndarray: FILE: iopaint/plugins/segment_anything/build_sam.py function build_sam_vit_h (line 25) | def build_sam_vit_h(checkpoint=None): function build_sam_vit_l (line 35) | def build_sam_vit_l(checkpoint=None): function build_sam_vit_b (line 45) | def build_sam_vit_b(checkpoint=None): function build_sam_vit_t (line 55) | def build_sam_vit_t(checkpoint=None): function build_sam_vit_h_hq (line 107) | def build_sam_vit_h_hq(checkpoint=None): function build_sam_vit_l_hq (line 117) | def build_sam_vit_l_hq(checkpoint=None): function build_sam_vit_b_hq (line 127) | def build_sam_vit_b_hq(checkpoint=None): function _build_sam (line 149) | def _build_sam( function _build_sam_hq (line 204) | def _build_sam_hq( FILE: iopaint/plugins/segment_anything/modeling/common.py class MLPBlock (line 13) | class MLPBlock(nn.Module): method __init__ (line 14) | def __init__( method forward (line 25) | def forward(self, x: torch.Tensor) -> torch.Tensor: class LayerNorm2d (line 31) | class LayerNorm2d(nn.Module): method __init__ (line 32) | def __init__(self, num_channels: int, eps: float = 1e-6) -> None: method forward (line 38) | def forward(self, x: torch.Tensor) -> torch.Tensor: FILE: iopaint/plugins/segment_anything/modeling/image_encoder.py class ImageEncoderViT (line 17) | class ImageEncoderViT(nn.Module): method __init__ (line 18) | def __init__( method forward (line 106) | def forward(self, x: torch.Tensor) -> torch.Tensor: class Block (line 119) | class Block(nn.Module): method __init__ (line 122) | def __init__( method forward (line 166) | def forward(self, x: torch.Tensor) -> torch.Tensor: class Attention (line 185) | class Attention(nn.Module): method __init__ (line 188) | def __init__( method forward (line 224) | def forward(self, x: torch.Tensor) -> torch.Tensor: function window_partition (line 243) | def window_partition(x: torch.Tensor, window_size: int) -> Tuple[torch.T... function window_unpartition (line 267) | def window_unpartition( function get_rel_pos (line 292) | def get_rel_pos(q_size: int, k_size: int, rel_pos: torch.Tensor) -> torc... function add_decomposed_rel_pos (line 325) | def add_decomposed_rel_pos( class PatchEmbed (line 364) | class PatchEmbed(nn.Module): method __init__ (line 369) | def __init__( method forward (line 391) | def forward(self, x: torch.Tensor) -> torch.Tensor: FILE: iopaint/plugins/segment_anything/modeling/image_encoder_hq.py class ImageEncoderViTHQ (line 17) | class ImageEncoderViTHQ(nn.Module): method __init__ (line 18) | def __init__( method forward (line 108) | def forward(self, x: torch.Tensor) -> torch.Tensor: class Block (line 124) | class Block(nn.Module): method __init__ (line 127) | def __init__( method forward (line 173) | def forward(self, x: torch.Tensor) -> torch.Tensor: class Attention (line 192) | class Attention(nn.Module): method __init__ (line 195) | def __init__( method forward (line 231) | def forward(self, x: torch.Tensor) -> torch.Tensor: function window_partition (line 259) | def window_partition( function window_unpartition (line 287) | def window_unpartition( function get_rel_pos (line 317) | def get_rel_pos(q_size: int, k_size: int, rel_pos: torch.Tensor) -> torc... function add_decomposed_rel_pos (line 350) | def add_decomposed_rel_pos( class PatchEmbed (line 391) | class PatchEmbed(nn.Module): method __init__ (line 396) | def __init__( method forward (line 418) | def forward(self, x: torch.Tensor) -> torch.Tensor: FILE: iopaint/plugins/segment_anything/modeling/mask_decoder.py class MaskDecoder (line 16) | class MaskDecoder(nn.Module): method __init__ (line 17) | def __init__( method forward (line 75) | def forward( method predict_masks (line 116) | def predict_masks( class MaskDecoderHQ (line 162) | class MaskDecoderHQ(nn.Module): method __init__ (line 163) | def __init__( method forward (line 256) | def forward( method predict_masks (line 321) | def predict_masks( class MLP (line 388) | class MLP(nn.Module): method __init__ (line 389) | def __init__( method forward (line 405) | def forward(self, x): FILE: iopaint/plugins/segment_anything/modeling/prompt_encoder.py class PromptEncoder (line 16) | class PromptEncoder(nn.Module): method __init__ (line 17) | def __init__( method get_dense_pe (line 62) | def get_dense_pe(self) -> torch.Tensor: method _embed_points (line 73) | def _embed_points( method _embed_boxes (line 93) | def _embed_boxes(self, boxes: torch.Tensor) -> torch.Tensor: method _embed_masks (line 102) | def _embed_masks(self, masks: torch.Tensor) -> torch.Tensor: method _get_batch_size (line 107) | def _get_batch_size( method _get_device (line 125) | def _get_device(self) -> torch.device: method forward (line 128) | def forward( class PositionEmbeddingRandom (line 171) | class PositionEmbeddingRandom(nn.Module): method __init__ (line 176) | def __init__(self, num_pos_feats: int = 64, scale: Optional[float] = N... method _pe_encoding (line 185) | def _pe_encoding(self, coords: torch.Tensor) -> torch.Tensor: method forward (line 194) | def forward(self, size: Tuple[int, int]) -> torch.Tensor: method forward_with_coords (line 207) | def forward_with_coords( FILE: iopaint/plugins/segment_anything/modeling/sam.py class Sam (line 18) | class Sam(nn.Module): method __init__ (line 22) | def __init__( method device (line 50) | def device(self) -> Any: method forward (line 54) | def forward( method postprocess_masks (line 133) | def postprocess_masks( method preprocess (line 164) | def preprocess(self, x: torch.Tensor) -> torch.Tensor: FILE: iopaint/plugins/segment_anything/modeling/sam_hq.py class SamHQ (line 18) | class SamHQ(nn.Module): method __init__ (line 22) | def __init__( method device (line 50) | def device(self) -> Any: method forward (line 53) | def forward( method postprocess_masks (line 136) | def postprocess_masks( method preprocess (line 167) | def preprocess(self, x: torch.Tensor) -> torch.Tensor: FILE: iopaint/plugins/segment_anything/modeling/tiny_vit_sam.py function _ntuple (line 21) | def _ntuple(n): function _trunc_normal_ (line 33) | def _trunc_normal_(tensor, mean, std, a, b): function trunc_normal_ (line 70) | def trunc_normal_(tensor, mean=0.0, std=1.0, a=-2.0, b=2.0): function drop_path (line 97) | def drop_path( class TimmDropPath (line 121) | class TimmDropPath(nn.Module): method __init__ (line 124) | def __init__(self, drop_prob: float = 0.0, scale_by_keep: bool = True): method forward (line 129) | def forward(self, x): method extra_repr (line 132) | def extra_repr(self): class Conv2d_BN (line 136) | class Conv2d_BN(torch.nn.Sequential): method __init__ (line 137) | def __init__( method fuse (line 150) | def fuse(self): class DropPath (line 169) | class DropPath(TimmDropPath): method __init__ (line 170) | def __init__(self, drop_prob=None): method __repr__ (line 174) | def __repr__(self): class PatchEmbed (line 180) | class PatchEmbed(nn.Module): method __init__ (line 181) | def __init__(self, in_chans, embed_dim, resolution, activation): method forward (line 195) | def forward(self, x): class MBConv (line 199) | class MBConv(nn.Module): method __init__ (line 200) | def __init__(self, in_chans, out_chans, expand_ratio, activation, drop... method forward (line 224) | def forward(self, x): class PatchMerging (line 243) | class PatchMerging(nn.Module): method __init__ (line 244) | def __init__(self, input_resolution, dim, out_dim, activation): method forward (line 258) | def forward(self, x): class ConvLayer (line 275) | class ConvLayer(nn.Module): method __init__ (line 276) | def __init__( method forward (line 316) | def forward(self, x): class Mlp (line 327) | class Mlp(nn.Module): method __init__ (line 328) | def __init__( method forward (line 345) | def forward(self, x): class Attention (line 356) | class Attention(torch.nn.Module): method __init__ (line 357) | def __init__( method train (line 399) | def train(self, mode=True): method forward (line 410) | def forward(self, x): # x (B,N,C) class TinyViTBlock (line 437) | class TinyViTBlock(nn.Module): method __init__ (line 453) | def __init__( method forward (line 497) | def forward(self, x): method extra_repr (line 544) | def extra_repr(self) -> str: class BasicLayer (line 551) | class BasicLayer(nn.Module): method __init__ (line 570) | def __init__( method forward (line 620) | def forward(self, x): method extra_repr (line 630) | def extra_repr(self) -> str: class LayerNorm2d (line 634) | class LayerNorm2d(nn.Module): method __init__ (line 635) | def __init__(self, num_channels: int, eps: float = 1e-6) -> None: method forward (line 641) | def forward(self, x: torch.Tensor) -> torch.Tensor: class TinyViT (line 649) | class TinyViT(nn.Module): method __init__ (line 650) | def __init__( method set_layer_lr_decay (line 756) | def set_layer_lr_decay(self, layer_lr_decay): method _init_weights (line 789) | def _init_weights(self, m): method no_weight_decay_keywords (line 799) | def no_weight_decay_keywords(self): method forward_features (line 802) | def forward_features(self, x): method forward (line 818) | def forward(self, x): FILE: iopaint/plugins/segment_anything/modeling/transformer.py class TwoWayTransformer (line 16) | class TwoWayTransformer(nn.Module): method __init__ (line 17) | def __init__( method forward (line 62) | def forward( class TwoWayAttentionBlock (line 109) | class TwoWayAttentionBlock(nn.Module): method __init__ (line 110) | def __init__( method forward (line 151) | def forward( class Attention (line 185) | class Attention(nn.Module): method __init__ (line 191) | def __init__( method _separate_heads (line 208) | def _separate_heads(self, x: Tensor, num_heads: int) -> Tensor: method _recombine_heads (line 213) | def _recombine_heads(self, x: Tensor) -> Tensor: method forward (line 218) | def forward(self, q: Tensor, k: Tensor, v: Tensor) -> Tensor: FILE: iopaint/plugins/segment_anything/predictor.py class SamPredictor (line 15) | class SamPredictor: method __init__ (line 16) | def __init__( method set_image (line 34) | def set_image( method set_torch_image (line 65) | def set_torch_image( method predict (line 94) | def predict( method predict_torch (line 179) | def predict_torch( method get_image_embedding (line 259) | def get_image_embedding(self) -> torch.Tensor: method device (line 275) | def device(self) -> torch.device: method reset_image (line 278) | def reset_image(self) -> None: FILE: iopaint/plugins/segment_anything/predictor_hq.py class SamHQPredictor (line 17) | class SamHQPredictor: method __init__ (line 18) | def __init__( method set_image (line 34) | def set_image( method set_torch_image (line 67) | def set_torch_image( method predict (line 96) | def predict( method predict_torch (line 183) | def predict_torch( method get_image_embedding (line 266) | def get_image_embedding(self) -> torch.Tensor: method device (line 282) | def device(self) -> torch.device: method reset_image (line 285) | def reset_image(self) -> None: FILE: iopaint/plugins/segment_anything/utils/transforms.py class ResizeLongestSide (line 16) | class ResizeLongestSide: method __init__ (line 23) | def __init__(self, target_length: int) -> None: method apply_image (line 26) | def apply_image(self, image: np.ndarray) -> np.ndarray: method apply_coords (line 35) | def apply_coords( method apply_boxes (line 51) | def apply_boxes( method apply_image_torch (line 61) | def apply_image_torch(self, image: torch.Tensor) -> torch.Tensor: method apply_coords_torch (line 75) | def apply_coords_torch( method apply_boxes_torch (line 91) | def apply_boxes_torch( method get_preprocess_shape (line 102) | def get_preprocess_shape( FILE: iopaint/plugins/segment_anything2/build_sam.py function build_memory_attention (line 72) | def build_memory_attention(): function build_memory_encoder (line 106) | def build_memory_encoder(): function build_image_encoder_tiny (line 130) | def build_image_encoder_tiny(): function build_image_encoder_small (line 156) | def build_image_encoder_small(): function build_image_encoder_base (line 182) | def build_image_encoder_base(): function build_image_encoder_large (line 208) | def build_image_encoder_large(): function build_sam2_tiny (line 234) | def build_sam2_tiny(): function build_sam2_small (line 243) | def build_sam2_small(): function build_sam2_base (line 252) | def build_sam2_base(): function build_sam2_large (line 261) | def build_sam2_large(): function build_sam2_1_tiny (line 270) | def build_sam2_1_tiny(): function build_sam2_1_small (line 279) | def build_sam2_1_small(): function build_sam2_1_base (line 288) | def build_sam2_1_base(): function build_sam2_1_large (line 297) | def build_sam2_1_large(): function build_sam2 (line 318) | def build_sam2( function _load_checkpoint (line 332) | def _load_checkpoint(model, ckpt_path): FILE: iopaint/plugins/segment_anything2/modeling/backbones/hieradet.py function do_pool (line 24) | def do_pool(x: torch.Tensor, pool: nn.Module, norm: nn.Module = None) ->... class MultiScaleAttention (line 38) | class MultiScaleAttention(nn.Module): method __init__ (line 39) | def __init__( method forward (line 55) | def forward(self, x: torch.Tensor) -> torch.Tensor: class MultiScaleBlock (line 83) | class MultiScaleBlock(nn.Module): method __init__ (line 84) | def __init__( method forward (line 133) | def forward(self, x: torch.Tensor) -> torch.Tensor: class Hiera (line 168) | class Hiera(nn.Module): method __init__ (line 173) | def __init__( method _get_pos_embed (line 271) | def _get_pos_embed(self, hw: Tuple[int, int]) -> torch.Tensor: method forward (line 281) | def forward(self, x: torch.Tensor) -> List[torch.Tensor]: method get_layer_id (line 299) | def get_layer_id(self, layer_name): method get_num_layers (line 314) | def get_num_layers(self) -> int: FILE: iopaint/plugins/segment_anything2/modeling/backbones/image_encoder.py class ImageEncoder (line 14) | class ImageEncoder(nn.Module): method __init__ (line 15) | def __init__( method forward (line 29) | def forward(self, sample: torch.Tensor): class FpnNeck (line 45) | class FpnNeck(nn.Module): method __init__ (line 52) | def __init__( method forward (line 102) | def forward(self, xs: List[torch.Tensor]): FILE: iopaint/plugins/segment_anything2/modeling/backbones/utils.py function window_partition (line 16) | def window_partition(x, window_size): function window_unpartition (line 41) | def window_unpartition(windows, window_size, pad_hw, hw): class PatchEmbed (line 65) | class PatchEmbed(nn.Module): method __init__ (line 70) | def __init__( method forward (line 91) | def forward(self, x: torch.Tensor) -> torch.Tensor: FILE: iopaint/plugins/segment_anything2/modeling/memory_attention.py class MemoryAttentionLayer (line 17) | class MemoryAttentionLayer(nn.Module): method __init__ (line 19) | def __init__( method _forward_sa (line 58) | def _forward_sa(self, tgt, query_pos): method _forward_ca (line 66) | def _forward_ca(self, tgt, memory, query_pos, pos, num_k_exclude_rope=0): method forward (line 83) | def forward( class MemoryAttention (line 102) | class MemoryAttention(nn.Module): method __init__ (line 103) | def __init__( method forward (line 119) | def forward( FILE: iopaint/plugins/segment_anything2/modeling/memory_encoder.py class MaskDownSampler (line 17) | class MaskDownSampler(nn.Module): method __init__ (line 26) | def __init__( method forward (line 57) | def forward(self, x): class CXBlock (line 62) | class CXBlock(nn.Module): method __init__ (line 74) | def __init__( method forward (line 104) | def forward(self, x): class Fuser (line 120) | class Fuser(nn.Module): method __init__ (line 121) | def __init__(self, layer, num_layers, dim=None, input_projection=False): method forward (line 130) | def forward(self, x): class MemoryEncoder (line 138) | class MemoryEncoder(nn.Module): method __init__ (line 139) | def __init__( method forward (line 158) | def forward( FILE: iopaint/plugins/segment_anything2/modeling/position_encoding.py class PositionEmbeddingSine (line 16) | class PositionEmbeddingSine(nn.Module): method __init__ (line 22) | def __init__( method _encode_xy (line 42) | def _encode_xy(self, x, y): method encode_boxes (line 62) | def encode_boxes(self, x, y, w, h): method encode_points (line 70) | def encode_points(self, x, y, labels): method forward (line 79) | def forward(self, x: torch.Tensor): class PositionEmbeddingRandom (line 115) | class PositionEmbeddingRandom(nn.Module): method __init__ (line 120) | def __init__(self, num_pos_feats: int = 64, scale: Optional[float] = N... method _pe_encoding (line 129) | def _pe_encoding(self, coords: torch.Tensor) -> torch.Tensor: method forward (line 138) | def forward(self, size: Tuple[int, int]) -> torch.Tensor: method forward_with_coords (line 151) | def forward_with_coords( function init_t_xy (line 167) | def init_t_xy(end_x: int, end_y: int): function compute_axial_cis (line 174) | def compute_axial_cis(dim: int, end_x: int, end_y: int, theta: float = 1... function reshape_for_broadcast (line 186) | def reshape_for_broadcast(freqs_cis: torch.Tensor, x: torch.Tensor): function apply_rotary_enc (line 194) | def apply_rotary_enc( FILE: iopaint/plugins/segment_anything2/modeling/sam/mask_decoder.py class MaskDecoder (line 15) | class MaskDecoder(nn.Module): method __init__ (line 16) | def __init__( method forward (line 110) | def forward( method predict_masks (line 168) | def predict_masks( method _get_stability_scores (line 247) | def _get_stability_scores(self, mask_logits): method _dynamic_multimask_via_stability (line 259) | def _dynamic_multimask_via_stability(self, all_mask_logits, all_iou_sc... FILE: iopaint/plugins/segment_anything2/modeling/sam/prompt_encoder.py class PromptEncoder (line 17) | class PromptEncoder(nn.Module): method __init__ (line 18) | def __init__( method get_dense_pe (line 68) | def get_dense_pe(self) -> torch.Tensor: method _embed_points (line 79) | def _embed_points( method _embed_boxes (line 103) | def _embed_boxes(self, boxes: torch.Tensor) -> torch.Tensor: method _embed_masks (line 114) | def _embed_masks(self, masks: torch.Tensor) -> torch.Tensor: method _get_batch_size (line 119) | def _get_batch_size( method _get_device (line 137) | def _get_device(self) -> torch.device: method forward (line 140) | def forward( FILE: iopaint/plugins/segment_anything2/modeling/sam/transformer.py class TwoWayTransformer (line 25) | class TwoWayTransformer(nn.Module): method __init__ (line 26) | def __init__( method forward (line 71) | def forward( class TwoWayAttentionBlock (line 118) | class TwoWayAttentionBlock(nn.Module): method __init__ (line 119) | def __init__( method forward (line 162) | def forward( class Attention (line 196) | class Attention(nn.Module): method __init__ (line 202) | def __init__( method _separate_heads (line 226) | def _separate_heads(self, x: Tensor, num_heads: int) -> Tensor: method _recombine_heads (line 231) | def _recombine_heads(self, x: Tensor) -> Tensor: method forward (line 236) | def forward(self, q: Tensor, k: Tensor, v: Tensor) -> Tensor: class RoPEAttention (line 263) | class RoPEAttention(Attention): method __init__ (line 266) | def __init__( method forward (line 285) | def forward( FILE: iopaint/plugins/segment_anything2/modeling/sam2_base.py class SAM2Base (line 22) | class SAM2Base(torch.nn.Module): method __init__ (line 23) | def __init__( method device (line 199) | def device(self): method forward (line 202) | def forward(self, *args, **kwargs): method _build_sam_heads (line 208) | def _build_sam_heads(self): method _forward_sam_heads (line 258) | def _forward_sam_heads( method _use_mask_as_output (line 416) | def _use_mask_as_output(self, backbone_features, high_res_features, ma... method forward_image (line 468) | def forward_image(self, img_batch: torch.Tensor): method _prepare_backbone_features (line 482) | def _prepare_backbone_features(self, backbone_out): method _prepare_memory_conditioned_features (line 498) | def _prepare_memory_conditioned_features( method _encode_new_memory (line 677) | def _encode_new_memory( method _track_step (line 729) | def _track_step( method _encode_memory_in_output (line 790) | def _encode_memory_in_output( method track_step (line 815) | def track_step( method _use_multimask (line 882) | def _use_multimask(self, is_init_cond_frame, point_inputs): method _apply_non_overlapping_constraints (line 892) | def _apply_non_overlapping_constraints(self, pred_masks): FILE: iopaint/plugins/segment_anything2/modeling/sam2_utils.py function select_closest_cond_frames (line 19) | def select_closest_cond_frames(frame_idx, cond_frame_outputs, max_cond_f... function get_1d_sine_pe (line 64) | def get_1d_sine_pe(pos_inds, dim, temperature=10000): function get_activation_fn (line 77) | def get_activation_fn(activation): function get_clones (line 88) | def get_clones(module, N): class DropPath (line 92) | class DropPath(nn.Module): method __init__ (line 94) | def __init__(self, drop_prob=0.0, scale_by_keep=True): method forward (line 99) | def forward(self, x): class MLP (line 112) | class MLP(nn.Module): method __init__ (line 113) | def __init__( method forward (line 131) | def forward(self, x): class LayerNorm2d (line 141) | class LayerNorm2d(nn.Module): method __init__ (line 142) | def __init__(self, num_channels: int, eps: float = 1e-6) -> None: method forward (line 148) | def forward(self, x: torch.Tensor) -> torch.Tensor: function sample_box_points (line 156) | def sample_box_points( function sample_random_points_from_errors (line 202) | def sample_random_points_from_errors(gt_masks, pred_masks, num_pt=1): function sample_one_point_from_error_center (line 252) | def sample_one_point_from_error_center(gt_masks, pred_masks, padding=True): function get_next_point (line 317) | def get_next_point(gt_masks, pred_masks, method): FILE: iopaint/plugins/segment_anything2/sam2_image_predictor.py class SAM2ImagePredictor (line 20) | class SAM2ImagePredictor: method __init__ (line 21) | def __init__( method set_image (line 66) | def set_image( method set_image_batch (line 112) | def set_image_batch( method predict_batch (line 155) | def predict_batch( method predict (line 217) | def predict( method _prep_prompts (line 285) | def _prep_prompts( method _predict (line 316) | def _predict( method get_image_embedding (line 419) | def get_image_embedding(self) -> torch.Tensor: method device (line 435) | def device(self) -> torch.device: method reset_predictor (line 438) | def reset_predictor(self) -> None: FILE: iopaint/plugins/segment_anything2/utils/misc.py function get_sdpa_settings (line 14) | def get_sdpa_settings(): function mask_to_box (line 44) | def mask_to_box(masks: torch.Tensor): function _load_img_as_tensor (line 70) | def _load_img_as_tensor(img_path, image_size): function concat_points (line 82) | def concat_points(old_point_inputs, new_points, new_labels): FILE: iopaint/plugins/segment_anything2/utils/transforms.py class SAM2Transforms (line 12) | class SAM2Transforms(nn.Module): method __init__ (line 13) | def __init__( method __call__ (line 34) | def __call__(self, x): method forward_batch (line 38) | def forward_batch(self, img_list): method transform_coords (line 43) | def transform_coords( method transform_boxes (line 63) | def transform_boxes( method postprocess_masks (line 73) | def postprocess_masks(self, masks: torch.Tensor, orig_hw) -> torch.Ten... FILE: iopaint/runtime.py function dump_environment_info (line 44) | def dump_environment_info() -> Dict[str, str]: function check_device (line 57) | def check_device(device: Device) -> Device: function setup_model_dir (line 79) | def setup_model_dir(model_dir: Path): FILE: iopaint/schema.py class ModelType (line 22) | class ModelType(str, Enum): class ModelInfo (line 31) | class ModelInfo(BaseModel): method need_prompt (line 39) | def need_prompt(self) -> bool: method controlnets (line 54) | def controlnets(self) -> List[str]: method brushnets (line 71) | def brushnets(self) -> List[str]: method support_strength (line 80) | def support_strength(self) -> bool: method support_outpainting (line 90) | def support_outpainting(self) -> bool: method support_lcm_lora (line 100) | def support_lcm_lora(self) -> bool: method support_controlnet (line 110) | def support_controlnet(self) -> bool: method support_brushnet (line 120) | def support_brushnet(self) -> bool: method support_powerpaint_v2 (line 128) | def support_powerpaint_v2(self) -> bool: class Choices (line 138) | class Choices(str, Enum): method values (line 140) | def values(cls): class RealESRGANModel (line 144) | class RealESRGANModel(Choices): class RemoveBGModel (line 150) | class RemoveBGModel(Choices): class Device (line 169) | class Device(Choices): class InteractiveSegModel (line 175) | class InteractiveSegModel(Choices): class PluginInfo (line 195) | class PluginInfo(BaseModel): class CV2Flag (line 201) | class CV2Flag(str, Enum): class HDStrategy (line 206) | class HDStrategy(str, Enum): class LDMSampler (line 217) | class LDMSampler(str, Enum): class SDSampler (line 222) | class SDSampler(str, Enum): class PowerPaintTask (line 245) | class PowerPaintTask(Choices): class ApiConfig (line 253) | class ApiConfig(BaseModel): class InpaintRequest (line 285) | class InpaintRequest(BaseModel): method validate_field (line 422) | def validate_field(cls, values: "InpaintRequest"): class RunPluginRequest (line 451) | class RunPluginRequest(BaseModel): class MediasResponse (line 463) | class MediasResponse(BaseModel): class GenInfoResponse (line 471) | class GenInfoResponse(BaseModel): class ServerConfigResponse (line 476) | class ServerConfigResponse(BaseModel): class SwitchModelRequest (line 494) | class SwitchModelRequest(BaseModel): class SwitchPluginModelRequest (line 498) | class SwitchPluginModelRequest(BaseModel): class AdjustMaskRequest (line 506) | class AdjustMaskRequest(BaseModel): FILE: iopaint/tests/test_adjust_mask.py function test_adjust_mask (line 8) | def test_adjust_mask(): FILE: iopaint/tests/test_anytext.py function test_anytext (line 20) | def test_anytext(device): FILE: iopaint/tests/test_brushnet.py function test_runway_brushnet (line 22) | def test_runway_brushnet(device, sampler): function test_runway_powerpaint_v2 (line 51) | def test_runway_powerpaint_v2(device, sampler): FILE: iopaint/tests/test_controlnet.py function convert_controlnet_method_name (line 19) | def convert_controlnet_method_name(name): function test_runway_sd_1_5 (line 25) | def test_runway_sd_1_5(device, controlnet_method): function test_controlnet_switch (line 56) | def test_controlnet_switch(device): function test_local_file_path (line 88) | def test_local_file_path(device, local_file): FILE: iopaint/tests/test_instruct_pix2pix.py function test_instruct_pix2pix (line 16) | def test_instruct_pix2pix(device, disable_nsfw, cpu_offload): FILE: iopaint/tests/test_load_img.py function test_load_png_image (line 8) | def test_load_png_image(): function test_load_jpg_image (line 15) | def test_load_jpg_image(): FILE: iopaint/tests/test_low_mem.py function test_runway_sd_1_5_low_mem (line 17) | def test_runway_sd_1_5_low_mem(device): function test_runway_sd_lcm_lora_low_mem (line 49) | def test_runway_sd_lcm_lora_low_mem(device, sampler): function test_runway_norm_sd_model (line 82) | def test_runway_norm_sd_model(device, strategy, sampler): FILE: iopaint/tests/test_match_histograms.py function test_sd_match_histograms (line 11) | def test_sd_match_histograms(device, sampler): FILE: iopaint/tests/test_model.py function test_lama (line 13) | def test_lama(device, strategy): function test_ldm (line 36) | def test_ldm(device, strategy, ldm_sampler): function test_zits (line 58) | def test_zits(device, strategy, zits_wireframe): function test_mat (line 80) | def test_mat(device, strategy, no_half): function test_fcf (line 94) | def test_fcf(device, strategy): function test_cv2 (line 108) | def test_cv2(strategy, cv2_flag, cv2_radius): function test_manga (line 127) | def test_manga(device, strategy): function test_mi_gan (line 145) | def test_mi_gan(device, strategy): FILE: iopaint/tests/test_model_md5.py function test_load_model (line 1) | def test_load_model(): FILE: iopaint/tests/test_model_switch.py function test_model_switch (line 12) | def test_model_switch(): function test_controlnet_switch_onoff (line 26) | def test_controlnet_switch_onoff(caplog): function test_switch_controlnet_method (line 48) | def test_switch_controlnet_method(caplog): FILE: iopaint/tests/test_outpainting.py function test_outpainting (line 29) | def test_outpainting(name, device, rect): function test_kandinsky_outpainting (line 67) | def test_kandinsky_outpainting(name, device, rect): function test_powerpaint_outpainting (line 108) | def test_powerpaint_outpainting(name, device, rect): FILE: iopaint/tests/test_paint_by_example.py function assert_equal (line 19) | def assert_equal( function test_paint_by_example (line 46) | def test_paint_by_example(device): FILE: iopaint/tests/test_plugins.py function _save (line 35) | def _save(img, name): function test_remove_bg (line 42) | def test_remove_bg(model_name, device): function test_anime_seg (line 63) | def test_anime_seg(): function test_upscale (line 78) | def test_upscale(device): function test_gfpgan (line 95) | def test_gfpgan(device): function test_restoreformer (line 105) | def test_restoreformer(device): function test_segment_anything (line 117) | def test_segment_anything(name, device): FILE: iopaint/tests/test_save_exif.py function print_exif (line 13) | def print_exif(exif): function extra_info (line 18) | def extra_info(img_p: Path): function assert_keys (line 27) | def assert_keys(keys: List[str], infos, res_infos): function run_test (line 34) | def run_test(file_path, keys): function test_png_icc_profile_png (line 44) | def test_png_icc_profile_png(): function test_png_icc_profile_jpeg (line 48) | def test_png_icc_profile_jpeg(): function test_jpeg (line 52) | def test_jpeg(): function test_png_parameter (line 57) | def test_png_parameter(): FILE: iopaint/tests/test_save_quality.py function test_jpeg_quality (line 9) | def test_jpeg_quality(): function test_png_parameters (line 30) | def test_png_parameters(): function test_format_conversion (line 51) | def test_format_conversion(): FILE: iopaint/tests/test_sd_model.py function test_runway_sd_1_5_all_samplers (line 22) | def test_runway_sd_1_5_all_samplers(device): function test_runway_sd_lcm_lora (line 65) | def test_runway_sd_lcm_lora(device, sampler): function test_runway_sd_sd_strength (line 96) | def test_runway_sd_sd_strength(device, strategy, sampler): function test_runway_sd_cpu_textencoder (line 124) | def test_runway_sd_cpu_textencoder(device, strategy, sampler): function test_runway_norm_sd_model (line 151) | def test_runway_norm_sd_model(device, strategy, sampler): function test_runway_sd_1_5_cpu_offload (line 176) | def test_runway_sd_1_5_cpu_offload(device, strategy, sampler): function test_local_file_path (line 212) | def test_local_file_path(device, sampler, name): FILE: iopaint/tests/test_sdxl.py function test_sdxl (line 18) | def test_sdxl(device, strategy, sampler): function test_sdxl_cpu_text_encoder (line 50) | def test_sdxl_cpu_text_encoder(device, strategy, sampler): function test_sdxl_outpainting (line 86) | def test_sdxl_outpainting(device, rect): FILE: iopaint/tests/utils.py function check_device (line 14) | def check_device(device: str) -> int: function assert_equal (line 23) | def assert_equal( function get_data (line 52) | def get_data( function get_config (line 66) | def get_config(**kwargs): FILE: iopaint/web_config.py class WebConfig (line 67) | class WebConfig(ApiConfig): function load_config (line 71) | def load_config(p: Path) -> WebConfig: function save_config (line 83) | def save_config( function change_current_model (line 138) | def change_current_model(new_model): function main (line 142) | def main(config_file: Path): FILE: scripts/convert_vae_pt_to_diffusers.py function custom_convert_ldm_vae_checkpoint (line 18) | def custom_convert_ldm_vae_checkpoint(checkpoint, config): function vae_pt_to_vae_diffuser (line 187) | def vae_pt_to_vae_diffuser( FILE: scripts/tool.py class CheckpointMergerPipeline (line 24) | class CheckpointMergerPipeline(DiffusionPipeline): method __init__ (line 45) | def __init__(self): method _compare_model_configs (line 49) | def _compare_model_configs(self, dict0, dict1): method _remove_meta_keys (line 60) | def _remove_meta_keys(self, config_dict: Dict): method merge (line 70) | def merge( method weighted_sum (line 314) | def weighted_sum(theta0, theta1, theta2, alpha): method sigmoid (line 319) | def sigmoid(theta0, theta1, theta2, alpha): method inv_sigmoid (line 325) | def inv_sigmoid(theta0, theta1, theta2, alpha): method add_difference (line 332) | def add_difference(theta0, theta1, theta2, alpha): FILE: setup.py function load_requirements (line 18) | def load_requirements(): FILE: web_app/src/App.tsx constant SUPPORTED_FILE_TYPE (line 13) | const SUPPORTED_FILE_TYPE = [ function Home (line 20) | function Home() { FILE: web_app/src/components/Coffee.tsx function Coffee (line 7) | function Coffee() { FILE: web_app/src/components/Cropper.tsx constant DOC_MOVE_OPTS (line 6) | const DOC_MOVE_OPTS = { capture: true, passive: false } constant DRAG_HANDLE_BORDER (line 8) | const DRAG_HANDLE_BORDER = 2 type EVData (line 10) | interface EVData { type Props (line 20) | interface Props { FILE: web_app/src/components/DiffusionProgress.tsx constant API_ENDPOINT (line 6) | const API_ENDPOINT = import.meta.env.DEV FILE: web_app/src/components/Editor.tsx constant TOOLBAR_HEIGHT (line 39) | const TOOLBAR_HEIGHT = 200 constant COMPARE_SLIDER_DURATION_MS (line 40) | const COMPARE_SLIDER_DURATION_MS = 300 type EditorProps (line 42) | interface EditorProps { function Editor (line 46) | function Editor(props: EditorProps) { FILE: web_app/src/components/Extender.tsx constant DOC_MOVE_OPTS (line 7) | const DOC_MOVE_OPTS = { capture: true, passive: false } constant DRAG_HANDLE_BORDER (line 9) | const DRAG_HANDLE_BORDER = 2 type EVData (line 11) | interface EVData { type Props (line 21) | interface Props { FILE: web_app/src/components/FileManager.tsx type Photo (line 40) | interface Photo { constant SORT_BY_NAME (line 47) | const SORT_BY_NAME = "Name" constant SORT_BY_CREATED_TIME (line 48) | const SORT_BY_CREATED_TIME = "Created time" constant SORT_BY_MODIFIED_TIME (line 49) | const SORT_BY_MODIFIED_TIME = "Modified time" constant IMAGE_TAB (line 51) | const IMAGE_TAB = "input" constant OUTPUT_TAB (line 52) | const OUTPUT_TAB = "output" constant MASK_TAB (line 53) | const MASK_TAB = "mask" type Props (line 61) | interface Props { function FileManager (line 66) | function FileManager(props: Props) { FILE: web_app/src/components/FileSelect.tsx type FileSelectProps (line 4) | type FileSelectProps = { function FileSelect (line 8) | function FileSelect(props: FileSelectProps) { FILE: web_app/src/components/InteractiveSeg.tsx type InteractiveSegReplaceModal (line 5) | interface InteractiveSegReplaceModal { type ItemProps (line 79) | interface ItemProps { FILE: web_app/src/components/Plugins.tsx type PluginName (line 21) | enum PluginName { FILE: web_app/src/components/Settings.tsx constant TAB_GENERAL (line 64) | const TAB_GENERAL = "General" constant TAB_MODEL (line 65) | const TAB_MODEL = "Model" constant TAB_PLUGINS (line 66) | const TAB_PLUGINS = "Plugins" constant TAB_NAMES (line 69) | const TAB_NAMES = [TAB_MODEL, TAB_GENERAL, TAB_PLUGINS] function SettingsDialog (line 71) | function SettingsDialog() { FILE: web_app/src/components/Shortcuts.tsx type ShortcutProps (line 13) | interface ShortcutProps { function ShortCut (line 18) | function ShortCut(props: ShortcutProps) { function Shortcuts (line 44) | function Shortcuts() { FILE: web_app/src/components/ui/button.tsx type ButtonProps (line 39) | interface ButtonProps type IconButtonProps (line 63) | interface IconButtonProps extends ButtonProps { type UploadButtonProps (line 91) | interface UploadButtonProps extends IconButtonProps { FILE: web_app/src/components/ui/form.tsx type FormFieldContextValue (line 18) | type FormFieldContextValue< type FormItemContextValue (line 65) | type FormItemContextValue = { FILE: web_app/src/components/ui/input.tsx type InputProps (line 6) | interface InputProps type NumberInputProps (line 40) | interface NumberInputProps extends InputProps { FILE: web_app/src/components/ui/label.tsx type LabelProps (line 11) | interface LabelProps { FILE: web_app/src/components/ui/sheet.tsx type SheetContentProps (line 49) | interface SheetContentProps FILE: web_app/src/components/ui/textarea.tsx type TextareaProps (line 6) | interface TextareaProps FILE: web_app/src/components/ui/toast.tsx type ToastProps (line 119) | type ToastProps = React.ComponentPropsWithoutRef type ToastActionElement (line 121) | type ToastActionElement = React.ReactElement FILE: web_app/src/components/ui/toaster.tsx function Toaster (line 11) | function Toaster() { FILE: web_app/src/components/ui/use-toast.ts constant TOAST_LIMIT (line 9) | const TOAST_LIMIT = 1 constant TOAST_REMOVE_DELAY (line 10) | const TOAST_REMOVE_DELAY = 1000000 type ToasterToast (line 12) | type ToasterToast = ToastProps & { function genId (line 28) | function genId() { type ActionType (line 33) | type ActionType = typeof actionTypes type Action (line 35) | type Action = type State (line 53) | interface State { function dispatch (line 134) | function dispatch(action: Action) { type Toast (line 141) | type Toast = Omit function toast (line 143) | function toast({ ...props }: Toast) { function useToast (line 172) | function useToast() { FILE: web_app/src/hooks/useAsyncMemo.tsx function useAsyncMemo (line 12) | function useAsyncMemo( FILE: web_app/src/hooks/useImage.tsx function useImage (line 3) | function useImage(file: File | null): [HTMLImageElement, boolean] { FILE: web_app/src/hooks/useInputImage.tsx function useInputImage (line 4) | function useInputImage() { FILE: web_app/src/lib/api.ts constant API_ENDPOINT (line 13) | const API_ENDPOINT = import.meta.env.DEV function inpaint (line 28) | async function inpaint( function getServerConfig (line 105) | async function getServerConfig(): Promise { function switchModel (line 110) | async function switchModel(name: string): Promise { function switchPluginModel (line 115) | async function switchPluginModel( function currentModel (line 122) | async function currentModel(): Promise { function runPlugin (line 127) | async function runPlugin( function getMediaFile (line 155) | async function getMediaFile(tab: string, filename: string) { function getMediaBlob (line 174) | async function getMediaBlob(tab: string, filename: string) { function getMedias (line 190) | async function getMedias(tab: string): Promise { function downloadToOutput (line 195) | async function downloadToOutput( function getGenInfo (line 217) | async function getGenInfo(file: File): Promise { function getSamplers (line 224) | async function getSamplers(): Promise { function postAdjustMask (line 229) | async function postAdjustMask( FILE: web_app/src/lib/const.ts constant ACCENT_COLOR (line 1) | const ACCENT_COLOR = "#ffcc00bb" constant DEFAULT_BRUSH_SIZE (line 2) | const DEFAULT_BRUSH_SIZE = 40 constant MIN_BRUSH_SIZE (line 3) | const MIN_BRUSH_SIZE = 1 constant MAX_BRUSH_SIZE (line 4) | const MAX_BRUSH_SIZE = 200 constant MODEL_TYPE_INPAINT (line 5) | const MODEL_TYPE_INPAINT = "inpaint" constant MODEL_TYPE_DIFFUSERS_SD (line 6) | const MODEL_TYPE_DIFFUSERS_SD = "diffusers_sd" constant MODEL_TYPE_DIFFUSERS_SDXL (line 7) | const MODEL_TYPE_DIFFUSERS_SDXL = "diffusers_sdxl" constant MODEL_TYPE_DIFFUSERS_SD_INPAINT (line 8) | const MODEL_TYPE_DIFFUSERS_SD_INPAINT = "diffusers_sd_inpaint" constant MODEL_TYPE_DIFFUSERS_SDXL_INPAINT (line 9) | const MODEL_TYPE_DIFFUSERS_SDXL_INPAINT = "diffusers_sdxl_inpaint" constant MODEL_TYPE_OTHER (line 10) | const MODEL_TYPE_OTHER = "diffusers_other" constant BRUSH_COLOR (line 11) | const BRUSH_COLOR = "#ffcc00bb" constant LDM (line 13) | const LDM = "ldm" constant CV2 (line 14) | const CV2 = "cv2" constant PAINT_BY_EXAMPLE (line 16) | const PAINT_BY_EXAMPLE = "Fantasy-Studio/Paint-by-Example" constant INSTRUCT_PIX2PIX (line 17) | const INSTRUCT_PIX2PIX = "timbrooks/instruct-pix2pix" constant KANDINSKY_2_2 (line 18) | const KANDINSKY_2_2 = "kandinsky-community/kandinsky-2-2-decoder-inpaint" constant POWERPAINT (line 19) | const POWERPAINT = "Sanster/PowerPaint-V1-stable-diffusion-inpainting" constant ANYTEXT (line 20) | const ANYTEXT = "Sanster/AnyText" constant DEFAULT_NEGATIVE_PROMPT (line 22) | const DEFAULT_NEGATIVE_PROMPT = constant SHORTCUT_KEY_CHANGE_BRUSH_SIZE (line 25) | const SHORTCUT_KEY_CHANGE_BRUSH_SIZE = "Alt" FILE: web_app/src/lib/states.ts type FileManagerState (line 41) | type FileManagerState = { type CropperState (line 50) | type CropperState = { type Settings (line 57) | type Settings = { type InteractiveSegState (line 116) | type InteractiveSegState = { type EditorState (line 122) | type EditorState = { type AppState (line 141) | type AppState = { type AppAction (line 166) | type AppAction = { method updateEnableControlnet (line 836) | updateEnableControlnet(newValue) { method updateLCMLora (line 846) | updateLCMLora(newValue) { FILE: web_app/src/lib/types.ts type Filename (line 1) | interface Filename { type PluginInfo (line 9) | interface PluginInfo { type ServerConfig (line 15) | interface ServerConfig { type GenInfo (line 33) | interface GenInfo { type ModelInfo (line 38) | interface ModelInfo { type PluginName (line 60) | enum PluginName { type PluginParams (line 69) | interface PluginParams { type SortBy (line 73) | enum SortBy { type SortOrder (line 79) | enum SortOrder { type LDMSampler (line 84) | enum LDMSampler { type CV2Flag (line 89) | enum CV2Flag { type Rect (line 94) | interface Rect { type Point (line 101) | interface Point { type Line (line 106) | interface Line { type LineGroup (line 111) | type LineGroup = Array type Size (line 113) | interface Size { type ExtenderDirection (line 118) | enum ExtenderDirection { type PowerPaintTask (line 124) | enum PowerPaintTask { type AdjustMaskOperate (line 132) | type AdjustMaskOperate = "expand" | "shrink" | "reverse" FILE: web_app/src/lib/utils.ts function cn (line 7) | function cn(...inputs: ClassValue[]) { function keepGUIAlive (line 11) | function keepGUIAlive() { function dataURItoBlob (line 33) | function dataURItoBlob(dataURI: string) { function loadImage (line 43) | function loadImage(image: HTMLImageElement, src: string) { function blobToImage (line 56) | async function blobToImage(blob: Blob) { function canvasToImage (line 63) | function canvasToImage( function fileToImage (line 81) | function fileToImage(file: File): Promise { function srcToFile (line 101) | function srcToFile(src: string, fileName: string, mimeType: string) { function askWritePermission (line 111) | async function askWritePermission() { function canvasToBlob (line 125) | function canvasToBlob(canvas: HTMLCanvasElement, mime: string): Promise<... function isRightClick (line 142) | function isRightClick(ev: SyntheticEvent) { function isMidClick (line 147) | function isMidClick(ev: SyntheticEvent) { function copyCanvasImage (line 152) | async function copyCanvasImage(canvas: HTMLCanvasElement) { function downloadImage (line 161) | function downloadImage(uri: string, name: string) { function mouseXY (line 182) | function mouseXY(ev: SyntheticEvent) { function drawLines (line 197) | function drawLines(