sketchkit.colorization.manga_ninja.manganinja package¶
Subpackages¶
- sketchkit.colorization.manga_ninja.manganinja.annotator package
- sketchkit.colorization.manga_ninja.manganinja.models package
- Submodules
- sketchkit.colorization.manga_ninja.manganinja.models.attention module
- sketchkit.colorization.manga_ninja.manganinja.models.attention_processor module
AttentionAttention.batch_to_head_dim()Attention.forward()Attention.fuse_projections()Attention.get_attention_scores()Attention.get_processor()Attention.head_to_batch_dim()Attention.norm_encoder_hidden_states()Attention.prepare_attention_mask()Attention.set_attention_slice()Attention.set_processor()Attention.set_use_memory_efficient_attention_xformers()
AttnAddedKVProcessorAttnAddedKVProcessor2_0AttnProcessorAttnProcessor2_0CustomDiffusionAttnProcessorCustomDiffusionAttnProcessor2_0CustomDiffusionXFormersAttnProcessorFusedAttnProcessor2_0IPAdapterAttnProcessorIPAdapterAttnProcessor2_0LoRAAttnAddedKVProcessorLoRAAttnProcessorLoRAAttnProcessor2_0LoRAXFormersAttnProcessorSlicedAttnAddedKVProcessorSlicedAttnProcessorSpatialNormXFormersAttnAddedKVProcessorXFormersAttnProcessor
- sketchkit.colorization.manga_ninja.manganinja.models.mutual_self_attention_multi_scale module
- sketchkit.colorization.manga_ninja.manganinja.models.refunet_2d_condition module
RefUNet2DConditionModelRefUNet2DConditionModel._set_gradient_checkpointing()RefUNet2DConditionModel._supports_gradient_checkpointingRefUNet2DConditionModel.attn_processorsRefUNet2DConditionModel.disable_freeu()RefUNet2DConditionModel.enable_freeu()RefUNet2DConditionModel.forward()RefUNet2DConditionModel.set_attention_slice()RefUNet2DConditionModel.set_attn_processor()RefUNet2DConditionModel.set_default_attn_processor()
UNet2DConditionOutput
- sketchkit.colorization.manga_ninja.manganinja.models.transformer_2d module
- sketchkit.colorization.manga_ninja.manganinja.models.unet_2d_blocks module
- sketchkit.colorization.manga_ninja.manganinja.models.unet_2d_condition module
UNet2DConditionModelUNet2DConditionModel._check_config()UNet2DConditionModel._set_add_embedding()UNet2DConditionModel._set_class_embedding()UNet2DConditionModel._set_encoder_hid_proj()UNet2DConditionModel._set_gradient_checkpointing()UNet2DConditionModel._set_pos_net_if_use_gligen()UNet2DConditionModel._set_time_proj()UNet2DConditionModel._supports_gradient_checkpointingUNet2DConditionModel.attn_processorsUNet2DConditionModel.disable_freeu()UNet2DConditionModel.enable_freeu()UNet2DConditionModel.forward()UNet2DConditionModel.fuse_qkv_projections()UNet2DConditionModel.get_aug_embed()UNet2DConditionModel.get_class_embed()UNet2DConditionModel.get_time_embed()UNet2DConditionModel.process_encoder_hidden_states()UNet2DConditionModel.set_attention_slice()UNet2DConditionModel.set_attn_processor()UNet2DConditionModel.set_default_attn_processor()UNet2DConditionModel.unfuse_qkv_projections()UNet2DConditionModel.unload_lora()
UNet2DConditionOutput
- Module contents
- sketchkit.colorization.manga_ninja.manganinja.utils package
Submodules¶
sketchkit.colorization.manga_ninja.manganinja.pipeline module¶
- class sketchkit.colorization.manga_ninja.manganinja.pipeline.MangaNinjiaPipeline(reference_unet: RefUNet2DConditionModel, controlnet: ControlNetModel, denoising_unet: UNet2DConditionModel, vae: AutoencoderKL, refnet_tokenizer: CLIPTokenizer, refnet_text_encoder: CLIPTextModel, refnet_image_encoder: CLIPVisionModelWithProjection, controlnet_tokenizer: CLIPTokenizer, controlnet_text_encoder: CLIPTextModel, controlnet_image_encoder: CLIPVisionModelWithProjection, scheduler: DDIMScheduler, point_net: PointNet)[source]¶
Bases:
DiffusionPipeline- __encode_empty_text()¶
Encode text embedding for empty prompt
- decode_RGB(rgb_latent: Tensor) Tensor[source]¶
Decode depth latent into depth map.
- Parameters:
rgb_latent (torch.Tensor) – Depth latent to be decoded.
- Returns:
Decoded depth map.
- Return type:
torch.Tensor
- encode_RGB(rgb_in: Tensor, generator) Tensor[source]¶
Encode RGB image into latent.
- Parameters:
rgb_in (torch.Tensor) – Input RGB image to be encoded.
- Returns:
Image latent.
- Return type:
torch.Tensor
- rgb_latent_scale_factor = 0.18215¶
- single_infer(is_lineart: bool, ref1: Tensor, raw2: Tensor, edit2: Tensor, num_inference_steps: int, show_pbar: bool, guidance_scale_ref: float, guidance_scale_point: float, refnet_encoder_hidden_states: Tensor, controlnet_encoder_hidden_states: Tensor, reference_control_writer: ReferenceAttentionControl, reference_control_reader: ReferenceAttentionControl, preprocessor, generator, point_ref, point_main)[source]¶
sketchkit.colorization.manga_ninja.manganinja.point_network module¶
- class sketchkit.colorization.manga_ninja.manganinja.point_network.PointNet(conditioning_channels: int = 1, out_channels: Tuple[int] = (320, 640, 1280, 1280), downsamples: Tuple[int] = (6, 2, 2, 2))[source]¶
Bases:
ModelMixin- forward(x)[source]¶
Define the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Moduleinstance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.