Full Code of kohya-ss/sd-scripts for AI

main b2abe873a5fe cached
223 files
14.9 MB
3.9M tokens
2802 symbols
1 requests
Copy disabled (too large) Download .txt
Showing preview only (15,671K chars total). Download the full file to get everything.
Repository: kohya-ss/sd-scripts
Branch: main
Commit: b2abe873a5fe
Files: 223
Total size: 14.9 MB

Directory structure:
gitextract_ok9rjsar/

├── .ai/
│   ├── claude.prompt.md
│   ├── context/
│   │   └── 01-overview.md
│   └── gemini.prompt.md
├── .github/
│   ├── FUNDING.yml
│   ├── dependabot.yml
│   └── workflows/
│       ├── tests.yml
│       └── typos.yml
├── .gitignore
├── LICENSE.md
├── README-ja.md
├── README.md
├── XTI_hijack.py
├── _typos.toml
├── anima_minimal_inference.py
├── anima_train.py
├── anima_train_network.py
├── bitsandbytes_windows/
│   ├── cextension.py
│   └── main.py
├── configs/
│   ├── qwen3_06b/
│   │   ├── config.json
│   │   ├── merges.txt
│   │   ├── tokenizer.json
│   │   ├── tokenizer_config.json
│   │   └── vocab.json
│   └── t5_old/
│       ├── config.json
│       ├── spiece.model
│       └── tokenizer.json
├── docs/
│   ├── anima_train_network.md
│   ├── config_README-en.md
│   ├── config_README-ja.md
│   ├── fine_tune.md
│   ├── fine_tune_README_ja.md
│   ├── flux_train_network.md
│   ├── gen_img_README-ja.md
│   ├── gen_img_README.md
│   ├── hunyuan_image_train_network.md
│   ├── lumina_train_network.md
│   ├── masked_loss_README-ja.md
│   ├── masked_loss_README.md
│   ├── sd3_train_network.md
│   ├── sdxl_train_network.md
│   ├── train_README-ja.md
│   ├── train_README-zh.md
│   ├── train_SDXL-en.md
│   ├── train_db_README-ja.md
│   ├── train_db_README-zh.md
│   ├── train_lllite_README-ja.md
│   ├── train_lllite_README.md
│   ├── train_network.md
│   ├── train_network_README-ja.md
│   ├── train_network_README-zh.md
│   ├── train_network_advanced.md
│   ├── train_textual_inversion.md
│   ├── train_ti_README-ja.md
│   ├── validation.md
│   ├── wd14_tagger_README-en.md
│   └── wd14_tagger_README-ja.md
├── fine_tune.py
├── finetune/
│   ├── blip/
│   │   ├── blip.py
│   │   ├── med.py
│   │   ├── med_config.json
│   │   └── vit.py
│   ├── clean_captions_and_tags.py
│   ├── hypernetwork_nai.py
│   ├── make_captions.py
│   ├── make_captions_by_git.py
│   ├── merge_captions_to_metadata.py
│   ├── merge_dd_tags_to_metadata.py
│   ├── prepare_buckets_latents.py
│   └── tag_images_by_wd14_tagger.py
├── flux_minimal_inference.py
├── flux_train.py
├── flux_train_control_net.py
├── flux_train_network.py
├── gen_img.py
├── gen_img_diffusers.py
├── hunyuan_image_minimal_inference.py
├── hunyuan_image_train_network.py
├── library/
│   ├── __init__.py
│   ├── adafactor_fused.py
│   ├── anima_models.py
│   ├── anima_train_utils.py
│   ├── anima_utils.py
│   ├── attention.py
│   ├── attention_processors.py
│   ├── chroma_models.py
│   ├── config_util.py
│   ├── custom_offloading_utils.py
│   ├── custom_train_functions.py
│   ├── deepspeed_utils.py
│   ├── device_utils.py
│   ├── flux_models.py
│   ├── flux_train_utils.py
│   ├── flux_utils.py
│   ├── fp8_optimization_utils.py
│   ├── huggingface_util.py
│   ├── hunyuan_image_models.py
│   ├── hunyuan_image_modules.py
│   ├── hunyuan_image_text_encoder.py
│   ├── hunyuan_image_utils.py
│   ├── hunyuan_image_vae.py
│   ├── hypernetwork.py
│   ├── ipex/
│   │   ├── __init__.py
│   │   ├── attention.py
│   │   ├── diffusers.py
│   │   └── hijacks.py
│   ├── jpeg_xl_util.py
│   ├── lora_utils.py
│   ├── lpw_stable_diffusion.py
│   ├── lumina_models.py
│   ├── lumina_train_util.py
│   ├── lumina_util.py
│   ├── model_util.py
│   ├── original_unet.py
│   ├── qwen_image_autoencoder_kl.py
│   ├── safetensors_utils.py
│   ├── sai_model_spec.py
│   ├── sd3_models.py
│   ├── sd3_train_utils.py
│   ├── sd3_utils.py
│   ├── sdxl_lpw_stable_diffusion.py
│   ├── sdxl_model_util.py
│   ├── sdxl_original_control_net.py
│   ├── sdxl_original_unet.py
│   ├── sdxl_train_util.py
│   ├── slicing_vae.py
│   ├── strategy_anima.py
│   ├── strategy_base.py
│   ├── strategy_flux.py
│   ├── strategy_hunyuan_image.py
│   ├── strategy_lumina.py
│   ├── strategy_sd.py
│   ├── strategy_sd3.py
│   ├── strategy_sdxl.py
│   ├── train_util.py
│   └── utils.py
├── lumina_minimal_inference.py
├── lumina_train.py
├── lumina_train_network.py
├── networks/
│   ├── check_lora_weights.py
│   ├── control_net_lllite.py
│   ├── control_net_lllite_for_train.py
│   ├── convert_anima_lora_to_comfy.py
│   ├── convert_flux_lora.py
│   ├── convert_hunyuan_image_lora_to_comfy.py
│   ├── dylora.py
│   ├── extract_lora_from_dylora.py
│   ├── extract_lora_from_models.py
│   ├── flux_extract_lora.py
│   ├── flux_merge_lora.py
│   ├── lora.py
│   ├── lora_anima.py
│   ├── lora_diffusers.py
│   ├── lora_fa.py
│   ├── lora_flux.py
│   ├── lora_hunyuan_image.py
│   ├── lora_interrogator.py
│   ├── lora_lumina.py
│   ├── lora_sd3.py
│   ├── merge_lora.py
│   ├── merge_lora_old.py
│   ├── oft.py
│   ├── oft_flux.py
│   ├── resize_lora.py
│   ├── sdxl_merge_lora.py
│   └── svd_merge_lora.py
├── pytest.ini
├── pytorch_lightning/
│   ├── __init__.py
│   └── callbacks/
│       ├── __init__.py
│       └── model_checkpoint.py
├── requirements.txt
├── sd3_minimal_inference.py
├── sd3_train.py
├── sd3_train_network.py
├── sdxl_gen_img.py
├── sdxl_minimal_inference.py
├── sdxl_train.py
├── sdxl_train_control_net.py
├── sdxl_train_control_net_lllite.py
├── sdxl_train_control_net_lllite_old.py
├── sdxl_train_network.py
├── sdxl_train_textual_inversion.py
├── setup.py
├── tests/
│   ├── README.md
│   ├── library/
│   │   ├── test_flux_train_utils.py
│   │   ├── test_lumina_models.py
│   │   ├── test_lumina_train_util.py
│   │   ├── test_lumina_util.py
│   │   ├── test_sai_model_spec.py
│   │   └── test_strategy_lumina.py
│   ├── manual_test_anima_cache.py
│   ├── manual_test_anima_real_training.py
│   ├── test_custom_offloading_utils.py
│   ├── test_fine_tune.py
│   ├── test_flux_train.py
│   ├── test_flux_train_network.py
│   ├── test_lumina_train_network.py
│   ├── test_optimizer.py
│   ├── test_sd3_train.py
│   ├── test_sd3_train_network.py
│   ├── test_sdxl_train.py
│   ├── test_sdxl_train_network.py
│   ├── test_train.py
│   ├── test_train_network.py
│   ├── test_train_textual_inversion.py
│   └── test_validation.py
├── tools/
│   ├── cache_latents.py
│   ├── cache_text_encoder_outputs.py
│   ├── canny.py
│   ├── convert_diffusers20_original_sd.py
│   ├── convert_diffusers_to_flux.py
│   ├── detect_face_rotate.py
│   ├── latent_upscaler.py
│   ├── merge_models.py
│   ├── merge_sd3_safetensors.py
│   ├── original_control_net.py
│   ├── resize_images_to_resolution.py
│   └── show_metadata.py
├── train_control_net.py
├── train_controlnet.py
├── train_db.py
├── train_network.py
├── train_textual_inversion.py
└── train_textual_inversion_XTI.py

================================================
FILE CONTENTS
================================================

================================================
FILE: .ai/claude.prompt.md
================================================
## About This File

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

## 1. Project Context
Here is the essential context for our project. Please read and understand it thoroughly.

### Project Overview
@./context/01-overview.md


================================================
FILE: .ai/context/01-overview.md
================================================
This file provides the overview and guidance for developers working with the codebase, including setup instructions, architecture details, and common commands.

## Project Architecture

### Core Training Framework
The codebase is built around a **strategy pattern architecture** that supports multiple diffusion model families:

- **`library/strategy_base.py`**: Base classes for tokenization, text encoding, latent caching, and training strategies
- **`library/strategy_*.py`**: Model-specific implementations for SD, SDXL, SD3, FLUX, etc.
- **`library/train_util.py`**: Core training utilities shared across all model types
- **`library/config_util.py`**: Configuration management with TOML support

### Model Support Structure
Each supported model family has a consistent structure:
- **Training script**: `{model}_train.py` (full fine-tuning), `{model}_train_network.py` (LoRA/network training)
- **Model utilities**: `library/{model}_models.py`, `library/{model}_train_utils.py`, `library/{model}_utils.py`
- **Networks**: `networks/lora_{model}.py`, `networks/oft_{model}.py` for adapter training

### Supported Models
- **Stable Diffusion 1.x**: `train*.py`, `library/train_util.py`, `train_db.py` (for DreamBooth)
- **SDXL**: `sdxl_train*.py`, `library/sdxl_*`
- **SD3**: `sd3_train*.py`, `library/sd3_*`
- **FLUX.1**: `flux_train*.py`, `library/flux_*`

### Key Components

#### Memory Management
- **Block swapping**: CPU-GPU memory optimization via `--blocks_to_swap` parameter, works with custom offloading. Only available for models with transformer architectures like SD3 and FLUX.1.
- **Custom offloading**: `library/custom_offloading_utils.py` for advanced memory management
- **Gradient checkpointing**: Memory reduction during training

#### Training Features
- **LoRA training**: Low-rank adaptation networks in `networks/lora*.py`
- **ControlNet training**: Conditional generation control
- **Textual Inversion**: Custom embedding training
- **Multi-resolution training**: Bucket-based aspect ratio handling
- **Validation loss**: Real-time training monitoring, only for LoRA training

#### Configuration System
Dataset configuration uses TOML files with structured validation:
```toml
[datasets.sample_dataset]
  resolution = 1024
  batch_size = 2
  
  [[datasets.sample_dataset.subsets]]
    image_dir = "path/to/images"
    caption_extension = ".txt"
```

## Common Development Commands

### Training Commands Pattern
All training scripts follow this general pattern:
```bash
accelerate launch --mixed_precision bf16 {script_name}.py \
  --pretrained_model_name_or_path model.safetensors \
  --dataset_config config.toml \
  --output_dir output \
  --output_name model_name \
  [model-specific options]
```

### Memory Optimization
For low VRAM environments, use block swapping:
```bash
# Add to any training command for memory reduction
--blocks_to_swap 10  # Swap 10 blocks to CPU (adjust number as needed)
```

### Utility Scripts
Located in `tools/` directory:
- `tools/merge_lora.py`: Merge LoRA weights into base models
- `tools/cache_latents.py`: Pre-cache VAE latents for faster training
- `tools/cache_text_encoder_outputs.py`: Pre-cache text encoder outputs

## Development Notes

### Strategy Pattern Implementation
When adding support for new models, implement the four core strategies:
1. `TokenizeStrategy`: Text tokenization handling
2. `TextEncodingStrategy`: Text encoder forward pass
3. `LatentsCachingStrategy`: VAE encoding/caching
4. `TextEncoderOutputsCachingStrategy`: Text encoder output caching

### Testing Approach
- Unit tests focus on utility functions and model loading
- Integration tests validate training script syntax and basic execution
- Most tests use mocks to avoid requiring actual model files
- Add tests for new model support in `tests/test_{model}_*.py`

### Configuration System
- Use `config_util.py` dataclasses for type-safe configuration
- Support both command-line arguments and TOML file configuration
- Validate configuration early in training scripts to prevent runtime errors

### Memory Management
- Always consider VRAM limitations when implementing features
- Use gradient checkpointing for large models
- Implement block swapping for models with transformer architectures
- Cache intermediate results (latents, text embeddings) when possible

================================================
FILE: .ai/gemini.prompt.md
================================================
## About This File

This file provides guidance to Gemini CLI (https://github.com/google-gemini/gemini-cli) when working with code in this repository.

## 1. Project Context
Here is the essential context for our project. Please read and understand it thoroughly.

### Project Overview
@./context/01-overview.md


================================================
FILE: .github/FUNDING.yml
================================================
# These are supported funding model platforms

github: kohya-ss


================================================
FILE: .github/dependabot.yml
================================================
---
version: 2
updates:
  - package-ecosystem: "github-actions"
    directory: "/"
    schedule:
      interval: "monthly"


================================================
FILE: .github/workflows/tests.yml
================================================
name: Test with pytest

on: 
  push:
    branches:
      - main
      - dev
      - sd3
  pull_request:
    branches:
      - main
      - dev
      - sd3

# CKV2_GHA_1: "Ensure top-level permissions are not set to write-all"
permissions: read-all

jobs:
  build:
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-latest]
        python-version: ["3.10"] # Python versions to test
        pytorch-version: ["2.4.0", "2.6.0"] # PyTorch versions to test

    steps:
      - uses: actions/checkout@v4
        with:
          # https://woodruffw.github.io/zizmor/audits/#artipacked
          persist-credentials: false

      - uses: actions/setup-python@v5
        with:
          python-version: ${{ matrix.python-version }}
          cache: 'pip' 

      - name: Install and update pip, setuptools, wheel
        run: |
          # Setuptools, wheel for compiling some packages
          python -m pip install --upgrade pip setuptools wheel

      - name: Install dependencies
        run: |
          # Pre-install torch to pin version (requirements.txt has dependencies like transformers which requires pytorch)
          pip install dadaptation==3.2 torch==${{ matrix.pytorch-version }} torchvision pytest==8.3.4
          pip install -r requirements.txt

      - name: Test with pytest
        run: pytest # See pytest.ini for configuration



================================================
FILE: .github/workflows/typos.yml
================================================
---
name: Typos

on: 
  push:
    branches:
      - main
      - dev
  pull_request:
    types:
      - opened
      - synchronize
      - reopened

# CKV2_GHA_1: "Ensure top-level permissions are not set to write-all"
permissions: read-all

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v4
        with:
          # https://woodruffw.github.io/zizmor/audits/#artipacked
          persist-credentials: false

      - name: typos-action
        uses: crate-ci/typos@v1.28.1


================================================
FILE: .gitignore
================================================
logs
__pycache__
wd14_tagger_model
venv
*.egg-info
build
.vscode
wandb
CLAUDE.md
GEMINI.md
.claude
.gemini
MagicMock


================================================
FILE: LICENSE.md
================================================
                                 Apache License
                           Version 2.0, January 2004
                        http://www.apache.org/licenses/

   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

   1. Definitions.

      "License" shall mean the terms and conditions for use, reproduction,
      and distribution as defined by Sections 1 through 9 of this document.

      "Licensor" shall mean the copyright owner or entity authorized by
      the copyright owner that is granting the License.

      "Legal Entity" shall mean the union of the acting entity and all
      other entities that control, are controlled by, or are under common
      control with that entity. For the purposes of this definition,
      "control" means (i) the power, direct or indirect, to cause the
      direction or management of such entity, whether by contract or
      otherwise, or (ii) ownership of fifty percent (50%) or more of the
      outstanding shares, or (iii) beneficial ownership of such entity.

      "You" (or "Your") shall mean an individual or Legal Entity
      exercising permissions granted by this License.

      "Source" form shall mean the preferred form for making modifications,
      including but not limited to software source code, documentation
      source, and configuration files.

      "Object" form shall mean any form resulting from mechanical
      transformation or translation of a Source form, including but
      not limited to compiled object code, generated documentation,
      and conversions to other media types.

      "Work" shall mean the work of authorship, whether in Source or
      Object form, made available under the License, as indicated by a
      copyright notice that is included in or attached to the work
      (an example is provided in the Appendix below).

      "Derivative Works" shall mean any work, whether in Source or Object
      form, that is based on (or derived from) the Work and for which the
      editorial revisions, annotations, elaborations, or other modifications
      represent, as a whole, an original work of authorship. For the purposes
      of this License, Derivative Works shall not include works that remain
      separable from, or merely link (or bind by name) to the interfaces of,
      the Work and Derivative Works thereof.

      "Contribution" shall mean any work of authorship, including
      the original version of the Work and any modifications or additions
      to that Work or Derivative Works thereof, that is intentionally
      submitted to Licensor for inclusion in the Work by the copyright owner
      or by an individual or Legal Entity authorized to submit on behalf of
      the copyright owner. For the purposes of this definition, "submitted"
      means any form of electronic, verbal, or written communication sent
      to the Licensor or its representatives, including but not limited to
      communication on electronic mailing lists, source code control systems,
      and issue tracking systems that are managed by, or on behalf of, the
      Licensor for the purpose of discussing and improving the Work, but
      excluding communication that is conspicuously marked or otherwise
      designated in writing by the copyright owner as "Not a Contribution."

      "Contributor" shall mean Licensor and any individual or Legal Entity
      on behalf of whom a Contribution has been received by Licensor and
      subsequently incorporated within the Work.

   2. Grant of Copyright License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      copyright license to reproduce, prepare Derivative Works of,
      publicly display, publicly perform, sublicense, and distribute the
      Work and such Derivative Works in Source or Object form.

   3. Grant of Patent License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      (except as stated in this section) patent license to make, have made,
      use, offer to sell, sell, import, and otherwise transfer the Work,
      where such license applies only to those patent claims licensable
      by such Contributor that are necessarily infringed by their
      Contribution(s) alone or by combination of their Contribution(s)
      with the Work to which such Contribution(s) was submitted. If You
      institute patent litigation against any entity (including a
      cross-claim or counterclaim in a lawsuit) alleging that the Work
      or a Contribution incorporated within the Work constitutes direct
      or contributory patent infringement, then any patent licenses
      granted to You under this License for that Work shall terminate
      as of the date such litigation is filed.

   4. Redistribution. You may reproduce and distribute copies of the
      Work or Derivative Works thereof in any medium, with or without
      modifications, and in Source or Object form, provided that You
      meet the following conditions:

      (a) You must give any other recipients of the Work or
          Derivative Works a copy of this License; and

      (b) You must cause any modified files to carry prominent notices
          stating that You changed the files; and

      (c) You must retain, in the Source form of any Derivative Works
          that You distribute, all copyright, patent, trademark, and
          attribution notices from the Source form of the Work,
          excluding those notices that do not pertain to any part of
          the Derivative Works; and

      (d) If the Work includes a "NOTICE" text file as part of its
          distribution, then any Derivative Works that You distribute must
          include a readable copy of the attribution notices contained
          within such NOTICE file, excluding those notices that do not
          pertain to any part of the Derivative Works, in at least one
          of the following places: within a NOTICE text file distributed
          as part of the Derivative Works; within the Source form or
          documentation, if provided along with the Derivative Works; or,
          within a display generated by the Derivative Works, if and
          wherever such third-party notices normally appear. The contents
          of the NOTICE file are for informational purposes only and
          do not modify the License. You may add Your own attribution
          notices within Derivative Works that You distribute, alongside
          or as an addendum to the NOTICE text from the Work, provided
          that such additional attribution notices cannot be construed
          as modifying the License.

      You may add Your own copyright statement to Your modifications and
      may provide additional or different license terms and conditions
      for use, reproduction, or distribution of Your modifications, or
      for any such Derivative Works as a whole, provided Your use,
      reproduction, and distribution of the Work otherwise complies with
      the conditions stated in this License.

   5. Submission of Contributions. Unless You explicitly state otherwise,
      any Contribution intentionally submitted for inclusion in the Work
      by You to the Licensor shall be under the terms and conditions of
      this License, without any additional terms or conditions.
      Notwithstanding the above, nothing herein shall supersede or modify
      the terms of any separate license agreement you may have executed
      with Licensor regarding such Contributions.

   6. Trademarks. This License does not grant permission to use the trade
      names, trademarks, service marks, or product names of the Licensor,
      except as required for reasonable and customary use in describing the
      origin of the Work and reproducing the content of the NOTICE file.

   7. Disclaimer of Warranty. Unless required by applicable law or
      agreed to in writing, Licensor provides the Work (and each
      Contributor provides its Contributions) on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
      implied, including, without limitation, any warranties or conditions
      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
      PARTICULAR PURPOSE. You are solely responsible for determining the
      appropriateness of using or redistributing the Work and assume any
      risks associated with Your exercise of permissions under this License.

   8. Limitation of Liability. In no event and under no legal theory,
      whether in tort (including negligence), contract, or otherwise,
      unless required by applicable law (such as deliberate and grossly
      negligent acts) or agreed to in writing, shall any Contributor be
      liable to You for damages, including any direct, indirect, special,
      incidental, or consequential damages of any character arising as a
      result of this License or out of the use or inability to use the
      Work (including but not limited to damages for loss of goodwill,
      work stoppage, computer failure or malfunction, or any and all
      other commercial damages or losses), even if such Contributor
      has been advised of the possibility of such damages.

   9. Accepting Warranty or Additional Liability. While redistributing
      the Work or Derivative Works thereof, You may choose to offer,
      and charge a fee for, acceptance of support, warranty, indemnity,
      or other liability obligations and/or rights consistent with this
      License. However, in accepting such obligations, You may act only
      on Your own behalf and on Your sole responsibility, not on behalf
      of any other Contributor, and only if You agree to indemnify,
      defend, and hold each Contributor harmless for any liability
      incurred by, or claims asserted against, such Contributor by reason
      of your accepting any such warranty or additional liability.

   END OF TERMS AND CONDITIONS

   APPENDIX: How to apply the Apache License to your work.

      To apply the Apache License to your work, attach the following
      boilerplate notice, with the fields enclosed by brackets "[]"
      replaced with your own identifying information. (Don't include
      the brackets!)  The text should be enclosed in the appropriate
      comment syntax for the file format. We also recommend that a
      file or class name and description of purpose be included on the
      same "printed page" as the copyright notice for easier
      identification within third-party archives.

   Copyright [2022] [kohya-ss]

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.


================================================
FILE: README-ja.md
================================================
# sd-scripts

[English](./README.md) / [日本語](./README-ja.md)

## 目次

<details>
<summary>クリックすると展開します</summary>

- [はじめに](#はじめに)
  - [スポンサー](#スポンサー)
  - [スポンサー募集のお知らせ](#スポンサー募集のお知らせ)
  - [更新履歴](#更新履歴)
  - [サポートモデル](#サポートモデル)
  - [機能](#機能)
- [ドキュメント](#ドキュメント)
  - [学習ドキュメント(英語および日本語)](#学習ドキュメント英語および日本語)
  - [その他のドキュメント](#その他のドキュメント)
  - [旧ドキュメント(日本語)](#旧ドキュメント日本語)
- [AIコーディングエージェントを使う開発者の方へ](#aiコーディングエージェントを使う開発者の方へ)
- [Windows環境でのインストール](#windows環境でのインストール)
  - [Windowsでの動作に必要なプログラム](#windowsでの動作に必要なプログラム)
  - [インストール手順](#インストール手順)
  - [requirements.txtとPyTorchについて](#requirementstxtとpytorchについて)
  - [xformersのインストール(オプション)](#xformersのインストールオプション)
- [Linux/WSL2環境でのインストール](#linuxwsl2環境でのインストール)
  - [DeepSpeedのインストール(実験的、LinuxまたはWSL2のみ)](#deepspeedのインストール実験的linuxまたはwsl2のみ)
- [アップグレード](#アップグレード)
  - [PyTorchのアップグレード](#pytorchのアップグレード)
- [謝意](#謝意)
- [ライセンス](#ライセンス)

</details>

## はじめに

Stable Diffusion等の画像生成モデルの学習、モデルによる画像生成、その他のスクリプトを入れたリポジトリです。

### スポンサー

このプロジェクトを支援してくださる企業・団体の皆様に深く感謝いたします。

<a href="https://aihub.co.jp/">
  <img src="./images/logo_aihub.png" alt="AiHUB株式会社" title="AiHUB株式会社" height="100px">
</a>

### スポンサー募集のお知らせ

このプロジェクトがお役に立ったなら、ご支援いただけると嬉しく思います。 [GitHub Sponsors](https://github.com/sponsors/kohya-ss/)で受け付けています。

### 更新履歴

- **Version 0.10.1 (2026-02-13):**
  - [Anima Preview](https://huggingface.co/circlestone-labs/Anima)モデルのLoRA学習およびfine-tuningをサポートしました。[PR #2260](https://github.com/kohya-ss/sd-scripts/pull/2260) および[PR #2261](https://github.com/kohya-ss/sd-scripts/pull/2261)
  - 素晴らしいモデルを公開された CircleStone Labs、および PR #2260を提出していただいたduongve13112002氏に深く感謝します。
  - 詳細は[ドキュメント](./docs/anima_train_network.md)をご覧ください。

- **Version 0.10.0 (2026-01-19):**
  - `sd3`ブランチを`main`ブランチにマージしました。このバージョンからFLUX.1およびSD3/SD3.5等のモデルが`main`ブランチでサポートされます。
  - ドキュメントにはまだ不備があるため、お気づきの点はIssue等でお知らせください。
  - `sd3`ブランチは当面、`dev`ブランチと同期して開発ブランチとして維持します。

### サポートモデル

* **Stable Diffusion 1.x/2.x**
* **SDXL**
* **SD3/SD3.5**
* **FLUX.1**
* **LUMINA**
* **HunyuanImage-2.1**

### 機能

* LoRA学習
* fine-tuning(DreamBooth):HunyuanImage-2.1以外のモデル
* Textual Inversion学習:SD/SDXL
* 画像生成
* その他、モデル変換やタグ付け、LoRAマージなどのユーティリティ

## ドキュメント

### 学習ドキュメント(英語および日本語)

日本語は折りたたまれているか、別のドキュメントにあります。

* [LoRA学習の概要](./docs/train_network.md)
* [データセット設定](./docs/config_README-ja.md) / [英語版](./docs/config_README-en.md)
* [高度な学習オプション](./docs/train_network_advanced.md)
* [SDXL学習](./docs/sdxl_train_network.md)
* [SD3学習](./docs/sd3_train_network.md)
* [FLUX.1学習](./docs/flux_train_network.md)
* [LUMINA学習](./docs/lumina_train_network.md)
* [HunyuanImage-2.1学習](./docs/hunyuan_image_train_network.md)
* [Fine-tuning](./docs/fine_tune.md)
* [Textual Inversion学習](./docs/train_textual_inversion.md)
* [ControlNet-LLLite学習](./docs/train_lllite_README-ja.md) / [英語版](./docs/train_lllite_README.md)
* [Validation](./docs/validation.md)
* [マスク損失学習](./docs/masked_loss_README-ja.md) / [英語版](./docs/masked_loss_README.md)

### その他のドキュメント

* [画像生成スクリプト](./docs/gen_img_README-ja.md) / [英語版](./docs/gen_img_README.md)
* [WD14 Taggerによる画像タグ付け](./docs/wd14_tagger_README-ja.md) / [英語版](./docs/wd14_tagger_README-en.md)

### 旧ドキュメント(日本語)

* [学習について、共通編](./docs/train_README-ja.md) : データ整備やオプションなど
* [DreamBoothの学習について](./docs/train_db_README-ja.md)

## AIコーディングエージェントを使う開発者の方へ

This repository provides recommended instructions to help AI agents like Claude and Gemini understand our project context and coding standards.

To use them, you need to opt-in by creating your own configuration file in the project root.

**Quick Setup:**

1.  Create a `CLAUDE.md` and/or `GEMINI.md` file in the project root.
2.  Add the following line to your `CLAUDE.md` to import the repository's recommended prompt:

    ```markdown
    @./.ai/claude.prompt.md
    ```

    or for Gemini:

    ```markdown
    @./.ai/gemini.prompt.md
    ```

3.  You can now add your own personal instructions below the import line (e.g., `Always respond in Japanese.`).

This approach ensures that you have full control over the instructions given to your agent while benefiting from the shared project context. Your `CLAUDE.md` and `GEMINI.md` are already listed in `.gitignore`, so they won't be committed to the repository.

このリポジトリでは、AIコーディングエージェント(例:Claude、Geminiなど)がプロジェクトのコンテキストやコーディング標準を理解できるようにするための推奨プロンプトを提供しています。

それらを使用するには、プロジェクトディレクトリに設定ファイルを作成して明示的に有効にする必要があります。

**簡単なセットアップ手順:**

1.  プロジェクトルートに `CLAUDE.md` や `GEMINI.md` ファイルを作成します。
2.  `CLAUDE.md` に以下の行を追加して、リポジトリの推奨プロンプトをインポートします。

    ```markdown
    @./.ai/claude.prompt.md
    ```

    またはGeminiの場合:

    ```markdown
    @./.ai/gemini.prompt.md
    ``` 
3.  インポート行の下に、独自の指示を追加できます(例:`常に日本語で応答してください。`)。

この方法により、エージェントに与える指示を各開発者が管理しつつ、リポジトリの推奨コンテキストを活用できます。`CLAUDE.md` および `GEMINI.md` は `.gitignore` に登録されているため、リポジトリにコミットされることはありません。

## Windows環境でのインストール

### Windowsでの動作に必要なプログラム

Python 3.10.xおよびGitが必要です。

- Python 3.10.x: https://www.python.org/downloads/windows/ からWindows installer (64-bit)をダウンロード
- git: https://git-scm.com/download/win から最新版をダウンロード

Python 3.11.x、3.12.xでも恐らく動作します(未テスト)。

PowerShellを使う場合、venvを使えるようにするためには以下の手順でセキュリティ設定を変更してください。
(venvに限らずスクリプトの実行が可能になりますので注意してください。)

- PowerShellを管理者として開きます。
- 「Set-ExecutionPolicy Unrestricted」と入力し、Yと答えます。
- 管理者のPowerShellを閉じます。

### インストール手順

PowerShellを使う場合、通常の(管理者ではない)PowerShellを開き以下を順に実行します。

```powershell
git clone https://github.com/kohya-ss/sd-scripts.git
cd sd-scripts

python -m venv venv
.\venv\Scripts\activate

pip install torch==2.6.0 torchvision==0.21.0 --index-url https://download.pytorch.org/whl/cu124
pip install --upgrade -r requirements.txt

accelerate config
```

コマンドプロンプトでも同一です。

(なお、python -m venv~の行で「python」とだけ表示された場合、py -m venv~のようにpythonをpyに変更してください。)

注:`bitsandbytes`、`prodigyopt`、`lion-pytorch` は `requirements.txt` に含まれています。

この例ではCUDA 12.4版をインストールします。異なるバージョンのCUDAを使用する場合は、適切なバージョンのPyTorchをインストールしてください。たとえばCUDA 12.1版の場合は `pip install torch==2.6.0 torchvision==0.21.0 --index-url https://download.pytorch.org/whl/cu121` としてください。

accelerate configの質問には以下のように答えてください。(bf16で学習する場合、最後の質問にはbf16と答えてください。)

```txt
- This machine
- No distributed training
- NO
- NO
- NO
- all
- fp16
```

※場合によって ``ValueError: fp16 mixed precision requires a GPU`` というエラーが出ることがあるようです。この場合、6番目の質問(
``What GPU(s) (by id) should be used for training on this machine as a comma-separated list? [all]:``)に「0」と答えてください。(id `0`のGPUが使われます。)

### requirements.txtとPyTorchについて

PyTorchは環境によってバージョンが異なるため、requirements.txtには含まれていません。前述のインストール手順を参考に、環境に合わせてPyTorchをインストールしてください。

スクリプトはPyTorch 2.6.0でテストしています。PyTorch 2.6.0以降が必要です。

RTX 50シリーズGPUの場合、PyTorch 2.8.0とCUDA 12.8/12.9を使用してください。`requirements.txt`はこのバージョンでも動作します。

### xformersのインストール(オプション)

xformersをインストールするには、仮想環境を有効にした状態で以下のコマンドを実行してください。

```bash
pip install xformers --index-url https://download.pytorch.org/whl/cu124
```

必要に応じてCUDAバージョンを変更してください。一部のGPUアーキテクチャではxformersが利用できない場合があります。

## Linux/WSL2環境でのインストール

LinuxまたはWSL2環境でのインストール手順はWindows環境とほぼ同じです。`venv\Scripts\activate` の部分を `source venv/bin/activate` に変更してください。

※NVIDIAドライバやCUDAツールキットなどは事前にインストールしておいてください。

### DeepSpeedのインストール(実験的、LinuxまたはWSL2のみ)

DeepSpeedをインストールするには、仮想環境を有効にした状態で以下のコマンドを実行してください。

```bash
pip install deepspeed==0.16.7
```

## アップグレード

新しいリリースがあった場合、以下のコマンドで更新できます。

```powershell
cd sd-scripts
git pull
.\venv\Scripts\activate
pip install --use-pep517 --upgrade -r requirements.txt
```

コマンドが成功すれば新しいバージョンが使用できます。

### PyTorchのアップグレード

PyTorchをアップグレードする場合は、[Windows環境でのインストール](#windows環境でのインストール)のセクションの`pip install`コマンドを参考にしてください。

## 謝意

LoRAの実装は[cloneofsimo氏のリポジトリ](https://github.com/cloneofsimo/lora)を基にしたものです。感謝申し上げます。

Conv2d 3x3への拡大は [cloneofsimo氏](https://github.com/cloneofsimo/lora) が最初にリリースし、KohakuBlueleaf氏が [LoCon](https://github.com/KohakuBlueleaf/LoCon) でその有効性を明らかにしたものです。KohakuBlueleaf氏に深く感謝します。

## ライセンス

スクリプトのライセンスはASL 2.0ですが(Diffusersおよびcloneofsimo氏のリポジトリ由来のものも同様)、一部他のライセンスのコードを含みます。

[Memory Efficient Attention Pytorch](https://github.com/lucidrains/memory-efficient-attention-pytorch): MIT

[bitsandbytes](https://github.com/TimDettmers/bitsandbytes): MIT

[BLIP](https://github.com/salesforce/BLIP): BSD-3-Clause


================================================
FILE: README.md
================================================
# sd-scripts

[English](./README.md) / [日本語](./README-ja.md)

## Table of Contents
<details>
<summary>Click to expand</summary>

- [Introduction](#introduction)
  - [Supported Models](#supported-models)
  - [Features](#features)
  - [Sponsors](#sponsors)
  - [Support the Project](#support-the-project)
- [Documentation](#documentation)
  - [Training Documentation (English and Japanese)](#training-documentation-english-and-japanese)
  - [Other Documentation (English and Japanese)](#other-documentation-english-and-japanese)
- [For Developers Using AI Coding Agents](#for-developers-using-ai-coding-agents)
- [Windows Installation](#windows-installation)
  - [Windows Required Dependencies](#windows-required-dependencies)
  - [Installation Steps](#installation-steps)
  - [About requirements.txt and PyTorch](#about-requirementstxt-and-pytorch)
  - [xformers installation (optional)](#xformers-installation-optional)
- [Linux/WSL2 Installation](#linuxwsl2-installation)
  - [DeepSpeed installation (experimental, Linux or WSL2 only)](#deepspeed-installation-experimental-linux-or-wsl2-only)
- [Upgrade](#upgrade)
  - [Upgrade PyTorch](#upgrade-pytorch)
- [Credits](#credits)
- [License](#license)

</details>

## Introduction

This repository contains training, generation and utility scripts for Stable Diffusion and other image generation models.

### Sponsors

We are grateful to the following companies for their generous sponsorship:

<a href="https://aihub.co.jp/top-en">
  <img src="./images/logo_aihub.png" alt="AiHUB Inc." title="AiHUB Inc." height="100px">
</a>

### Support the Project

If you find this project helpful, please consider supporting its development via [GitHub Sponsors](https://github.com/sponsors/kohya-ss/). Your support is greatly appreciated!

### Change History

- **Version 0.10.1 (2026-02-13):**
    - [Anima Preview](https://huggingface.co/circlestone-labs/Anima) model LoRA training and fine-tuning are now supported. See [PR #2260](https://github.com/kohya-ss/sd-scripts/pull/2260) and [PR #2261](https://github.com/kohya-ss/sd-scripts/pull/2261).
    - Many thanks to CircleStone Labs for releasing this amazing model, and to duongve13112002 for submitting great PR #2260.
    - For details, please refer to the [documentation](./docs/anima_train_network.md).

- **Version 0.10.0 (2026-01-19):**
    - `sd3` branch is merged to `main` branch. From this version, FLUX.1 and SD3/SD3.5 etc. are supported in the `main` branch.
    - There are still some missing parts in the documentation, so please let us know if you find any issues via Issues etc.
    - The `sd3` branch will be maintained as a development branch synchronized with `dev` for the time being.

### Supported Models

* **Stable Diffusion 1.x/2.x**
* **SDXL**
* **SD3/SD3.5**
* **FLUX.1**
* **LUMINA**
* **HunyuanImage-2.1**

### Features

* LoRA training
* Fine-tuning (native training, DreamBooth): except for HunyuanImage-2.1
* Textual Inversion training: SD/SDXL
* Image generation
* Other utilities such as model conversion, image tagging, LoRA merging, etc.

## Documentation

### Training Documentation (English and Japanese)

* [LoRA Training Overview](./docs/train_network.md)
* [Dataset config](./docs/config_README-en.md) / [Japanese version](./docs/config_README-ja.md)
* [Advanced Training](./docs/train_network_advanced.md)
* [SDXL Training](./docs/sdxl_train_network.md)
* [SD3 Training](./docs/sd3_train_network.md)
* [FLUX.1 Training](./docs/flux_train_network.md)
* [LUMINA Training](./docs/lumina_train_network.md)
* [HunyuanImage-2.1 Training](./docs/hunyuan_image_train_network.md)
* [Fine-tuning](./docs/fine_tune.md)
* [Textual Inversion Training](./docs/train_textual_inversion.md)
* [ControlNet-LLLite Training](./docs/train_lllite_README.md) / [Japanese version](./docs/train_lllite_README-ja.md)
* [Validation](./docs/validation.md)
* [Masked Loss Training](./docs/masked_loss_README.md) / [Japanese version](./docs/masked_loss_README-ja.md)

### Other Documentation (English and Japanese)

* [Image generation](./docs/gen_img_README.md) / [Japanese version](./docs/gen_img_README-ja.md)
* [Tagging images with WD14 Tagger](./docs/wd14_tagger_README-en.md) / [Japanese version](./docs/wd14_tagger_README-ja.md)

## For Developers Using AI Coding Agents

This repository provides recommended instructions to help AI agents like Claude and Gemini understand our project context and coding standards.

To use them, you need to opt-in by creating your own configuration file in the project root.

**Quick Setup:**

1.  Create a `CLAUDE.md` and/or `GEMINI.md` file in the project root.
2.  Add the following line to your `CLAUDE.md` to import the repository's recommended prompt:

    ```markdown
    @./.ai/claude.prompt.md
    ```

    or for Gemini:

    ```markdown
    @./.ai/gemini.prompt.md
    ```

3.  You can now add your own personal instructions below the import line (e.g., `Always respond in Japanese.`).

This approach ensures that you have full control over the instructions given to your agent while benefiting from the shared project context. Your `CLAUDE.md` and `GEMINI.md` are already listed in `.gitignore`, so they won't be committed to the repository.

## Windows Installation

### Windows Required Dependencies

Python 3.10.x and Git:

- Python 3.10.x: Download Windows installer (64-bit) from https://www.python.org/downloads/windows/
- git: Download latest installer from https://git-scm.com/download/win

Python 3.11.x, and 3.12.x will work but not tested.

Give unrestricted script access to powershell so venv can work:

- Open an administrator powershell window
- Type `Set-ExecutionPolicy Unrestricted` and answer A
- Close admin powershell window

### Installation Steps

Open a regular Powershell terminal and type the following inside:

```powershell
git clone https://github.com/kohya-ss/sd-scripts.git
cd sd-scripts

python -m venv venv
.\venv\Scripts\activate

pip install torch==2.6.0 torchvision==0.21.0 --index-url https://download.pytorch.org/whl/cu124
pip install --upgrade -r requirements.txt

accelerate config
```

If `python -m venv` shows only `python`, change `python` to `py`.

Note: `bitsandbytes`, `prodigyopt` and `lion-pytorch` are included in the requirements.txt. If you'd like to use another version, please install it manually.

This installation is for CUDA 12.4. If you use a different version of CUDA, please install the appropriate version of PyTorch. For example, if you use CUDA 12.1, please install `pip install torch==2.6.0 torchvision==0.21.0 --index-url https://download.pytorch.org/whl/cu121`.

Answers to accelerate config:

```txt
- This machine
- No distributed training
- NO
- NO
- NO
- all
- fp16
```

If you'd like to use bf16, please answer `bf16` to the last question.

Note: Some user reports ``ValueError: fp16 mixed precision requires a GPU`` is occurred in training. In this case, answer `0` for the 6th question: 
``What GPU(s) (by id) should be used for training on this machine as a comma-separated list? [all]:`` 

(Single GPU with id `0` will be used.)

## About requirements.txt and PyTorch

The file does not contain requirements for PyTorch. Because the version of PyTorch depends on the environment, it is not included in the file. Please install PyTorch first according to the environment. See installation instructions below.

The scripts are tested with PyTorch 2.6.0. PyTorch 2.6.0 or later is required.

For RTX 50 series GPUs, PyTorch 2.8.0 with CUDA 12.8/12.9 should be used. `requirements.txt` will work with this version.

### xformers installation (optional)

To install xformers, run the following command in your activated virtual environment:

```bash
pip install xformers --index-url https://download.pytorch.org/whl/cu124
```

Please change the CUDA version in the URL according to your environment if necessary. xformers may not be available for some GPU architectures.

## Linux/WSL2 Installation

Linux or WSL2 installation steps are almost the same as Windows. Just change `venv\Scripts\activate` to `source venv/bin/activate`.

Note: Please make sure that NVIDIA driver and CUDA toolkit are installed in advance.

### DeepSpeed installation (experimental, Linux or WSL2 only)
  
To install DeepSpeed, run the following command in your activated virtual environment:

```bash
pip install deepspeed==0.16.7 
```

## Upgrade

When a new release comes out you can upgrade your repo with the following command:

```powershell
cd sd-scripts
git pull
.\venv\Scripts\activate
pip install --use-pep517 --upgrade -r requirements.txt
```

Once the commands have completed successfully you should be ready to use the new version.

### Upgrade PyTorch

If you want to upgrade PyTorch, you can upgrade it with `pip install` command in [Windows Installation](#windows-installation) section.

## Credits

The implementation for LoRA is based on [cloneofsimo's repo](https://github.com/cloneofsimo/lora). Thank you for great work!

The LoRA expansion to Conv2d 3x3 was initially released by cloneofsimo and its effectiveness was demonstrated at [LoCon](https://github.com/KohakuBlueleaf/LoCon) by KohakuBlueleaf. Thank you so much KohakuBlueleaf!

## License

The majority of scripts is licensed under ASL 2.0 (including codes from Diffusers, cloneofsimo's and LoCon), however portions of the project are available under separate license terms:

[Memory Efficient Attention Pytorch](https://github.com/lucidrains/memory-efficient-attention-pytorch): MIT

[bitsandbytes](https://github.com/TimDettmers/bitsandbytes): MIT

[BLIP](https://github.com/salesforce/BLIP): BSD-3-Clause


================================================
FILE: XTI_hijack.py
================================================
import torch
from library.device_utils import init_ipex
init_ipex()

from typing import Union, List, Optional, Dict, Any, Tuple
from diffusers.models.unet_2d_condition import UNet2DConditionOutput

from library.original_unet import SampleOutput


def unet_forward_XTI(
    self,
    sample: torch.FloatTensor,
    timestep: Union[torch.Tensor, float, int],
    encoder_hidden_states: torch.Tensor,
    class_labels: Optional[torch.Tensor] = None,
    return_dict: bool = True,
) -> Union[Dict, Tuple]:
    r"""
    Args:
        sample (`torch.FloatTensor`): (batch, channel, height, width) noisy inputs tensor
        timestep (`torch.FloatTensor` or `float` or `int`): (batch) timesteps
        encoder_hidden_states (`torch.FloatTensor`): (batch, sequence_length, feature_dim) encoder hidden states
        return_dict (`bool`, *optional*, defaults to `True`):
            Whether or not to return a dict instead of a plain tuple.

    Returns:
        `SampleOutput` or `tuple`:
        `SampleOutput` if `return_dict` is True, otherwise a `tuple`. When returning a tuple, the first element is the sample tensor.
    """
    # By default samples have to be AT least a multiple of the overall upsampling factor.
    # The overall upsampling factor is equal to 2 ** (# num of upsampling layears).
    # However, the upsampling interpolation output size can be forced to fit any upsampling size
    # on the fly if necessary.
    # デフォルトではサンプルは「2^アップサンプルの数」、つまり64の倍数である必要がある
    # ただそれ以外のサイズにも対応できるように、必要ならアップサンプルのサイズを変更する
    # 多分画質が悪くなるので、64で割り切れるようにしておくのが良い
    default_overall_up_factor = 2**self.num_upsamplers

    # upsample size should be forwarded when sample is not a multiple of `default_overall_up_factor`
    # 64で割り切れないときはupsamplerにサイズを伝える
    forward_upsample_size = False
    upsample_size = None

    if any(s % default_overall_up_factor != 0 for s in sample.shape[-2:]):
        # logger.info("Forward upsample size to force interpolation output size.")
        forward_upsample_size = True

    # 1. time
    timesteps = timestep
    timesteps = self.handle_unusual_timesteps(sample, timesteps)  # 変な時だけ処理

    t_emb = self.time_proj(timesteps)

    # timesteps does not contain any weights and will always return f32 tensors
    # but time_embedding might actually be running in fp16. so we need to cast here.
    # there might be better ways to encapsulate this.
    # timestepsは重みを含まないので常にfloat32のテンソルを返す
    # しかしtime_embeddingはfp16で動いているかもしれないので、ここでキャストする必要がある
    # time_projでキャストしておけばいいんじゃね?
    t_emb = t_emb.to(dtype=self.dtype)
    emb = self.time_embedding(t_emb)

    # 2. pre-process
    sample = self.conv_in(sample)

    # 3. down
    down_block_res_samples = (sample,)
    down_i = 0
    for downsample_block in self.down_blocks:
        # downblockはforwardで必ずencoder_hidden_statesを受け取るようにしても良さそうだけど、
        # まあこちらのほうがわかりやすいかもしれない
        if downsample_block.has_cross_attention:
            sample, res_samples = downsample_block(
                hidden_states=sample,
                temb=emb,
                encoder_hidden_states=encoder_hidden_states[down_i : down_i + 2],
            )
            down_i += 2
        else:
            sample, res_samples = downsample_block(hidden_states=sample, temb=emb)

        down_block_res_samples += res_samples

    # 4. mid
    sample = self.mid_block(sample, emb, encoder_hidden_states=encoder_hidden_states[6])

    # 5. up
    up_i = 7
    for i, upsample_block in enumerate(self.up_blocks):
        is_final_block = i == len(self.up_blocks) - 1

        res_samples = down_block_res_samples[-len(upsample_block.resnets) :]
        down_block_res_samples = down_block_res_samples[: -len(upsample_block.resnets)]  # skip connection

        # if we have not reached the final block and need to forward the upsample size, we do it here
        # 前述のように最後のブロック以外ではupsample_sizeを伝える
        if not is_final_block and forward_upsample_size:
            upsample_size = down_block_res_samples[-1].shape[2:]

        if upsample_block.has_cross_attention:
            sample = upsample_block(
                hidden_states=sample,
                temb=emb,
                res_hidden_states_tuple=res_samples,
                encoder_hidden_states=encoder_hidden_states[up_i : up_i + 3],
                upsample_size=upsample_size,
            )
            up_i += 3
        else:
            sample = upsample_block(
                hidden_states=sample, temb=emb, res_hidden_states_tuple=res_samples, upsample_size=upsample_size
            )

    # 6. post-process
    sample = self.conv_norm_out(sample)
    sample = self.conv_act(sample)
    sample = self.conv_out(sample)

    if not return_dict:
        return (sample,)

    return SampleOutput(sample=sample)


def downblock_forward_XTI(
    self, hidden_states, temb=None, encoder_hidden_states=None, attention_mask=None, cross_attention_kwargs=None
):
    output_states = ()
    i = 0

    for resnet, attn in zip(self.resnets, self.attentions):
        if self.training and self.gradient_checkpointing:

            def create_custom_forward(module, return_dict=None):
                def custom_forward(*inputs):
                    if return_dict is not None:
                        return module(*inputs, return_dict=return_dict)
                    else:
                        return module(*inputs)

                return custom_forward

            hidden_states = torch.utils.checkpoint.checkpoint(create_custom_forward(resnet), hidden_states, temb)
            hidden_states = torch.utils.checkpoint.checkpoint(
                create_custom_forward(attn, return_dict=False), hidden_states, encoder_hidden_states[i]
            )[0]
        else:
            hidden_states = resnet(hidden_states, temb)
            hidden_states = attn(hidden_states, encoder_hidden_states=encoder_hidden_states[i]).sample

        output_states += (hidden_states,)
        i += 1

    if self.downsamplers is not None:
        for downsampler in self.downsamplers:
            hidden_states = downsampler(hidden_states)

        output_states += (hidden_states,)

    return hidden_states, output_states


def upblock_forward_XTI(
    self,
    hidden_states,
    res_hidden_states_tuple,
    temb=None,
    encoder_hidden_states=None,
    upsample_size=None,
):
    i = 0
    for resnet, attn in zip(self.resnets, self.attentions):
        # pop res hidden states
        res_hidden_states = res_hidden_states_tuple[-1]
        res_hidden_states_tuple = res_hidden_states_tuple[:-1]
        hidden_states = torch.cat([hidden_states, res_hidden_states], dim=1)

        if self.training and self.gradient_checkpointing:

            def create_custom_forward(module, return_dict=None):
                def custom_forward(*inputs):
                    if return_dict is not None:
                        return module(*inputs, return_dict=return_dict)
                    else:
                        return module(*inputs)

                return custom_forward

            hidden_states = torch.utils.checkpoint.checkpoint(create_custom_forward(resnet), hidden_states, temb)
            hidden_states = torch.utils.checkpoint.checkpoint(
                create_custom_forward(attn, return_dict=False), hidden_states, encoder_hidden_states[i]
            )[0]
        else:
            hidden_states = resnet(hidden_states, temb)
            hidden_states = attn(hidden_states, encoder_hidden_states=encoder_hidden_states[i]).sample

        i += 1

    if self.upsamplers is not None:
        for upsampler in self.upsamplers:
            hidden_states = upsampler(hidden_states, upsample_size)

    return hidden_states


================================================
FILE: _typos.toml
================================================
# Files for typos
# Instruction:  https://github.com/marketplace/actions/typos-action#getting-started

[default.extend-identifiers]
ddPn08="ddPn08"

[default.extend-words]
NIN="NIN"
parms="parms"
nin="nin"
extention="extention" # Intentionally left
nd="nd"
shs="shs"
sts="sts"
scs="scs"
cpc="cpc"
coc="coc"
cic="cic"
msm="msm"
usu="usu"
ici="ici"
lvl="lvl"
dii="dii"
muk="muk"
ori="ori"
hru="hru"
rik="rik"
koo="koo"
yos="yos"
wn="wn"
hime="hime"
OT="OT"
byt="byt"
tak="tak"
temperal="temperal"

[files]
extend-exclude = ["_typos.toml", "venv", "configs"]


================================================
FILE: anima_minimal_inference.py
================================================
import argparse
import datetime
import gc
from importlib.util import find_spec
import random
import os
import time
import copy
from types import SimpleNamespace
from typing import Tuple, Optional, List, Any, Dict, Union

import torch
from safetensors.torch import load_file, save_file
from safetensors import safe_open
from tqdm import tqdm
from diffusers.utils.torch_utils import randn_tensor
from PIL import Image

from library import anima_models, anima_utils, hunyuan_image_utils, qwen_image_autoencoder_kl, strategy_anima, strategy_base
from library.device_utils import clean_memory_on_device, synchronize_device

lycoris_available = find_spec("lycoris") is not None
if lycoris_available:
    from lycoris.kohya import create_network_from_weights

from library.utils import setup_logging

setup_logging()
import logging

logger = logging.getLogger(__name__)


class GenerationSettings:
    def __init__(self, device: torch.device, dit_weight_dtype: Optional[torch.dtype] = None):
        self.device = device
        self.dit_weight_dtype = dit_weight_dtype  # not used currently because model may be optimized


def parse_args() -> argparse.Namespace:
    """parse command line arguments"""
    parser = argparse.ArgumentParser(description="HunyuanImage inference script")

    parser.add_argument("--dit", type=str, default=None, help="DiT directory or path")
    parser.add_argument("--vae", type=str, default=None, help="VAE directory or path")
    parser.add_argument(
        "--vae_chunk_size",
        type=int,
        default=None,
        help="Spatial chunk size for VAE encoding/decoding to reduce memory usage. Must be even number. If not specified, chunking is disabled (official behavior)."
        + " / メモリ使用量を減らすためのVAEエンコード/デコードの空間チャンクサイズ。偶数である必要があります。未指定の場合、チャンク処理は無効になります(公式の動作)。",
    )
    parser.add_argument(
        "--vae_disable_cache",
        action="store_true",
        help="Disable internal VAE caching mechanism to reduce memory usage. Encoding / decoding will also be faster, but this differs from official behavior."
        + " / VAEのメモリ使用量を減らすために内部のキャッシュ機構を無効にします。エンコード/デコードも速くなりますが、公式の動作とは異なります。",
    )
    parser.add_argument("--text_encoder", type=str, required=True, help="Text Encoder 1 (Qwen2.5-VL) directory or path")

    # LoRA
    parser.add_argument("--lora_weight", type=str, nargs="*", required=False, default=None, help="LoRA weight path")
    parser.add_argument("--lora_multiplier", type=float, nargs="*", default=1.0, help="LoRA multiplier")
    parser.add_argument("--include_patterns", type=str, nargs="*", default=None, help="LoRA module include patterns")
    parser.add_argument("--exclude_patterns", type=str, nargs="*", default=None, help="LoRA module exclude patterns")

    # inference
    parser.add_argument(
        "--guidance_scale", type=float, default=3.5, help="Guidance scale for classifier free guidance. Default is 3.5."
    )
    parser.add_argument("--prompt", type=str, default=None, help="prompt for generation")
    parser.add_argument("--negative_prompt", type=str, default="", help="negative prompt for generation, default is empty string")
    parser.add_argument("--image_size", type=int, nargs=2, default=[1024, 1024], help="image size, height and width")
    parser.add_argument("--infer_steps", type=int, default=50, help="number of inference steps, default is 50")
    parser.add_argument("--save_path", type=str, required=True, help="path to save generated video")
    parser.add_argument("--seed", type=int, default=None, help="Seed for evaluation.")

    # Flow Matching
    parser.add_argument(
        "--flow_shift",
        type=float,
        default=5.0,
        help="Shift factor for flow matching schedulers. Default is 5.0.",
    )

    parser.add_argument("--fp8", action="store_true", help="use fp8 for DiT model")
    parser.add_argument("--fp8_scaled", action="store_true", help="use scaled fp8 for DiT, only for fp8")

    parser.add_argument("--text_encoder_cpu", action="store_true", help="Inference on CPU for Text Encoders")
    parser.add_argument(
        "--device", type=str, default=None, help="device to use for inference. If None, use CUDA if available, otherwise use CPU"
    )
    parser.add_argument(
        "--attn_mode",
        type=str,
        default="torch",
        choices=["flash", "torch", "sageattn", "xformers", "sdpa"],  #  "sdpa" for backward compatibility
        help="attention mode",
    )
    parser.add_argument(
        "--output_type",
        type=str,
        default="images",
        choices=["images", "latent", "latent_images"],
        help="output type",
    )
    parser.add_argument("--no_metadata", action="store_true", help="do not save metadata")
    parser.add_argument("--latent_path", type=str, nargs="*", default=None, help="path to latent for decode. no inference")
    parser.add_argument(
        "--lycoris", action="store_true", help=f"use lycoris for inference{'' if lycoris_available else ' (not available)'}"
    )

    # arguments for batch and interactive modes
    parser.add_argument("--from_file", type=str, default=None, help="Read prompts from a file")
    parser.add_argument("--interactive", action="store_true", help="Interactive mode: read prompts from console")

    args = parser.parse_args()

    # Validate arguments
    if args.from_file and args.interactive:
        raise ValueError("Cannot use both --from_file and --interactive at the same time")

    if args.latent_path is None or len(args.latent_path) == 0:
        if args.prompt is None and not args.from_file and not args.interactive:
            raise ValueError("Either --prompt, --from_file or --interactive must be specified")

    if args.lycoris and not lycoris_available:
        raise ValueError("install lycoris: https://github.com/KohakuBlueleaf/LyCORIS")

    if args.attn_mode == "sdpa":
        args.attn_mode = "torch"  # backward compatibility

    return args


def parse_prompt_line(line: str) -> Dict[str, Any]:
    """Parse a prompt line into a dictionary of argument overrides

    Args:
        line: Prompt line with options

    Returns:
        Dict[str, Any]: Dictionary of argument overrides
    """
    parts = line.split(" --")
    prompt = parts[0].strip()

    # Create dictionary of overrides
    overrides = {"prompt": prompt}

    for part in parts[1:]:
        if not part.strip():
            continue
        option_parts = part.split(" ", 1)
        option = option_parts[0].strip()
        value = option_parts[1].strip() if len(option_parts) > 1 else ""

        # Map options to argument names
        if option == "w":
            overrides["image_size_width"] = int(value)
        elif option == "h":
            overrides["image_size_height"] = int(value)
        elif option == "d":
            overrides["seed"] = int(value)
        elif option == "s":
            overrides["infer_steps"] = int(value)
        elif option == "g" or option == "l":
            overrides["guidance_scale"] = float(value)
        elif option == "fs":
            overrides["flow_shift"] = float(value)
        elif option == "n":
            overrides["negative_prompt"] = value

    return overrides


def apply_overrides(args: argparse.Namespace, overrides: Dict[str, Any]) -> argparse.Namespace:
    """Apply overrides to args

    Args:
        args: Original arguments
        overrides: Dictionary of overrides

    Returns:
        argparse.Namespace: New arguments with overrides applied
    """
    args_copy = copy.deepcopy(args)

    for key, value in overrides.items():
        if key == "image_size_width":
            args_copy.image_size[1] = value
        elif key == "image_size_height":
            args_copy.image_size[0] = value
        else:
            setattr(args_copy, key, value)

    return args_copy


def check_inputs(args: argparse.Namespace) -> Tuple[int, int]:
    """Validate video size and length

    Args:
        args: command line arguments

    Returns:
        Tuple[int, int]: (height, width)
    """
    height = args.image_size[0]
    width = args.image_size[1]

    if height % 32 != 0 or width % 32 != 0:
        raise ValueError(f"`height` and `width` have to be divisible by 32 but are {height} and {width}.")

    return height, width


# region Model


def load_dit_model(
    args: argparse.Namespace, device: torch.device, dit_weight_dtype: Optional[torch.dtype] = None
) -> anima_models.Anima:
    """load DiT model

    Args:
        args: command line arguments
        device: device to use
        dit_weight_dtype: data type for the model weights. None for as-is

    Returns:
        anima_models.Anima: DiT model instance
    """
    # If LyCORIS is enabled, we will load the model to CPU and then merge LoRA weights (static method)

    loading_device = "cpu"
    if not args.lycoris:
        loading_device = device

    # load LoRA weights
    if not args.lycoris and args.lora_weight is not None and len(args.lora_weight) > 0:
        lora_weights_list = []
        for lora_weight in args.lora_weight:
            logger.info(f"Loading LoRA weight from: {lora_weight}")
            lora_sd = load_file(lora_weight)  # load on CPU, dtype is as is
            # lora_sd = filter_lora_state_dict(lora_sd, args.include_patterns, args.exclude_patterns)
            lora_sd = {k: v for k, v in lora_sd.items() if k.startswith("lora_unet_")}  # only keep unet lora weights
            lora_weights_list.append(lora_sd)
    else:
        lora_weights_list = None

    loading_weight_dtype = dit_weight_dtype
    if args.fp8_scaled and not args.lycoris:
        loading_weight_dtype = None  # we will load weights as-is and then optimize to fp8

    model = anima_utils.load_anima_model(
        device,
        args.dit,
        args.attn_mode,
        True,  # enable split_attn to trim masked tokens
        loading_device,
        loading_weight_dtype,
        args.fp8_scaled and not args.lycoris,
        lora_weights_list=lora_weights_list,
        lora_multipliers=args.lora_multiplier,
    )
    if not args.fp8_scaled:
        # simple cast to dit_weight_dtype
        target_dtype = None  # load as-is (dit_weight_dtype == dtype of the weights in state_dict)
        if dit_weight_dtype is not None:  # in case of args.fp8 and not args.fp8_scaled
            logger.info(f"Convert model to {dit_weight_dtype}")
            target_dtype = dit_weight_dtype

        logger.info(f"Move model to device: {device}")
        target_device = device

        model.to(target_device, target_dtype)  # move and cast  at the same time. this reduces redundant copy operations

    # model.to(device)
    model.to(device, dtype=torch.bfloat16)  # ensure model is in bfloat16 for inference

    model.eval().requires_grad_(False)
    clean_memory_on_device(device)

    return model


def load_text_encoder(
    args: argparse.Namespace, dtype: torch.dtype = torch.bfloat16, device: torch.device = torch.device("cpu")
) -> torch.nn.Module:
    lora_weights_list = None
    if args.lora_weight is not None and len(args.lora_weight) > 0:
        lora_weights_list = []
        for lora_weight in args.lora_weight:
            logger.info(f"Loading LoRA weight from: {lora_weight}")
            lora_sd = load_file(lora_weight)  # load on CPU, dtype is as is
            # lora_sd = filter_lora_state_dict(lora_sd, args.include_patterns, args.exclude_patterns)
            lora_sd = {
                "model_" + k[len("lora_te_") :]: v for k, v in lora_sd.items() if k.startswith("lora_te_")
            }  # only keep Text Encoder lora weights, remove prefix "lora_te_" and add "model_" prefix
            lora_weights_list.append(lora_sd)

    text_encoder, _ = anima_utils.load_qwen3_text_encoder(
        args.text_encoder, dtype=dtype, device=device, lora_weights=lora_weights_list, lora_multipliers=args.lora_multiplier
    )
    text_encoder.eval()
    return text_encoder


# endregion


def decode_latent(
    vae: qwen_image_autoencoder_kl.AutoencoderKLQwenImage, latent: torch.Tensor, device: torch.device
) -> torch.Tensor:
    logger.info(f"Decoding image. Latent shape {latent.shape}, device {device}")

    vae.to(device)
    with torch.no_grad():
        pixels = vae.decode_to_pixels(latent.to(device, dtype=vae.dtype))
        # pixels = vae.decode(latent.to(device, dtype=torch.bfloat16), scale=vae_scale)
    if pixels.ndim == 5:  # remove frame dimension if exists, [B, C, F, H, W] -> [B, C, H, W]
        pixels = pixels.squeeze(2)

    pixels = pixels.to("cpu", dtype=torch.float32)  # move to CPU and convert to float32 (bfloat16 is not supported by numpy)
    vae.to("cpu")

    logger.info(f"Decoded. Pixel shape {pixels.shape}")
    return pixels[0]  # remove batch dimension


def process_escape(text: str) -> str:
    """Process escape sequences in text

    Args:
        text: Input text with escape sequences

    Returns:
        str: Processed text
    """
    return text.encode("utf-8").decode("unicode_escape")


def prepare_text_inputs(
    args: argparse.Namespace, device: torch.device, anima: anima_models.Anima, shared_models: Optional[Dict] = None
) -> Tuple[Dict[str, Any], Dict[str, Any]]:
    """Prepare text-related inputs for T2I: LLM encoding. Anima model is also needed for preprocessing"""

    # load text encoder: conds_cache holds cached encodings for prompts without padding
    conds_cache = {}
    text_encoder_device = torch.device("cpu") if args.text_encoder_cpu else device
    if shared_models is not None:
        text_encoder = shared_models.get("text_encoder")

        if "conds_cache" in shared_models:  # Use shared cache if available
            conds_cache = shared_models["conds_cache"]

        # text_encoder is on device (batched inference) or CPU (interactive inference)
    else:  # Load if not in shared_models
        text_encoder_dtype = torch.bfloat16  # Default dtype for Text Encoder
        text_encoder = load_text_encoder(args, dtype=text_encoder_dtype, device=text_encoder_device)
        text_encoder.eval()
        tokenize_strategy = strategy_base.TokenizeStrategy.get_strategy()
        # Store references so load_target_model can reuse them

    # Store original devices to move back later if they were shared. This does nothing if shared_models is None
    text_encoder_original_device = text_encoder.device if text_encoder else None

    # Ensure text_encoder is not None before proceeding
    if not text_encoder:
        raise ValueError("Text encoder is not loaded properly.")

    # Define a function to move models to device if needed
    # This is to avoid moving models if not needed, especially in interactive mode
    model_is_moved = False

    def move_models_to_device_if_needed():
        nonlocal model_is_moved
        nonlocal shared_models

        if model_is_moved:
            return
        model_is_moved = True

        logger.info(f"Moving Text Encoder to appropriate device: {text_encoder_device}")
        text_encoder.to(text_encoder_device)  # If text_encoder_cpu is True, this will be CPU

    logger.info("Encoding prompt with Text Encoder")

    prompt = process_escape(args.prompt)
    cache_key = prompt
    if cache_key in conds_cache:
        embed = conds_cache[cache_key]
    else:
        move_models_to_device_if_needed()

        tokenize_strategy = strategy_base.TokenizeStrategy.get_strategy()
        encoding_strategy = strategy_base.TextEncodingStrategy.get_strategy()

        with torch.no_grad():
            # embed = anima_text_encoder.get_text_embeds(anima, tokenizer, text_encoder, t5xxl_tokenizer, prompt)
            tokens = tokenize_strategy.tokenize(prompt)
            embed = encoding_strategy.encode_tokens(tokenize_strategy, [text_encoder], tokens)
            crossattn_emb = anima._preprocess_text_embeds(
                source_hidden_states=embed[0].to(anima.device),
                target_input_ids=embed[2].to(anima.device),
                target_attention_mask=embed[3].to(anima.device),
                source_attention_mask=embed[1].to(anima.device),
            )
            crossattn_emb[~embed[3].bool()] = 0
            embed[0] = crossattn_emb
        embed[0] = embed[0].cpu()

        conds_cache[cache_key] = embed

    negative_prompt = process_escape(args.negative_prompt)
    cache_key = negative_prompt
    if cache_key in conds_cache:
        negative_embed = conds_cache[cache_key]
    else:
        move_models_to_device_if_needed()

        tokenize_strategy = strategy_base.TokenizeStrategy.get_strategy()
        encoding_strategy = strategy_base.TextEncodingStrategy.get_strategy()

        with torch.no_grad():
            # negative_embed = anima_text_encoder.get_text_embeds(anima, tokenizer, text_encoder, t5xxl_tokenizer, negative_prompt)
            tokens = tokenize_strategy.tokenize(negative_prompt)
            negative_embed = encoding_strategy.encode_tokens(tokenize_strategy, [text_encoder], tokens)
            crossattn_emb = anima._preprocess_text_embeds(
                source_hidden_states=negative_embed[0].to(anima.device),
                target_input_ids=negative_embed[2].to(anima.device),
                target_attention_mask=negative_embed[3].to(anima.device),
                source_attention_mask=negative_embed[1].to(anima.device),
            )
            crossattn_emb[~negative_embed[3].bool()] = 0
            negative_embed[0] = crossattn_emb
        negative_embed[0] = negative_embed[0].cpu()

        conds_cache[cache_key] = negative_embed

    if not (shared_models and "text_encoder" in shared_models):  # if loaded locally
        # There is a bug text_encoder is not freed from GPU memory when text encoder is fp8
        del text_encoder
        gc.collect()  # This may force Text Encoder to be freed from GPU memory
    else:  # if shared, move back to original device (likely CPU)
        if text_encoder:
            text_encoder.to(text_encoder_original_device)

    clean_memory_on_device(device)

    arg_c = {"embed": embed, "prompt": prompt}
    arg_null = {"embed": negative_embed, "prompt": negative_prompt}

    return arg_c, arg_null


def generate(
    args: argparse.Namespace,
    gen_settings: GenerationSettings,
    shared_models: Optional[Dict] = None,
    precomputed_text_data: Optional[Dict] = None,
) -> torch.Tensor:
    """main function for generation

    Args:
        args: command line arguments
        shared_models: dictionary containing pre-loaded models (mainly for DiT)
        precomputed_image_data: Optional dictionary with precomputed image data
        precomputed_text_data: Optional dictionary with precomputed text data

    Returns:
        tuple: (HunyuanVAE2D model (vae) or None, torch.Tensor generated latent)
    """
    device, dit_weight_dtype = (gen_settings.device, gen_settings.dit_weight_dtype)

    # prepare seed
    seed = args.seed if args.seed is not None else random.randint(0, 2**32 - 1)
    args.seed = seed  # set seed to args for saving

    if shared_models is None or "model" not in shared_models:
        # load DiT model
        anima = load_dit_model(args, device, dit_weight_dtype)

        if shared_models is not None:
            shared_models["model"] = anima
    else:
        # use shared model
        logger.info("Using shared DiT model.")
        anima: anima_models.Anima = shared_models["model"]

    if precomputed_text_data is not None:
        logger.info("Using precomputed text data.")
        context = precomputed_text_data["context"]
        context_null = precomputed_text_data["context_null"]

    else:
        logger.info("No precomputed data. Preparing image and text inputs.")
        context, context_null = prepare_text_inputs(args, device, anima, shared_models)

    return generate_body(args, anima, context, context_null, device, seed)


def generate_body(
    args: Union[argparse.Namespace, SimpleNamespace],
    anima: anima_models.Anima,
    context: Dict[str, Any],
    context_null: Optional[Dict[str, Any]],
    device: torch.device,
    seed: int,
) -> torch.Tensor:

    # set random generator
    seed_g = torch.Generator(device="cpu")
    seed_g.manual_seed(seed)

    height, width = check_inputs(args)
    logger.info(f"Image size: {height}x{width} (HxW), infer_steps: {args.infer_steps}")

    # image generation ######

    logger.info(f"Prompt: {context['prompt']}")

    embed = context["embed"][0].to(device, dtype=torch.bfloat16)
    if context_null is None:
        context_null = context  # dummy for unconditional
    negative_embed = context_null["embed"][0].to(device, dtype=torch.bfloat16)

    # Prepare latent variables
    num_channels_latents = anima_models.Anima.LATENT_CHANNELS
    shape = (
        1,
        num_channels_latents,
        1,  # Frame dimension
        height // 8,  # qwen_image_autoencoder_kl.SCALE_FACTOR,
        width // 8,  # qwen_image_autoencoder_kl.SCALE_FACTOR,
    )
    latents = randn_tensor(shape, generator=seed_g, device=device, dtype=torch.bfloat16)

    # Create padding mask
    bs = latents.shape[0]
    h_latent = latents.shape[-2]
    w_latent = latents.shape[-1]
    padding_mask = torch.zeros(bs, 1, h_latent, w_latent, dtype=torch.bfloat16, device=device)

    logger.info(f"Embed: {embed.shape}, negative_embed: {negative_embed.shape}, latents: {latents.shape}")
    embed = embed.to(torch.bfloat16)
    negative_embed = negative_embed.to(torch.bfloat16)

    # Prepare timesteps
    timesteps, sigmas = hunyuan_image_utils.get_timesteps_sigmas(args.infer_steps, args.flow_shift, device)
    timesteps /= 1000  # scale to [0,1] range
    timesteps = timesteps.to(device, dtype=torch.bfloat16)

    # Denoising loop
    do_cfg = args.guidance_scale != 1.0
    autocast_enabled = args.fp8

    with tqdm(total=len(timesteps), desc="Denoising steps") as pbar:
        for i, t in enumerate(timesteps):
            t_expand = t.expand(latents.shape[0])

            with torch.no_grad(), torch.autocast(device_type=device.type, dtype=torch.bfloat16, enabled=autocast_enabled):
                noise_pred = anima(latents, t_expand, embed, padding_mask=padding_mask)

            if do_cfg:
                with torch.no_grad(), torch.autocast(device_type=device.type, dtype=torch.bfloat16, enabled=autocast_enabled):
                    uncond_noise_pred = anima(latents, t_expand, negative_embed, padding_mask=padding_mask)
                noise_pred = uncond_noise_pred + args.guidance_scale * (noise_pred - uncond_noise_pred)

            # ensure latents dtype is consistent
            latents = hunyuan_image_utils.step(latents, noise_pred, sigmas, i).to(latents.dtype)

            pbar.update()

    return latents


def get_time_flag():
    return datetime.datetime.fromtimestamp(time.time()).strftime("%Y%m%d-%H%M%S-%f")[:-3]


def save_latent(latent: torch.Tensor, args: argparse.Namespace, height: int, width: int) -> str:
    """Save latent to file

    Args:
        latent: Latent tensor
        args: command line arguments
        height: height of frame
        width: width of frame

    Returns:
        str: Path to saved latent file
    """
    save_path = args.save_path
    os.makedirs(save_path, exist_ok=True)
    time_flag = get_time_flag()

    seed = args.seed

    latent_path = f"{save_path}/{time_flag}_{seed}_latent.safetensors"

    if args.no_metadata:
        metadata = None
    else:
        metadata = {
            "seeds": f"{seed}",
            "prompt": f"{args.prompt}",
            "height": f"{height}",
            "width": f"{width}",
            "infer_steps": f"{args.infer_steps}",
            # "embedded_cfg_scale": f"{args.embedded_cfg_scale}",
            "guidance_scale": f"{args.guidance_scale}",
        }
        if args.negative_prompt is not None:
            metadata["negative_prompt"] = f"{args.negative_prompt}"

    sd = {"latent": latent.contiguous()}
    save_file(sd, latent_path, metadata=metadata)
    logger.info(f"Latent saved to: {latent_path}")

    return latent_path


def save_images(sample: torch.Tensor, args: argparse.Namespace, original_base_name: Optional[str] = None) -> str:
    """Save images to directory

    Args:
        sample: Video tensor
        args: command line arguments
        original_base_name: Original base name (if latents are loaded from files)

    Returns:
        str: Path to saved images directory
    """
    save_path = args.save_path
    os.makedirs(save_path, exist_ok=True)
    time_flag = get_time_flag()

    seed = args.seed
    original_name = "" if original_base_name is None else f"_{original_base_name}"
    image_name = f"{time_flag}_{seed}{original_name}"

    x = torch.clamp(sample, -1.0, 1.0)
    x = ((x + 1.0) * 127.5).to(torch.uint8).cpu().numpy()
    x = x.transpose(1, 2, 0)  # C, H, W -> H, W, C

    image = Image.fromarray(x)
    image.save(os.path.join(save_path, f"{image_name}.png"))

    logger.info(f"Sample images saved to: {save_path}/{image_name}")

    return f"{save_path}/{image_name}"


def save_output(
    args: argparse.Namespace,
    vae: qwen_image_autoencoder_kl.AutoencoderKLQwenImage,
    latent: torch.Tensor,
    device: torch.device,
    original_base_name: Optional[str] = None,
) -> None:
    """save output

    Args:
        args: command line arguments
        vae: VAE model
        latent: latent tensor
        device: device to use
        original_base_name: original base name (if latents are loaded from files)
    """
    height, width = latent.shape[-2], latent.shape[-1]  # BCTHW
    height *= 8  # qwen_image_autoencoder_kl.SCALE_FACTOR
    width *= 8  # qwen_image_autoencoder_kl.SCALE_FACTOR
    # print(f"Saving output. Latent shape {latent.shape}; pixel shape {height}x{width}")
    if args.output_type == "latent" or args.output_type == "latent_images":
        # save latent
        save_latent(latent, args, height, width)
    if args.output_type == "latent":
        return

    if vae is None:
        logger.error("VAE is None, cannot decode latents for saving video/images.")
        return

    if latent.ndim == 2:  # S,C. For packed latents from other inference scripts
        latent = latent.unsqueeze(0)
        height, width = check_inputs(args)  # Get height/width from args
        latent = latent.view(
            1,
            vae.latent_channels,
            1,  # Frame dimension
            height // 8,  # qwen_image_autoencoder_kl.SCALE_FACTOR,
            width // 8,  # qwen_image_autoencoder_kl.SCALE_FACTOR,
        )

    image = decode_latent(vae, latent, device)

    if args.output_type == "images" or args.output_type == "latent_images":
        # save images
        if original_base_name is None:
            original_name = ""
        else:
            original_name = f"_{original_base_name}"
        save_images(image, args, original_name)


def preprocess_prompts_for_batch(prompt_lines: List[str], base_args: argparse.Namespace) -> List[Dict]:
    """Process multiple prompts for batch mode

    Args:
        prompt_lines: List of prompt lines
        base_args: Base command line arguments

    Returns:
        List[Dict]: List of prompt data dictionaries
    """
    prompts_data = []

    for line in prompt_lines:
        line = line.strip()
        if not line or line.startswith("#"):  # Skip empty lines and comments
            continue

        # Parse prompt line and create override dictionary
        prompt_data = parse_prompt_line(line)
        logger.info(f"Parsed prompt data: {prompt_data}")
        prompts_data.append(prompt_data)

    return prompts_data


def load_shared_models(args: argparse.Namespace) -> Dict:
    """Load shared models for batch processing or interactive mode.
    Models are loaded to CPU to save memory. VAE is NOT loaded here.
    DiT model is also NOT loaded here, handled by process_batch_prompts or generate.

    Args:
        args: Base command line arguments

    Returns:
        Dict: Dictionary of shared models (text/image encoders)
    """
    shared_models = {}
    # Load text encoders to CPU
    text_encoder_dtype = torch.bfloat16  # Default dtype for Text Encoder
    text_encoder = load_text_encoder(args, dtype=text_encoder_dtype, device=torch.device("cpu"))
    shared_models["text_encoder"] = text_encoder
    return shared_models


def process_batch_prompts(prompts_data: List[Dict], args: argparse.Namespace) -> None:
    """Process multiple prompts with model reuse and batched precomputation

    Args:
        prompts_data: List of prompt data dictionaries
        args: Base command line arguments
    """
    if not prompts_data:
        logger.warning("No valid prompts found")
        return

    gen_settings = get_generation_settings(args)
    dit_weight_dtype = gen_settings.dit_weight_dtype
    device = gen_settings.device

    # 1. Prepare VAE
    logger.info("Loading VAE for batch generation...")
    vae_for_batch = qwen_image_autoencoder_kl.load_vae(
        args.vae, device="cpu", disable_mmap=True, spatial_chunk_size=args.vae_chunk_size, disable_cache=args.vae_disable_cache
    )
    vae_for_batch.to(torch.bfloat16)
    vae_for_batch.eval()

    all_prompt_args_list = [apply_overrides(args, pd) for pd in prompts_data]  # Create all arg instances first
    for prompt_args in all_prompt_args_list:
        check_inputs(prompt_args)  # Validate each prompt's height/width

    # 2. Load DiT Model once
    logger.info("Loading DiT model for batch generation...")
    # Use args from the first prompt for DiT loading (LoRA etc. should be consistent for a batch)
    first_prompt_args = all_prompt_args_list[0]
    anima = load_dit_model(first_prompt_args, device, dit_weight_dtype)  # Load directly to target device if possible

    shared_models_for_generate = {"model": anima}  # Pass DiT via shared_models

    # 3. Precompute Text Data (Text Encoder)
    logger.info("Loading Text Encoder for batch text preprocessing...")

    # Text Encoder loaded to CPU by load_text_encoder
    text_encoder_dtype = torch.bfloat16  # Default dtype for Text Encoder
    text_encoder_batch = load_text_encoder(args, dtype=text_encoder_dtype, device=torch.device("cpu"))

    # Text Encoder to device for this phase
    text_encoder_device = torch.device("cpu") if args.text_encoder_cpu else device
    text_encoder_batch.to(text_encoder_device)  # Moved into prepare_text_inputs logic

    all_precomputed_text_data = []
    conds_cache_batch = {}

    logger.info("Preprocessing text and LLM/TextEncoder encoding for all prompts...")
    temp_shared_models_txt = {
        "text_encoder": text_encoder_batch,  # on GPU if not text_encoder_cpu
        "conds_cache": conds_cache_batch,
    }

    for i, prompt_args_item in enumerate(all_prompt_args_list):
        logger.info(f"Text preprocessing for prompt {i+1}/{len(all_prompt_args_list)}: {prompt_args_item.prompt}")

        # prepare_text_inputs will move text_encoders to device temporarily
        context, context_null = prepare_text_inputs(prompt_args_item, device, anima, temp_shared_models_txt)
        text_data = {"context": context, "context_null": context_null}
        all_precomputed_text_data.append(text_data)

    # Models should be removed from device after prepare_text_inputs
    del text_encoder_batch, temp_shared_models_txt, conds_cache_batch
    gc.collect()  # Force cleanup of Text Encoder from GPU memory
    clean_memory_on_device(device)

    all_latents = []

    logger.info("Generating latents for all prompts...")
    with torch.no_grad():
        for i, prompt_args_item in enumerate(all_prompt_args_list):
            current_text_data = all_precomputed_text_data[i]
            height, width = check_inputs(prompt_args_item)  # Get height/width for each prompt

            logger.info(f"Generating latent for prompt {i+1}/{len(all_prompt_args_list)}: {prompt_args_item.prompt}")
            try:
                # generate is called with precomputed data, so it won't load Text Encoders.
                # It will use the DiT model from shared_models_for_generate.
                latent = generate(prompt_args_item, gen_settings, shared_models_for_generate, current_text_data)

                if latent is None:  # and prompt_args_item.save_merged_model:  # Should be caught earlier
                    continue

                # Save latent if needed (using data from precomputed_image_data for H/W)
                if prompt_args_item.output_type in ["latent", "latent_images"]:
                    save_latent(latent, prompt_args_item, height, width)

                all_latents.append(latent)
            except Exception as e:
                logger.error(f"Error generating latent for prompt: {prompt_args_item.prompt}. Error: {e}", exc_info=True)
                all_latents.append(None)  # Add placeholder for failed generations
                continue

    # Free DiT model
    logger.info("Releasing DiT model from memory...")

    del shared_models_for_generate["model"]
    del anima
    clean_memory_on_device(device)
    synchronize_device(device)  # Ensure memory is freed before loading VAE for decoding

    # 4. Decode latents and save outputs (using vae_for_batch)
    if args.output_type != "latent":
        logger.info("Decoding latents to videos/images using batched VAE...")
        vae_for_batch.to(device)  # Move VAE to device for decoding

        for i, latent in enumerate(all_latents):
            if latent is None:  # Skip failed generations
                logger.warning(f"Skipping decoding for prompt {i+1} due to previous error.")
                continue

            current_args = all_prompt_args_list[i]
            logger.info(f"Decoding output {i+1}/{len(all_latents)} for prompt: {current_args.prompt}")

            # if args.output_type is "latent_images", we already saved latent above.
            # so we skip saving latent here.
            if current_args.output_type == "latent_images":
                current_args.output_type = "images"

            # save_output expects latent to be [BCTHW] or [CTHW]. generate returns [BCTHW] (batch size 1).
            save_output(current_args, vae_for_batch, latent, device)  # Pass vae_for_batch

        vae_for_batch.to("cpu")  # Move VAE back to CPU

    del vae_for_batch
    clean_memory_on_device(device)


def process_interactive(args: argparse.Namespace) -> None:
    """Process prompts in interactive mode

    Args:
        args: Base command line arguments
    """
    gen_settings = get_generation_settings(args)
    device = gen_settings.device
    shared_models = load_shared_models(args)
    shared_models["conds_cache"] = {}  # Initialize empty cache for interactive mode

    vae = qwen_image_autoencoder_kl.load_vae(
        args.vae, device="cpu", disable_mmap=True, spatial_chunk_size=args.vae_chunk_size, disable_cache=args.vae_disable_cache
    )
    vae.to(torch.bfloat16)
    vae.eval()

    print("Interactive mode. Enter prompts (Ctrl+D or Ctrl+Z (Windows) to exit):")

    try:
        import prompt_toolkit
    except ImportError:
        logger.warning("prompt_toolkit not found. Using basic input instead.")
        prompt_toolkit = None

    if prompt_toolkit:
        session = prompt_toolkit.PromptSession()

        def input_line(prompt: str) -> str:
            return session.prompt(prompt)

    else:

        def input_line(prompt: str) -> str:
            return input(prompt)

    try:
        while True:
            try:
                line = input_line("> ")
                if not line.strip():
                    continue
                if len(line.strip()) == 1 and line.strip() in ["\x04", "\x1a"]:  # Ctrl+D or Ctrl+Z with prompt_toolkit
                    raise EOFError  # Exit on Ctrl+D or Ctrl+Z

                # Parse prompt
                prompt_data = parse_prompt_line(line)
                prompt_args = apply_overrides(args, prompt_data)

                # Generate latent
                # For interactive, precomputed data is None. shared_models contains text encoders.
                latent = generate(prompt_args, gen_settings, shared_models)

                # # If not one_frame_inference, move DiT model to CPU after generation
                # model = shared_models.get("model")
                # model.to("cpu")  # Move DiT model to CPU after generation

                # Save latent and video
                # returned_vae from generate will be used for decoding here.
                save_output(prompt_args, vae, latent, device)

            except KeyboardInterrupt:
                print("\nInterrupted. Continue (Ctrl+D or Ctrl+Z (Windows) to exit)")
                continue

    except EOFError:
        print("\nExiting interactive mode")


def get_generation_settings(args: argparse.Namespace) -> GenerationSettings:
    device = torch.device(args.device)

    dit_weight_dtype = torch.bfloat16  # default
    if args.fp8_scaled:
        dit_weight_dtype = None  # various precision weights, so don't cast to specific dtype
    elif args.fp8:
        dit_weight_dtype = torch.float8_e4m3fn

    logger.info(f"Using device: {device}, DiT weight weight precision: {dit_weight_dtype}")

    gen_settings = GenerationSettings(device=device, dit_weight_dtype=dit_weight_dtype)
    return gen_settings


def main():
    # Parse arguments
    args = parse_args()

    # Check if latents are provided
    latents_mode = args.latent_path is not None and len(args.latent_path) > 0

    # Set device
    device = args.device if args.device is not None else "cuda" if torch.cuda.is_available() else "cpu"
    device = torch.device(device)
    logger.info(f"Using device: {device}")
    args.device = device

    if latents_mode:
        # Original latent decode mode
        original_base_names = []
        latents_list = []
        seeds = []

        # assert len(args.latent_path) == 1, "Only one latent path is supported for now"

        for latent_path in args.latent_path:
            original_base_names.append(os.path.splitext(os.path.basename(latent_path))[0])
            seed = 0

            if os.path.splitext(latent_path)[1] != ".safetensors":
                latents = torch.load(latent_path, map_location="cpu")
            else:
                latents = load_file(latent_path)["latent"]
                with safe_open(latent_path, framework="pt") as f:
                    metadata = f.metadata()
                if metadata is None:
                    metadata = {}
                logger.info(f"Loaded metadata: {metadata}")

                if "seeds" in metadata:
                    seed = int(metadata["seeds"])
                if "height" in metadata and "width" in metadata:
                    height = int(metadata["height"])
                    width = int(metadata["width"])
                    args.image_size = [height, width]

            seeds.append(seed)
            logger.info(f"Loaded latent from {latent_path}. Shape: {latents.shape}")

            if latents.ndim == 5:  # [BCTHW]
                latents = latents.squeeze(0)  # [CTHW]

            latents_list.append(latents)

        vae = qwen_image_autoencoder_kl.load_vae(
            args.vae,
            device=device,
            disable_mmap=True,
            spatial_chunk_size=args.vae_chunk_size,
            disable_cache=args.vae_disable_cache,
        )
        vae.to(torch.bfloat16)
        vae.eval()

        for i, latent in enumerate(latents_list):
            args.seed = seeds[i]
            save_output(args, vae, latent, device, original_base_names[i])

    else:
        tokenize_strategy = strategy_anima.AnimaTokenizeStrategy(
            qwen3_path=args.text_encoder, t5_tokenizer_path=None, qwen3_max_length=512, t5_max_length=512
        )
        strategy_base.TokenizeStrategy.set_strategy(tokenize_strategy)

        encoding_strategy = strategy_anima.AnimaTextEncodingStrategy()
        strategy_base.TextEncodingStrategy.set_strategy(encoding_strategy)

        if args.from_file:
            # Batch mode from file

            # Read prompts from file
            with open(args.from_file, "r", encoding="utf-8") as f:
                prompt_lines = f.readlines()

            # Process prompts
            prompts_data = preprocess_prompts_for_batch(prompt_lines, args)
            process_batch_prompts(prompts_data, args)

        elif args.interactive:
            # Interactive mode
            process_interactive(args)

        else:
            # Single prompt mode (original behavior)

            # Generate latent
            gen_settings = get_generation_settings(args)

            # For single mode, precomputed data is None, shared_models is None.
            # generate will load all necessary models (Text Encoders, DiT).
            latent = generate(args, gen_settings)

            clean_memory_on_device(device)

            # Save latent and video
            vae = qwen_image_autoencoder_kl.load_vae(
                args.vae,
                device="cpu",
                disable_mmap=True,
                spatial_chunk_size=args.vae_chunk_size,
                disable_cache=args.vae_disable_cache,
            )
            vae.to(torch.bfloat16)
            vae.eval()
            save_output(args, vae, latent, device)

    logger.info("Done!")


if __name__ == "__main__":
    main()


================================================
FILE: anima_train.py
================================================
# Anima full finetune training script

import argparse
from concurrent.futures import ThreadPoolExecutor
import copy
import gc
import math
import os
from multiprocessing import Value
from typing import List
import toml

from tqdm import tqdm

import torch
from library import flux_train_utils, qwen_image_autoencoder_kl
from library.device_utils import init_ipex, clean_memory_on_device
from library.sd3_train_utils import FlowMatchEulerDiscreteScheduler

init_ipex()

from accelerate.utils import set_seed
from library import deepspeed_utils, anima_models, anima_train_utils, anima_utils, strategy_base, strategy_anima, sai_model_spec

import library.train_util as train_util

from library.utils import setup_logging, add_logging_arguments

setup_logging()
import logging

logger = logging.getLogger(__name__)

import library.config_util as config_util

from library.config_util import (
    ConfigSanitizer,
    BlueprintGenerator,
)
from library.custom_train_functions import apply_masked_loss, add_custom_train_arguments


def train(args):
    train_util.verify_training_args(args)
    train_util.prepare_dataset_args(args, True)
    deepspeed_utils.prepare_deepspeed_args(args)
    setup_logging(args, reset=True)

    # backward compatibility
    if not args.skip_cache_check:
        args.skip_cache_check = args.skip_latents_validity_check

    if args.cache_text_encoder_outputs_to_disk and not args.cache_text_encoder_outputs:
        logger.warning("cache_text_encoder_outputs_to_disk is enabled, so cache_text_encoder_outputs is also enabled")
        args.cache_text_encoder_outputs = True

    if args.cpu_offload_checkpointing and not args.gradient_checkpointing:
        logger.warning("cpu_offload_checkpointing is enabled, so gradient_checkpointing is also enabled")
        args.gradient_checkpointing = True

    if args.unsloth_offload_checkpointing:
        if not args.gradient_checkpointing:
            logger.warning("unsloth_offload_checkpointing is enabled, so gradient_checkpointing is also enabled")
            args.gradient_checkpointing = True
        assert not args.cpu_offload_checkpointing, "Cannot use both --unsloth_offload_checkpointing and --cpu_offload_checkpointing"

    assert (
        args.blocks_to_swap is None or args.blocks_to_swap == 0
    ) or not args.cpu_offload_checkpointing, "blocks_to_swap is not supported with cpu_offload_checkpointing"

    assert (
        args.blocks_to_swap is None or args.blocks_to_swap == 0
    ) or not args.unsloth_offload_checkpointing, "blocks_to_swap is not supported with unsloth_offload_checkpointing"

    cache_latents = args.cache_latents
    use_dreambooth_method = args.in_json is None

    if args.seed is not None:
        set_seed(args.seed)

    # prepare caching strategy: must be set before preparing dataset
    if args.cache_latents:
        latents_caching_strategy = strategy_anima.AnimaLatentsCachingStrategy(
            args.cache_latents_to_disk, args.vae_batch_size, args.skip_cache_check
        )
        strategy_base.LatentsCachingStrategy.set_strategy(latents_caching_strategy)

    # prepare dataset
    if args.dataset_class is None:
        blueprint_generator = BlueprintGenerator(ConfigSanitizer(True, True, args.masked_loss, True))
        if args.dataset_config is not None:
            logger.info(f"Load dataset config from {args.dataset_config}")
            user_config = config_util.load_user_config(args.dataset_config)
            ignored = ["train_data_dir", "in_json"]
            if any(getattr(args, attr) is not None for attr in ignored):
                logger.warning("ignore following options because config file is found: {0}".format(", ".join(ignored)))
        else:
            if use_dreambooth_method:
                logger.info("Using DreamBooth method.")
                user_config = {
                    "datasets": [
                        {
                            "subsets": config_util.generate_dreambooth_subsets_config_by_subdirs(
                                args.train_data_dir, args.reg_data_dir
                            )
                        }
                    ]
                }
            else:
                logger.info("Training with captions.")
                user_config = {
                    "datasets": [
                        {
                            "subsets": [
                                {
                                    "image_dir": args.train_data_dir,
                                    "metadata_file": args.in_json,
                                }
                            ]
                        }
                    ]
                }

        blueprint = blueprint_generator.generate(user_config, args)
        train_dataset_group, val_dataset_group = config_util.generate_dataset_group_by_blueprint(blueprint.dataset_group)
    else:
        train_dataset_group = train_util.load_arbitrary_dataset(args)
        val_dataset_group = None

    current_epoch = Value("i", 0)
    current_step = Value("i", 0)
    ds_for_collator = train_dataset_group if args.max_data_loader_n_workers == 0 else None
    collator = train_util.collator_class(current_epoch, current_step, ds_for_collator)

    train_dataset_group.verify_bucket_reso_steps(16)  # Qwen-Image VAE spatial downscale = 8 * patch size = 2

    if args.debug_dataset:
        if args.cache_text_encoder_outputs:
            strategy_base.TextEncoderOutputsCachingStrategy.set_strategy(
                strategy_anima.AnimaTextEncoderOutputsCachingStrategy(
                    args.cache_text_encoder_outputs_to_disk, args.text_encoder_batch_size, False, False
                )
            )
        train_dataset_group.set_current_strategies()
        train_util.debug_dataset(train_dataset_group, True)
        return
    if len(train_dataset_group) == 0:
        logger.error("No data found. Please verify the metadata file and train_data_dir option.")
        return

    if cache_latents:
        assert train_dataset_group.is_latent_cacheable(), "when caching latents, either color_aug or random_crop cannot be used"

    if args.cache_text_encoder_outputs:
        assert train_dataset_group.is_text_encoder_output_cacheable(
            cache_supports_dropout=True
        ), "when caching text encoder output, shuffle_caption, token_warmup_step or caption_tag_dropout_rate cannot be used"

    # prepare accelerator
    logger.info("prepare accelerator")
    accelerator = train_util.prepare_accelerator(args)

    # mixed precision dtype
    weight_dtype, save_dtype = train_util.prepare_dtype(args)

    # Load tokenizers and set strategies
    logger.info("Loading tokenizers...")
    qwen3_text_encoder, qwen3_tokenizer = anima_utils.load_qwen3_text_encoder(args.qwen3, dtype=weight_dtype, device="cpu")
    t5_tokenizer = anima_utils.load_t5_tokenizer(args.t5_tokenizer_path)

    # Set tokenize strategy
    tokenize_strategy = strategy_anima.AnimaTokenizeStrategy(
        qwen3_tokenizer=qwen3_tokenizer,
        t5_tokenizer=t5_tokenizer,
        qwen3_max_length=args.qwen3_max_token_length,
        t5_max_length=args.t5_max_token_length,
    )
    strategy_base.TokenizeStrategy.set_strategy(tokenize_strategy)

    text_encoding_strategy = strategy_anima.AnimaTextEncodingStrategy()
    strategy_base.TextEncodingStrategy.set_strategy(text_encoding_strategy)

    # Prepare text encoder (always frozen for Anima)
    qwen3_text_encoder.to(weight_dtype)
    qwen3_text_encoder.requires_grad_(False)

    # Cache text encoder outputs
    sample_prompts_te_outputs = None
    if args.cache_text_encoder_outputs:
        qwen3_text_encoder.to(accelerator.device)
        qwen3_text_encoder.eval()

        text_encoder_caching_strategy = strategy_anima.AnimaTextEncoderOutputsCachingStrategy(
            args.cache_text_encoder_outputs_to_disk, args.text_encoder_batch_size, args.skip_cache_check, is_partial=False
        )
        strategy_base.TextEncoderOutputsCachingStrategy.set_strategy(text_encoder_caching_strategy)

        with accelerator.autocast():
            train_dataset_group.new_cache_text_encoder_outputs([qwen3_text_encoder], accelerator)

        # cache sample prompt embeddings
        if args.sample_prompts is not None:
            logger.info(f"Cache Text Encoder outputs for sample prompts: {args.sample_prompts}")
            prompts = train_util.load_prompts(args.sample_prompts)
            sample_prompts_te_outputs = {}
            with accelerator.autocast(), torch.no_grad():
                for prompt_dict in prompts:
                    for p in [prompt_dict.get("prompt", ""), prompt_dict.get("negative_prompt", "")]:
                        if p not in sample_prompts_te_outputs:
                            logger.info(f"  cache TE outputs for: {p}")
                            tokens_and_masks = tokenize_strategy.tokenize(p)
                            sample_prompts_te_outputs[p] = text_encoding_strategy.encode_tokens(
                                tokenize_strategy, [qwen3_text_encoder], tokens_and_masks
                            )

        accelerator.wait_for_everyone()

        # free text encoder memory
        qwen3_text_encoder = None
        gc.collect()  # Force garbage collection to free memory
        clean_memory_on_device(accelerator.device)

    # Load VAE and cache latents
    logger.info("Loading Anima VAE...")
    vae = qwen_image_autoencoder_kl.load_vae(
        args.vae, device="cpu", disable_mmap=True, spatial_chunk_size=args.vae_chunk_size, disable_cache=args.vae_disable_cache
    )

    if cache_latents:
        vae.to(accelerator.device, dtype=weight_dtype)
        vae.requires_grad_(False)
        vae.eval()

        train_dataset_group.new_cache_latents(vae, accelerator)

        vae.to("cpu")
        clean_memory_on_device(accelerator.device)
        accelerator.wait_for_everyone()

    # Load DiT (MiniTrainDIT + optional LLM Adapter)
    logger.info("Loading Anima DiT...")
    dit = anima_utils.load_anima_model(
        "cpu", args.pretrained_model_name_or_path, args.attn_mode, args.split_attn, "cpu", dit_weight_dtype=None
    )

    if args.gradient_checkpointing:
        dit.enable_gradient_checkpointing(
            cpu_offload=args.cpu_offload_checkpointing,
            unsloth_offload=args.unsloth_offload_checkpointing,
        )

    train_dit = args.learning_rate != 0
    dit.requires_grad_(train_dit)
    if not train_dit:
        dit.to(accelerator.device, dtype=weight_dtype)

    # Block swap
    is_swapping_blocks = args.blocks_to_swap is not None and args.blocks_to_swap > 0
    if is_swapping_blocks:
        logger.info(f"Enable block swap: blocks_to_swap={args.blocks_to_swap}")
        dit.enable_block_swap(args.blocks_to_swap, accelerator.device)

    if not cache_latents:
        vae.requires_grad_(False)
        vae.eval()
        vae.to(accelerator.device, dtype=weight_dtype)

    # Setup optimizer with parameter groups
    if train_dit:
        param_groups = anima_train_utils.get_anima_param_groups(
            dit,
            base_lr=args.learning_rate,
            self_attn_lr=args.self_attn_lr,
            cross_attn_lr=args.cross_attn_lr,
            mlp_lr=args.mlp_lr,
            mod_lr=args.mod_lr,
            llm_adapter_lr=args.llm_adapter_lr,
        )
    else:
        param_groups = []

    training_models = []
    if train_dit:
        training_models.append(dit)

    # calculate trainable parameters
    n_params = 0
    for group in param_groups:
        for p in group["params"]:
            n_params += p.numel()

    accelerator.print(f"train dit: {train_dit}")
    accelerator.print(f"number of training models: {len(training_models)}")
    accelerator.print(f"number of trainable parameters: {n_params:,}")

    # prepare optimizer
    accelerator.print("prepare optimizer, data loader etc.")

    if args.fused_backward_pass:
        # Pass per-component param_groups directly to preserve per-component LRs
        _, _, optimizer = train_util.get_optimizer(args, trainable_params=param_groups)
        optimizer_train_fn, optimizer_eval_fn = train_util.get_optimizer_train_eval_fn(optimizer, args)
    else:
        _, _, optimizer = train_util.get_optimizer(args, trainable_params=param_groups)
        optimizer_train_fn, optimizer_eval_fn = train_util.get_optimizer_train_eval_fn(optimizer, args)

    # prepare dataloader
    train_dataset_group.set_current_strategies()

    n_workers = min(args.max_data_loader_n_workers, os.cpu_count())
    train_dataloader = torch.utils.data.DataLoader(
        train_dataset_group,
        batch_size=1,
        shuffle=True,
        collate_fn=collator,
        num_workers=n_workers,
        persistent_workers=args.persistent_data_loader_workers,
    )

    # calculate training steps
    if args.max_train_epochs is not None:
        args.max_train_steps = args.max_train_epochs * math.ceil(
            len(train_dataloader) / accelerator.num_processes / args.gradient_accumulation_steps
        )
        accelerator.print(f"override steps. steps for {args.max_train_epochs} epochs: {args.max_train_steps}")

    train_dataset_group.set_max_train_steps(args.max_train_steps)

    # lr scheduler
    lr_scheduler = train_util.get_scheduler_fix(args, optimizer, accelerator.num_processes)

    # full fp16/bf16 training
    dit_weight_dtype = weight_dtype
    if args.full_fp16:
        assert args.mixed_precision == "fp16", "full_fp16 requires mixed_precision='fp16'"
        accelerator.print("enable full fp16 training.")
    elif args.full_bf16:
        assert args.mixed_precision == "bf16", "full_bf16 requires mixed_precision='bf16'"
        accelerator.print("enable full bf16 training.")
    else:
        dit_weight_dtype = torch.float32  # If neither full_fp16 nor full_bf16, the model weights should be in float32
    dit.to(dit_weight_dtype)  # convert dit to target weight dtype

    # move text encoder to GPU if not cached
    if not args.cache_text_encoder_outputs and qwen3_text_encoder is not None:
        qwen3_text_encoder.to(accelerator.device)

    clean_memory_on_device(accelerator.device)

    # Prepare with accelerator
    # Temporarily move non-training models off GPU to reduce memory during DDP init
    # if not args.cache_text_encoder_outputs and qwen3_text_encoder is not None:
    #     qwen3_text_encoder.to("cpu")
    # if not cache_latents and vae is not None:
    #     vae.to("cpu")
    # clean_memory_on_device(accelerator.device)

    if args.deepspeed:
        ds_model = deepspeed_utils.prepare_deepspeed_model(args, mmdit=dit)
        ds_model, optimizer, train_dataloader, lr_scheduler = accelerator.prepare(
            ds_model, optimizer, train_dataloader, lr_scheduler
        )
        training_models = [ds_model]
    else:
        if train_dit:
            dit = accelerator.prepare(dit, device_placement=[not is_swapping_blocks])
            if is_swapping_blocks:
                accelerator.unwrap_model(dit).move_to_device_except_swap_blocks(accelerator.device)
        optimizer, train_dataloader, lr_scheduler = accelerator.prepare(optimizer, train_dataloader, lr_scheduler)

    # Move non-training models back to GPU
    if not args.cache_text_encoder_outputs and qwen3_text_encoder is not None:
        qwen3_text_encoder.to(accelerator.device)
    if not cache_latents and vae is not None:
        vae.to(accelerator.device, dtype=weight_dtype)

    if args.full_fp16:
        train_util.patch_accelerator_for_fp16_training(accelerator)

    # resume
    train_util.resume_from_local_or_hf_if_specified(accelerator, args)

    if args.fused_backward_pass:
        # use fused optimizer for backward pass: other optimizers will be supported in the future
        import library.adafactor_fused

        library.adafactor_fused.patch_adafactor_fused(optimizer)

        for param_group in optimizer.param_groups:
            for parameter in param_group["params"]:
                if parameter.requires_grad:

                    def create_grad_hook(p_group):
                        def grad_hook(tensor: torch.Tensor):
                            if accelerator.sync_gradients and args.max_grad_norm != 0.0:
                                accelerator.clip_grad_norm_(tensor, args.max_grad_norm)
                            optimizer.step_param(tensor, p_group)
                            tensor.grad = None

                        return grad_hook

                    parameter.register_post_accumulate_grad_hook(create_grad_hook(param_group))

    # Training loop
    num_update_steps_per_epoch = math.ceil(len(train_dataloader) / args.gradient_accumulation_steps)
    num_train_epochs = math.ceil(args.max_train_steps / num_update_steps_per_epoch)
    if (args.save_n_epoch_ratio is not None) and (args.save_n_epoch_ratio > 0):
        args.save_every_n_epochs = math.floor(num_train_epochs / args.save_n_epoch_ratio) or 1

    accelerator.print("running training / 学習開始")
    accelerator.print(f"  num examples / サンプル数: {train_dataset_group.num_train_images}")
    accelerator.print(f"  num batches per epoch / 1epochのバッチ数: {len(train_dataloader)}")
    accelerator.print(f"  num epochs / epoch数: {num_train_epochs}")
    accelerator.print(
        f"  batch size per device / バッチサイズ: {', '.join([str(d.batch_size) for d in train_dataset_group.datasets])}"
    )
    accelerator.print(f"  gradient accumulation steps / 勾配を合計するステップ数 = {args.gradient_accumulation_steps}")
    accelerator.print(f"  total optimization steps / 学習ステップ数: {args.max_train_steps}")

    progress_bar = tqdm(range(args.max_train_steps), smoothing=0, disable=not accelerator.is_local_main_process, desc="steps")
    global_step = 0

    noise_scheduler = FlowMatchEulerDiscreteScheduler(num_train_timesteps=1000, shift=args.discrete_flow_shift)
    # Copy for noise and timestep generation, because noise_scheduler may be changed during training in future
    noise_scheduler_copy = copy.deepcopy(noise_scheduler)

    if accelerator.is_main_process:
        init_kwargs = {}
        if args.wandb_run_name:
            init_kwargs["wandb"] = {"name": args.wandb_run_name}
        if args.log_tracker_config is not None:
            init_kwargs = toml.load(args.log_tracker_config)
        accelerator.init_trackers(
            "finetuning" if args.log_tracker_name is None else args.log_tracker_name,
            config=train_util.get_sanitized_config_or_none(args),
            init_kwargs=init_kwargs,
        )

        if "wandb" in [tracker.name for tracker in accelerator.trackers]:
            import wandb

            wandb.define_metric("epoch")
            wandb.define_metric("loss/epoch", step_metric="epoch")

    if is_swapping_blocks:
        accelerator.unwrap_model(dit).prepare_block_swap_before_forward()

    # For --sample_at_first
    optimizer_eval_fn()
    anima_train_utils.sample_images(
        accelerator,
        args,
        0,
        global_step,
        dit,
        vae,
        qwen3_text_encoder,
        tokenize_strategy,
        text_encoding_strategy,
        sample_prompts_te_outputs,
    )
    optimizer_train_fn()
    if len(accelerator.trackers) > 0:
        accelerator.log({}, step=0)

    # Show model info
    unwrapped_dit = accelerator.unwrap_model(dit) if dit is not None else None
    if unwrapped_dit is not None:
        logger.info(f"dit device: {unwrapped_dit.device}, dtype: {unwrapped_dit.dtype}")
    if qwen3_text_encoder is not None:
        logger.info(f"qwen3 device: {qwen3_text_encoder.device}")
    if vae is not None:
        logger.info(f"vae device: {vae.device}")

    loss_recorder = train_util.LossRecorder()
    epoch = 0
    for epoch in range(num_train_epochs):
        accelerator.print(f"\nepoch {epoch+1}/{num_train_epochs}")
        current_epoch.value = epoch + 1

        for m in training_models:
            m.train()

        for step, batch in enumerate(train_dataloader):
            current_step.value = global_step

            with accelerator.accumulate(*training_models):
                # Get latents
                if "latents" in batch and batch["latents"] is not None:
                    latents = batch["latents"].to(accelerator.device, dtype=dit_weight_dtype)
                    if latents.ndim == 5:  # Fallback for 5D latents (old cache)
                        latents = latents.squeeze(2)  # (B, C, 1, H, W) -> (B, C, H, W)
                else:
                    with torch.no_grad():
                        # images are already [-1, 1] from IMAGE_TRANSFORMS, add temporal dim
                        images = batch["images"].to(accelerator.device, dtype=weight_dtype)
                        latents = vae.encode_pixels_to_latents(images).to(accelerator.device, dtype=dit_weight_dtype)

                    if torch.any(torch.isnan(latents)):
                        accelerator.print("NaN found in latents, replacing with zeros")
                        latents = torch.nan_to_num(latents, 0, out=latents)

                # Get text encoder outputs
                text_encoder_outputs_list = batch.get("text_encoder_outputs_list", None)
                if text_encoder_outputs_list is not None:
                    # Cached outputs
                    caption_dropout_rates = text_encoder_outputs_list[-1]
                    text_encoder_outputs_list = text_encoder_outputs_list[:-1]

                    # Apply caption dropout to cached outputs
                    text_encoder_outputs_list = text_encoding_strategy.drop_cached_text_encoder_outputs(
                        *text_encoder_outputs_list, caption_dropout_rates=caption_dropout_rates
                    )
                    prompt_embeds, attn_mask, t5_input_ids, t5_attn_mask = text_encoder_outputs_list
                else:
                    # Encode on-the-fly
                    input_ids_list = batch["input_ids_list"]
                    with torch.no_grad():
                        prompt_embeds, attn_mask, t5_input_ids, t5_attn_mask = text_encoding_strategy.encode_tokens(
                            tokenize_strategy, [qwen3_text_encoder], input_ids_list
                        )

                # Move to device
                prompt_embeds = prompt_embeds.to(accelerator.device, dtype=dit_weight_dtype)
                attn_mask = attn_mask.to(accelerator.device)
                t5_input_ids = t5_input_ids.to(accelerator.device, dtype=torch.long)
                t5_attn_mask = t5_attn_mask.to(accelerator.device)

                # Noise and timesteps
                noise = torch.randn_like(latents)

                # Get noisy model input and timesteps
                noisy_model_input, timesteps, sigmas = flux_train_utils.get_noisy_model_input_and_timesteps(
                    args, noise_scheduler_copy, latents, noise, accelerator.device, dit_weight_dtype
                )
                timesteps = timesteps / 1000.0  # scale to [0, 1] range. timesteps is float32

                # NaN checks
                if torch.any(torch.isnan(noisy_model_input)):
                    accelerator.print("NaN found in noisy_model_input, replacing with zeros")
                    noisy_model_input = torch.nan_to_num(noisy_model_input, 0, out=noisy_model_input)

                # Create padding mask
                # padding_mask: (B, 1, H_latent, W_latent)
                bs = latents.shape[0]
                h_latent = latents.shape[-2]
                w_latent = latents.shape[-1]
                padding_mask = torch.zeros(bs, 1, h_latent, w_latent, dtype=dit_weight_dtype, device=accelerator.device)

                # DiT forward (LLM adapter runs inside forward for DDP gradient sync)
                noisy_model_input = noisy_model_input.unsqueeze(2)  # 4D to 5D, (B, C, 1, H, W)
                with accelerator.autocast():
                    model_pred = dit(
                        noisy_model_input,
                        timesteps,
                        prompt_embeds,
                        padding_mask=padding_mask,
                        source_attention_mask=attn_mask,
                        t5_input_ids=t5_input_ids,
                        t5_attn_mask=t5_attn_mask,
                    )
                model_pred = model_pred.squeeze(2)  # 5D to 4D, (B, C, H, W)

                # Compute loss (rectified flow: target = noise - latents)
                target = noise - latents

                # Weighting
                weighting = anima_train_utils.compute_loss_weighting_for_anima(
                    weighting_scheme=args.weighting_scheme, sigmas=sigmas
                )

                # Loss
                huber_c = train_util.get_huber_threshold_if_needed(args, timesteps, None)
                loss = train_util.conditional_loss(model_pred.float(), target.float(), args.loss_type, "none", huber_c)
                if args.masked_loss or ("alpha_masks" in batch and batch["alpha_masks"] is not None):
                    loss = apply_masked_loss(loss, batch)
                loss = loss.mean([1, 2, 3])  # (B, C, H, W) -> (B,)

                if weighting is not None:
                    loss = loss * weighting

                loss_weights = batch["loss_weights"]
                loss = loss * loss_weights
                loss = loss.mean()

                accelerator.backward(loss)

                if not args.fused_backward_pass:
                    if accelerator.sync_gradients and args.max_grad_norm != 0.0:
                        params_to_clip = []
                        for m in training_models:
                            params_to_clip.extend(m.parameters())
                        accelerator.clip_grad_norm_(params_to_clip, args.max_grad_norm)

                    optimizer.step()
                    lr_scheduler.step()
                    optimizer.zero_grad(set_to_none=True)
                else:
                    # optimizer.step() and optimizer.zero_grad() are called in the optimizer hook
                    lr_scheduler.step()

            # Checks if the accelerator has performed an optimization step
            if accelerator.sync_gradients:
                progress_bar.update(1)
                global_step += 1

                optimizer_eval_fn()
                anima_train_utils.sample_images(
                    accelerator,
                    args,
                    None,
                    global_step,
                    dit,
                    vae,
                    qwen3_text_encoder,
                    tokenize_strategy,
                    text_encoding_strategy,
                    sample_prompts_te_outputs,
                )

                # Save at specific steps
                if args.save_every_n_steps is not None and global_step % args.save_every_n_steps == 0:
                    accelerator.wait_for_everyone()
                    if accelerator.is_main_process:
                        anima_train_utils.save_anima_model_on_epoch_end_or_stepwise(
                            args,
                            False,
                            accelerator,
                            save_dtype,
                            epoch,
                            num_train_epochs,
                            global_step,
                            accelerator.unwrap_model(dit) if train_dit else None,
                        )
                optimizer_train_fn()

            current_loss = loss.detach().item()
            if len(accelerator.trackers) > 0:
                logs = {"loss": current_loss}
                train_util.append_lr_to_logs_with_names(
                    logs,
                    lr_scheduler,
                    args.optimizer_type,
                    ["base", "self_attn", "cross_attn", "mlp", "mod", "llm_adapter"] if train_dit else [],
                )
                accelerator.log(logs, step=global_step)

            loss_recorder.add(epoch=epoch, step=step, loss=current_loss)
            avr_loss: float = loss_recorder.moving_average
            logs = {"avr_loss": avr_loss}
            progress_bar.set_postfix(**logs)

            if global_step >= args.max_train_steps:
                break

        if len(accelerator.trackers) > 0:
            logs = {"loss/epoch": loss_recorder.moving_average, "epoch": epoch + 1}
            accelerator.log(logs, step=global_step)

        accelerator.wait_for_everyone()

        optimizer_eval_fn()
        if args.save_every_n_epochs is not None:
            if accelerator.is_main_process:
                anima_train_utils.save_anima_model_on_epoch_end_or_stepwise(
                    args,
                    True,
                    accelerator,
                    save_dtype,
                    epoch,
                    num_train_epochs,
                    global_step,
                    accelerator.unwrap_model(dit) if train_dit else None,
                )

        anima_train_utils.sample_images(
            accelerator,
            args,
            epoch + 1,
            global_step,
            dit,
            vae,
            qwen3_text_encoder,
            tokenize_strategy,
            text_encoding_strategy,
            sample_prompts_te_outputs,
        )

    # End training
    is_main_process = accelerator.is_main_process
    dit = accelerator.unwrap_model(dit)

    accelerator.end_training()
    optimizer_eval_fn()

    if args.save_state or args.save_state_on_train_end:
        train_util.save_state_on_train_end(args, accelerator)

    del accelerator

    if is_main_process and train_dit:
        anima_train_utils.save_anima_model_on_train_end(
            args,
            save_dtype,
            epoch,
            global_step,
            dit,
        )
        logger.info("model saved.")


def setup_parser() -> argparse.ArgumentParser:
    parser = argparse.ArgumentParser()

    add_logging_arguments(parser)
    train_util.add_sd_models_arguments(parser)
    train_util.add_dataset_arguments(parser, True, True, True)
    train_util.add_training_arguments(parser, False)
    train_util.add_masked_loss_arguments(parser)
    deepspeed_utils.add_deepspeed_arguments(parser)
    train_util.add_sd_saving_arguments(parser)
    train_util.add_optimizer_arguments(parser)
    config_util.add_config_arguments(parser)
    add_custom_train_arguments(parser)
    train_util.add_dit_training_arguments(parser)
    anima_train_utils.add_anima_training_arguments(parser)
    sai_model_spec.add_model_spec_arguments(parser)

    parser.add_argument(
        "--cpu_offload_checkpointing",
        action="store_true",
        help="offload gradient checkpointing to CPU (reduces VRAM at cost of speed)",
    )
    parser.add_argument(
        "--unsloth_offload_checkpointing",
        action="store_true",
        help="offload activations to CPU RAM using async non-blocking transfers (faster than --cpu_offload_checkpointing). "
        "Cannot be used with --cpu_offload_checkpointing or --blocks_to_swap.",
    )
    parser.add_argument(
        "--skip_latents_validity_check",
        action="store_true",
        help="[Deprecated] use 'skip_cache_check' instead",
    )

    return parser


if __name__ == "__main__":
    parser = setup_parser()

    args = parser.parse_args()
    train_util.verify_command_line_training_args(args)
    args = train_util.read_config_from_file(args, parser)

    if args.attn_mode == "sdpa":
        args.attn_mode = "torch"  # backward compatibility

    train(args)


================================================
FILE: anima_train_network.py
================================================
# Anima LoRA training script

import argparse
from typing import Any, Optional, Union

import torch
import torch.nn as nn
from accelerate import Accelerator
from library.device_utils import init_ipex, clean_memory_on_device

init_ipex()

from library import (
    anima_models,
    anima_train_utils,
    anima_utils,
    flux_train_utils,
    qwen_image_autoencoder_kl,
    sd3_train_utils,
    strategy_anima,
    strategy_base,
    train_util,
)
import train_network
from library.utils import setup_logging

setup_logging()
import logging

logger = logging.getLogger(__name__)


class AnimaNetworkTrainer(train_network.NetworkTrainer):
    def __init__(self):
        super().__init__()
        self.sample_prompts_te_outputs = None

    def assert_extra_args(
        self,
        args,
        train_dataset_group: Union[train_util.DatasetGroup, train_util.MinimalDataset],
        val_dataset_group: Optional[train_util.DatasetGroup],
    ):
        if args.fp8_base or args.fp8_base_unet:
            logger.warning("fp8_base and fp8_base_unet are not supported. / fp8_baseとfp8_base_unetはサポートされていません。")
            args.fp8_base = False
            args.fp8_base_unet = False
        args.fp8_scaled = False  # Anima DiT does not support fp8_scaled

        if args.cache_text_encoder_outputs_to_disk and not args.cache_text_encoder_outputs:
            logger.warning("cache_text_encoder_outputs_to_disk is enabled, so cache_text_encoder_outputs is also enabled")
            args.cache_text_encoder_outputs = True

        if args.cache_text_encoder_outputs:
            assert train_dataset_group.is_text_encoder_output_cacheable(
                cache_supports_dropout=True
            ), "when caching Text Encoder output, shuffle_caption, token_warmup_step or caption_tag_dropout_rate cannot be used"

        assert (
            args.network_train_unet_only or not args.cache_text_encoder_outputs
        ), "network for Text Encoder cannot be trained with caching Text Encoder outputs / Text Encoderの出力をキャッシュしながらText Encoderのネットワークを学習することはできません"

        assert (
            args.blocks_to_swap is None or args.blocks_to_swap == 0
        ) or not args.cpu_offload_checkpointing, "blocks_to_swap is not supported with cpu_offload_checkpointing"

        if args.unsloth_offload_checkpointing:
            if not args.gradient_checkpointing:
                logger.warning("unsloth_offload_checkpointing is enabled, so gradient_checkpointing is also enabled")
                args.gradient_checkpointing = True
            assert (
                not args.cpu_offload_checkpointing
            ), "Cannot use both --unsloth_offload_checkpointing and --cpu_offload_checkpointing"
            assert (
                args.blocks_to_swap is None or args.blocks_to_swap == 0
            ), "blocks_to_swap is not supported with unsloth_offload_checkpointing"

        train_dataset_group.verify_bucket_reso_steps(16)  # WanVAE spatial downscale = 8 and patch size = 2
        if val_dataset_group is not None:
            val_dataset_group.verify_bucket_reso_steps(16)

    def load_target_model(self, args, weight_dtype, accelerator):
        self.is_swapping_blocks = args.blocks_to_swap is not None and args.blocks_to_swap > 0

        # Load Qwen3 text encoder (tokenizers already loaded in get_tokenize_strategy)
        logger.info("Loading Qwen3 text encoder...")
        qwen3_text_encoder, _ = anima_utils.load_qwen3_text_encoder(args.qwen3, dtype=weight_dtype, device="cpu")
        qwen3_text_encoder.eval()

        # Load VAE
        logger.info("Loading Anima VAE...")
        vae = qwen_image_autoencoder_kl.load_vae(
            args.vae, device="cpu", disable_mmap=True, spatial_chunk_size=args.vae_chunk_size, disable_cache=args.vae_disable_cache
        )
        vae.to(weight_dtype)
        vae.eval()

        # Return format: (model_type, text_encoders, vae, unet)
        return "anima", [qwen3_text_encoder], vae, None  # unet loaded lazily

    def load_unet_lazily(self, args, weight_dtype, accelerator, text_encoders) -> tuple[nn.Module, list[nn.Module]]:
        loading_dtype = None if args.fp8_scaled else weight_dtype
        loading_device = "cpu" if self.is_swapping_blocks else accelerator.device

        attn_mode = "torch"
        if args.xformers:
            attn_mode = "xformers"
        if args.attn_mode is not None:
            attn_mode = args.attn_mode

        # Load DiT
        logger.info(f"Loading Anima DiT model with attn_mode={attn_mode}, split_attn: {args.split_attn}...")
        model = anima_utils.load_anima_model(
            accelerator.device,
            args.pretrained_model_name_or_path,
            attn_mode,
            args.split_attn,
            loading_device,
            loading_dtype,
            args.fp8_scaled,
        )

        # Store unsloth preference so that when the base NetworkTrainer calls
        # dit.enable_gradient_checkpointing(cpu_offload=...), we can override to use unsloth.
        # The base trainer only passes cpu_offload, so we store the flag on the model.
        self._use_unsloth_offload_checkpointing = args.unsloth_offload_checkpointing

        # Block swap
        self.is_swapping_blocks = args.blocks_to_swap is not None and args.blocks_to_swap > 0
        if self.is_swapping_blocks:
            logger.info(f"enable block swap: blocks_to_swap={args.blocks_to_swap}")
            model.enable_block_swap(args.blocks_to_swap, accelerator.device)

        return model, text_encoders

    def get_tokenize_strategy(self, args):
        # Load tokenizers from paths (called before load_target_model, so self.qwen3_tokenizer isn't set yet)
        tokenize_strategy = strategy_anima.AnimaTokenizeStrategy(
            qwen3_path=args.qwen3,
            t5_tokenizer_path=args.t5_tokenizer_path,
            qwen3_max_length=args.qwen3_max_token_length,
            t5_max_length=args.t5_max_token_length,
        )
        return tokenize_strategy

    def get_tokenizers(self, tokenize_strategy: strategy_anima.AnimaTokenizeStrategy):
        return [tokenize_strategy.qwen3_tokenizer]

    def get_latents_caching_strategy(self, args):
        return strategy_anima.AnimaLatentsCachingStrategy(args.cache_latents_to_disk, args.vae_batch_size, args.skip_cache_check)

    def get_text_encoding_strategy(self, args):
        return strategy_anima.AnimaTextEncodingStrategy()

    def post_process_network(self, args, accelerator, network, text_encoders, unet):
        pass

    def get_models_for_text_encoding(self, args, accelerator, text_encoders):
        if args.cache_text_encoder_outputs:
            return None  # no text encoders needed for encoding
        return text_encoders

    def get_text_encoder_outputs_caching_strategy(self, args):
        if args.cache_text_encoder_outputs:
            return strategy_anima.AnimaTextEncoderOutputsCachingStrategy(
                args.cache_text_encoder_outputs_to_disk, args.text_encoder_batch_size, args.skip_cache_check, False
            )
        return None

    def cache_text_encoder_outputs_if_needed(
        self, args, accelerator: Accelerator, unet, vae, text_encoders, dataset: train_util.DatasetGroup, weight_dtype
    ):
        if args.cache_text_encoder_outputs:
            if not args.lowram:
                # We cannot move DiT to CPU because of block swap, so only move VAE
                logger.info("move vae to cpu to save memory")
                org_vae_device = vae.device
                vae.to("cpu")
                clean_memory_on_device(accelerator.device)

            logger.info("move text encoder to gpu")
            text_encoders[0].to(accelerator.device)

            with accelerator.autocast():
                dataset.new_cache_text_encoder_outputs(text_encoders, accelerator)

            # cache sample prompts
            if args.sample_prompts is not None:
                logger.info(f"cache Text Encoder outputs for sample prompts: {args.sample_prompts}")

                tokenize_strategy = strategy_base.TokenizeStrategy.get_strategy()
                text_encoding_strategy = strategy_base.TextEncodingStrategy.get_strategy()

                prompts = train_util.load_prompts(args.sample_prompts)
                sample_prompts_te_outputs = {}
                with accelerator.autocast(), torch.no_grad():
                    for prompt_dict in prompts:
                        for p in [prompt_dict.get("prompt", ""), prompt_dict.get("negative_prompt", "")]:
                            if p not in sample_prompts_te_outputs:
                                logger.info(f"  cache TE outputs for: {p}")
                                tokens_and_masks = tokenize_strategy.tokenize(p)
                                sample_prompts_te_outputs[p] = text_encoding_strategy.encode_tokens(
                                    tokenize_strategy, text_encoders, tokens_and_masks
                                )
                self.sample_prompts_te_outputs = sample_prompts_te_outputs

            accelerator.wait_for_everyone()

            # move text encoder back to cpu
            logger.info("move text encoder back to cpu")
            text_encoders[0].to("cpu")

            if not args.lowram:
                logger.info("move vae back to original device")
                vae.to(org_vae_device)

            clean_memory_on_device(accelerator.device)
        else:
            # move text encoder to device for encoding during training/validation
            text_encoders[0].to(accelerator.device)

    def sample_images(self, accelerator, args, epoch, global_step, device, vae, tokenizer, text_encoder, unet):
        text_encoders = text_encoder if isinstance(text_encoder, list) else [text_encoder]  # compatibility
        te = self.get_models_for_text_encoding(args, accelerator, text_encoders)
        qwen3_te = te[0] if te is not None else None

        text_encoding_strategy = strategy_base.TextEncodingStrategy.get_strategy()
        tokenize_strategy = strategy_base.TokenizeStrategy.get_strategy()
        anima_train_utils.sample_images(
            accelerator,
            args,
            epoch,
            global_step,
            unet,
            vae,
            qwen3_te,
            tokenize_strategy,
            text_encoding_strategy,
            self.sample_prompts_te_outputs,
        )

    def get_noise_scheduler(self, args: argparse.Namespace, device: torch.device) -> Any:
        noise_scheduler = sd3_train_utils.FlowMatchEulerDiscreteScheduler(num_train_timesteps=1000, shift=args.discrete_flow_shift)
        return noise_scheduler

    def encode_images_to_latents(self, args, vae, images):
        vae: qwen_image_autoencoder_kl.AutoencoderKLQwenImage
        return vae.encode_pixels_to_latents(images)  # Keep 4D for input/output

    def shift_scale_latents(self, args, latents):
        # Latents already normalized by vae.encode with scale
        return latents

    def get_noise_pred_and_target(
        self,
        args,
        accelerator,
        noise_scheduler,
        latents,
        batch,
        text_encoder_conds,
        unet,
        network,
        weight_dtype,
        train_unet,
        is_train=True,
    ):
        anima: anima_models.Anima = unet

        # Sample noise
        if latents.ndim == 5:  # Fallback for 5D latents (old cache)
            latents = latents.squeeze(2)  # [B, C, 1, H, W] -> [B, C, H, W]
        noise = torch.randn_like(latents)

        # Get noisy model input and timesteps
        noisy_model_input, timesteps, sigmas = flux_train_utils.get_noisy_model_input_and_timesteps(
            args, noise_scheduler, latents, noise, accelerator.device, weight_dtype
        )
        timesteps = timesteps / 1000.0  # scale to [0, 1] range. timesteps is float32

        # Gradient checkpointing support
        if args.gradient_checkpointing:
            noisy_model_input.requires_grad_(True)
            for t in text_encoder_conds:
                if t is not None and t.dtype.is_floating_point:
                    t.requires_grad_(True)

        # Unpack text encoder conditions
        prompt_embeds, attn_mask, t5_input_ids, t5_attn_mask = text_encoder_conds

        # Move to device
        prompt_embeds = prompt_embeds.to(accelerator.device, dtype=weight_dtype)
        attn_mask = attn_mask.to(accelerator.device)
        t5_input_ids = t5_input_ids.to(accelerator.device, dtype=torch.long)
        t5_attn_mask = t5_attn_mask.to(accelerator.device)

        # Create padding mask
        bs = latents.shape[0]
        h_latent = latents.shape[-2]
        w_latent = latents.shape[-1]
        padding_mask = torch.zeros(bs, 1, h_latent, w_latent, dtype=weight_dtype, device=accelerator.device)

        # Call model
        noisy_model_input = noisy_model_input.unsqueeze(2)  # 4D to 5D, [B, C, H, W] -> [B, C, 1, H, W]
        with torch.set_grad_enabled(is_train), accelerator.autocast():
            model_pred = anima(
                noisy_model_input,
                timesteps,
                prompt_embeds,
                padding_mask=padding_mask,
                target_input_ids=t5_input_ids,
                target_attention_mask=t5_attn_mask,
                source_attention_mask=attn_mask,
            )
        model_pred = model_pred.squeeze(2)  # 5D to 4D, [B, C, 1, H, W] -> [B, C, H, W]

        # Rectified flow target: noise - latents
        target = noise - latents

        # Loss weighting
        weighting = anima_train_utils.compute_loss_weighting_for_anima(weighting_scheme=args.weighting_scheme, sigmas=sigmas)

        return model_pred, target, timesteps, weighting

    def process_batch(
        self,
        batch,
        text_encoders,
        unet,
        network,
        vae,
        noise_scheduler,
        vae_dtype,
        weight_dtype,
        accelerator,
        args,
        text_encoding_strategy,
        tokenize_strategy,
        is_train=True,
        train_text_encoder=True,
        train_unet=True,
    ) -> torch.Tensor:
        """Override base process_batch for caption dropout with cached text encoder outputs."""

        # Text encoder conditions
        text_encoder_outputs_list = batch.get("text_encoder_outputs_list", None)
        anima_text_encoding_strategy: strategy_anima.AnimaTextEncodingStrategy = text_encoding_strategy
        if text_encoder_outputs_list is not None:
            caption_dropout_rates = text_encoder_outputs_list[-1]
            text_encoder_outputs_list = text_encoder_outputs_list[:-1]

            # Apply caption dropout to cached outputs
            text_encoder_outputs_list = anima_text_encoding_strategy.drop_cached_text_encoder_outputs(
                *text_encoder_outputs_list, caption_dropout_rates=caption_dropout_rates
            )
            batch["text_encoder_outputs_list"] = text_encoder_outputs_list

        return super().process_batch(
            batch,
            text_encoders,
            unet,
            network,
            vae,
            noise_scheduler,
            vae_dtype,
            weight_dtype,
            accelerator,
            args,
            text_encoding_strategy,
            tokenize_strategy,
            is_train,
            train_text_encoder,
            train_unet,
        )

    def post_process_loss(self, loss, args, timesteps, noise_scheduler):
        return loss

    def get_sai_model_spec(self, args):
        return train_util.get_sai_model_spec_dataclass(None, args, False, True, False, anima="preview").to_metadata_dict()

    def update_metadata(self, metadata, args):
        metadata["ss_weighting_scheme"] = args.weighting_scheme
        metadata["ss_logit_mean"] = args.logit_mean
        metadata["ss_logit_std"] = args.logit_std
        metadata["ss_mode_scale"] = args.mode_scale
        metadata["ss_timestep_sampling"] = args.timestep_sampling
        metadata["ss_sigmoid_scale"] = args.sigmoid_scale
        metadata["ss_discrete_flow_shift"] = args.discrete_flow_shift

    def is_text_encoder_not_needed_for_training(self, args):
        return args.cache_text_encoder_outputs and not self.is_train_text_encoder(args)

    def prepare_text_encoder_grad_ckpt_workaround(self, index, text_encoder):
        # Set first parameter's requires_grad to True to workaround Accelerate gradient checkpointing bug
        first_param = next(text_encoder.parameters())
        first_param.requires_grad_(True)

    def prepare_unet_with_accelerator(
        self, args: argparse.Namespace, accelerator: Accelerator, unet: torch.nn.Module
    ) -> torch.nn.Module:
        # The base NetworkTrainer only calls enable_gradient_checkpointing(cpu_offload=True/False),
        # so we re-apply with unsloth_offload if needed (after base has already enabled it).
        if self._use_unsloth_offload_checkpointing and args.gradient_checkpointing:
            unet.enable_gradient_checkpointing(unsloth_offload=True)

        if not self.is_swapping_blocks:
            return super().prepare_unet_with_accelerator(args, accelerator, unet)

        model = unet
        model = accelerator.prepare(model, device_placement=[not self.is_swapping_blocks])
        accelerator.unwrap_model(model).move_to_device_except_swap_blocks(accelerator.device)
        accelerator.unwrap_model(model).prepare_block_swap_before_forward()

        return model

    def on_validation_step_end(self, args, accelerator, network, text_encoders, unet, batch, weight_dtype):
        if self.is_swapping_blocks:
            # prepare for next forward: because backward pass is not called, we need to prepare it here
            accelerator.unwrap_model(unet).prepare_block_swap_before_forward()


def setup_parser() -> argparse.ArgumentParser:
    parser = train_network.setup_parser()
    train_util.add_dit_training_arguments(parser)
    anima_train_utils.add_anima_training_arguments(parser)
    # parser.add_argument("--fp8_scaled", action="store_true", help="Use scaled fp8 for DiT / DiTにスケーリングされたfp8を使う")
    parser.add_argument(
        "--unsloth_offload_checkpointing",
        action="store_true",
        help="offload activations to CPU RAM using async non-blocking transfers (faster than --cpu_offload_checkpointing). "
        "Cannot be used with --cpu_offload_checkpointing or --blocks_to_swap.",
    )
    return parser


if __name__ == "__main__":
    parser = setup_parser()

    args = parser.parse_args()
    train_util.verify_command_line_training_args(args)
    args = train_util.read_config_from_file(args, parser)

    if args.attn_mode == "sdpa":
        args.attn_mode = "torch"  # backward compatibility

    trainer = AnimaNetworkTrainer()
    trainer.train(args)


================================================
FILE: bitsandbytes_windows/cextension.py
================================================
import ctypes as ct
from pathlib import Path
from warnings import warn

from .cuda_setup.main import evaluate_cuda_setup


class CUDALibrary_Singleton(object):
    _instance = None

    def __init__(self):
        raise RuntimeError("Call get_instance() instead")

    def initialize(self):
        binary_name = evaluate_cuda_setup()
        package_dir = Path(__file__).parent
        binary_path = package_dir / binary_name

        if not binary_path.exists():
            print(f"CUDA SETUP: TODO: compile library for specific version: {binary_name}")
            legacy_binary_name = "libbitsandbytes.so"
            print(f"CUDA SETUP: Defaulting to {legacy_binary_name}...")
            binary_path = package_dir / legacy_binary_name
            if not binary_path.exists():
                print('CUDA SETUP: CUDA detection failed. Either CUDA driver not installed, CUDA not installed, or you have multiple conflicting CUDA libraries!')
                print('CUDA SETUP: If you compiled from source, try again with `make CUDA_VERSION=DETECTED_CUDA_VERSION` for example, `make CUDA_VERSION=113`.')
                raise Exception('CUDA SETUP: Setup Failed!')
            # self.lib = ct.cdll.LoadLibrary(binary_path)
            self.lib = ct.cdll.LoadLibrary(str(binary_path))            # $$$
        else:
            print(f"CUDA SETUP: Loading binary {binary_path}...")
            # self.lib = ct.cdll.LoadLibrary(binary_path)
            self.lib = ct.cdll.LoadLibrary(str(binary_path))            # $$$

    @classmethod
    def get_instance(cls):
        if cls._instance is None:
            cls._instance = cls.__new__(cls)
            cls._instance.initialize()
        return cls._instance


lib = CUDALibrary_Singleton.get_instance().lib
try:
    lib.cadam32bit_g32
    lib.get_context.restype = ct.c_void_p
    lib.get_cusparse.restype = ct.c_void_p
    COMPILED_WITH_CUDA = True
except AttributeError:
    warn(
        "The installed version of bitsandbytes was compiled without GPU support. "
        "8-bit optimizers and GPU quantization are unavailable."
    )
    COMPILED_WITH_CUDA = False


================================================
FILE: bitsandbytes_windows/main.py
================================================
"""
extract factors the build is dependent on:
[X] compute capability
    [ ] TODO: Q - What if we have multiple GPUs of different makes?
- CUDA version
- Software:
    - CPU-only: only CPU quantization functions (no optimizer, no matrix multiple)
    - CuBLAS-LT: full-build 8-bit optimizer
    - no CuBLAS-LT: no 8-bit matrix multiplication (`nomatmul`)

evaluation:
    - if paths faulty, return meaningful error
    - else:
        - determine CUDA version
        - determine capabilities
        - based on that set the default path
"""

import ctypes

from .paths import determine_cuda_runtime_lib_path


def check_cuda_result(cuda, result_val):
    # 3. Check for CUDA errors
    if result_val != 0:
        error_str = ctypes.c_char_p()
        cuda.cuGetErrorString(result_val, ctypes.byref(error_str))
        print(f"CUDA exception! Error code: {error_str.value.decode()}")

def get_cuda_version(cuda, cudart_path):
    # https://docs.nvidia.com/cuda/cuda-runtime-api/group__CUDART____VERSION.html#group__CUDART____VERSION
    try:
        cudart = ctypes.CDLL(cudart_path)
    except OSError:
        # TODO: shouldn't we error or at least warn here?
        print(f'ERROR: libcudart.so could not be read from path: {cudart_path}!')
        return None

    version = ctypes.c_int()
    check_cuda_result(cuda, cudart.cudaRuntimeGetVersion(ctypes.byref(version)))
    version = int(version.value)
    major = version//1000
    minor = (version-(major*1000))//10

    if major < 11:
       print('CUDA SETUP: CUDA version lower than 11 are currently not supported for LLM.int8(). You will be only to use 8-bit optimizers and quantization routines!!')

    return f'{major}{minor}'


def get_cuda_lib_handle():
    # 1. find libcuda.so library (GPU driver) (/usr/lib)
    try:
        cuda = ctypes.CDLL("libcuda.so")
    except OSError:
        # TODO: shouldn't we error or at least warn here?
        print('CUDA SETUP: WARNING! libcuda.so not found! Do you have a CUDA driver installed? If you are on a cluster, make sure you are on a CUDA machine!')
        return None
    check_cuda_result(cuda, cuda.cuInit(0))

    return cuda


def get_compute_capabilities(cuda):
    """
    1. find libcuda.so library (GPU driver) (/usr/lib)
       init_device -> init variables -> call function by reference
    2. call extern C function to determine CC
       (https://docs.nvidia.com/cuda/cuda-driver-api/group__CUDA__DEVICE__DEPRECATED.html)
    3. Check for CUDA errors
       https://stackoverflow.com/questions/14038589/what-is-the-canonical-way-to-check-for-errors-using-the-cuda-runtime-api
    # bits taken from https://gist.github.com/f0k/63a664160d016a491b2cbea15913d549
    """


    nGpus = ctypes.c_int()
    cc_major = ctypes.c_int()
    cc_minor = ctypes.c_int()

    device = ctypes.c_int()

    check_cuda_result(cuda, cuda.cuDeviceGetCount(ctypes.byref(nGpus)))
    ccs = []
    for i in range(nGpus.value):
        check_cuda_result(cuda, cuda.cuDeviceGet(ctypes.byref(device), i))
        ref_major = ctypes.byref(cc_major)
        ref_minor = ctypes.byref(cc_minor)
        # 2. call extern C function to determine CC
        check_cuda_result(
            cuda, cuda.cuDeviceComputeCapability(ref_major, ref_minor, device)
        )
        ccs.append(f"{cc_major.value}.{cc_minor.value}")

    return ccs


# def get_compute_capability()-> Union[List[str, ...], None]: # FIXME: error
def get_compute_capability(cuda):
    """
    Extracts the highest compute capbility from all available GPUs, as compute
    capabilities are downwards compatible. If no GPUs are detected, it returns
    None.
    """
    ccs = get_compute_capabilities(cuda)
    if ccs is not None:
        # TODO: handle different compute capabilities; for now, take the max
        return ccs[-1]
    return None


def evaluate_cuda_setup():
    print('')
    print('='*35 + 'BUG REPORT' + '='*35)
    print('Welcome to bitsandbytes. For bug reports, please submit your error trace to: https://github.com/TimDettmers/bitsandbytes/issues')
    print('For effortless bug reporting copy-paste your error into this form: https://docs.google.com/forms/d/e/1FAIpQLScPB8emS3Thkp66nvqwmjTEgxp8Y9ufuWTzFyr9kJ5AoI47dQ/viewform?usp=sf_link')
    print('='*80)
    return "libbitsandbytes_cuda116.dll"            # $$$
    
    binary_name = "libbitsandbytes_cpu.so"
    #if not torch.cuda.is_available():
        #print('No GPU detected. Loading CPU library...')
        #return binary_name

    cudart_path = determine_cuda_runtime_lib_path()
    if cudart_path is None:
        print(
            "WARNING: No libcudart.so found! Install CUDA or the cudatoolkit package (anaconda)!"
        )
        return binary_name

    print(f"CUDA SETUP: CUDA runtime path found: {cudart_path}")
    cuda = get_cuda_lib_handle()
    cc = get_compute_capability(cuda)
    print(f"CUDA SETUP: Highest compute capability among GPUs detected: {cc}")
    cuda_version_string = get_cuda_version(cuda, cudart_path)


    if cc == '':
        print(
            "WARNING: No GPU detected! Check your CUDA paths. Processing to load CPU-only library..."
        )
        return binary_name

    # 7.5 is the minimum CC vor cublaslt
    has_cublaslt = cc in ["7.5", "8.0", "8.6"]

    # TODO:
    # (1) CUDA missing cases (no CUDA installed by CUDA driver (nvidia-smi accessible)
    # (2) Multiple CUDA versions installed

    # we use ls -l instead of nvcc to determine the cuda version
    # since most installations will have the libcudart.so installed, but not the compiler
    print(f'CUDA SETUP: Detected CUDA version {cuda_version_string}')

    def get_binary_name():
        "if not has_cublaslt (CC < 7.5), then we have to choose  _nocublaslt.so"
        bin_base_name = "libbitsandbytes_cuda"
        if has_cublaslt:
            return f"{bin_base_name}{cuda_version_string}.so"
        else:
            return f"{bin_base_name}{cuda_version_string}_nocublaslt.so"

    binary_name = get_binary_name()

    return binary_name


================================================
FILE: configs/qwen3_06b/config.json
================================================
{
  "architectures": [
    "Qwen3ForCausalLM"
  ],
  "attention_bias": false,
  "attention_dropout": 0.0,
  "bos_token_id": 151643,
  "eos_token_id": 151643,
  "head_dim": 128,
  "hidden_act": "silu",
  "hidden_size": 1024,
  "initializer_range": 0.02,
  "intermediate_size": 3072,
  "max_position_embeddings": 32768,
  "max_window_layers": 28,
  "model_type": "qwen3",
  "num_attention_heads": 16,
  "num_hidden_layers": 28,
  "num_key_value_heads": 8,
  "rms_norm_eps": 1e-06,
  "rope_scaling": null,
  "rope_theta": 1000000,
  "sliding_window": null,
  "tie_word_embeddings": true,
  "torch_dtype": "bfloat16",
  "transformers_version": "4.51.0",
  "use_cache": true,
  "use_sliding_window": false,
  "vocab_size": 151936
}


================================================
FILE: configs/qwen3_06b/merges.txt
================================================
#version: 0.2
Ġ Ġ
ĠĠ ĠĠ
i n
Ġ t
ĠĠĠĠ ĠĠĠĠ
e r
ĠĠ Ġ
o n
Ġ a
r e
a t
s t
e n
o r
Ġt h
Ċ Ċ
Ġ c
l e
Ġ s
i t
a n
a r
a l
Ġth e
; Ċ
Ġ p
Ġ f
o u
Ġ =
i s
ĠĠĠĠ ĠĠĠ
in g
e s
Ġ w
i on
e d
i c
Ġ b
Ġ d
e t
Ġ m
Ġ o
ĉ ĉ
r o
a s
e l
c t
n d
Ġ in
Ġ h
en t
i d
Ġ n
a m
ĠĠĠĠĠĠĠĠ ĠĠĠ
Ġt o
Ġ re
- -
Ġ {
Ġo f
o m
) ;Ċ
i m
č Ċ
Ġ (
i l
/ /
Ġa nd
u r
s e
Ġ l
e x
Ġ S
a d
Ġ "
c h
u t
i f
* *
Ġ }
e m
o l
ĠĠĠĠĠĠĠĠ ĠĠĠĠĠĠĠĠ
t h
) Ċ
Ġ{ Ċ
Ġ g
i g
i v
, Ċ
c e
o d
Ġ v
at e
Ġ T
a g
a y
Ġ *
o t
u s
Ġ C
Ġ st
Ġ I
u n
u l
u e
Ġ A
o w
Ġ '
e w
Ġ <
at ion
( )
Ġf or
a b
or t
u m
am e
Ġ is
p e
t r
c k
â Ģ
Ġ y
i st
-- --
. ĊĊ
h e
Ġ e
l o
Ġ M
Ġb e
er s
Ġ on
Ġc on
a p
u b
Ġ P
ĠĠĠĠĠĠĠĠ ĠĠĠĠĠĠĠ
as s
in t
> Ċ
l y
ur n
Ġ $
; ĊĊ
a v
p ort
i r
- >
n t
ct ion
en d
Ġd e
it h
ou t
t urn
ou r
ĠĠĠĠ Ġ
l ic
re s
p t
= =
Ġth is
Ġw h
Ġ if
Ġ D
v er
ag e
Ġ B
h t
ex t
= "
Ġth at
** **
Ġ R
Ġ it
es s
Ġ F
Ġ r
o s
an d
Ġa s
e ct
k e
ro m
Ġ //
c on
Ġ L
( "
q u
l ass
Ġw ith
i z
d e
Ġ N
Ġa l
o p
u p
g et
Ġ} Ċ
i le
Ġa n
at a
o re
r i
Ġp ro
; čĊ
ĉĉ ĉĉ
t er
a in
Ġ W
Ġ E
Ġc om
Ġre turn
ar t
Ġ H
a ck
im port
ub lic
Ġ or
e st
m ent
Ġ G
ab le
Ġ -
in e
il l
in d
er e
: :
it y
Ġ +
Ġt r
el f
ig ht
( '
or m
ul t
st r
. .
" ,
Ġy ou
y pe
p l
Ġn ew
Ġ j
ĠĠĠĠĠĠĠĠ ĠĠĠĠĠĠĠĠĠĠĠ
Ġf rom
Ġ ex
Ġ O
l d
Ġ [
o c
: Ċ
Ġs e
Ġ le
---- ----
. s
{ Ċ
' ,
an t
Ġa t
as e
. c
Ġc h
< /
av e
an g
Ġa re
Ġin t
âĢ Ļ
_ t
er t
i al
a ct
} Ċ
iv e
od e
o st
Ġc lass
Ġn ot
o g
or d
al ue
al l
f f
( );Ċ
on t
im e
a re
Ġ U
Ġp r
Ġ :
i es
iz e
u re
Ġb y
i re
Ġ} ĊĊ
. p
Ġs h
ic e
a st
pt ion
tr ing
o k
_ _
c l
# #
Ġh e
ar d
) .
Ġ @
i ew
ĉĉ ĉ
Ġw as
i p
th is
Ġ u
ĠT he
id e
a ce
i b
a c
r ou
Ġw e
j ect
Ġp ublic
a k
v e
at h
o id
Ġ= >
u st
q ue
Ġre s
) )
' s
Ġ k
an s
y st
un ction
**** ****
Ġ i
Ġ us
p p
on e
a il
== ==
n ame
Ġst r
Ġ /
Ġ &
a ch
d iv
yst em
el l
Ġh ave
er r
ou ld
ul l
p on
Ġ J
_ p
Ġ= =
ig n
S t
. Ċ
Ġp l
) ;ĊĊ
f orm
p ut
ou nt
} ĊĊ
d d
it e
Ġg et
r r
om e
Ġ âĢ
ar am
c c
Ġ* /
E R
I n
le s
_ s
on g
i e
Ġc an
Ġ V
er v
p r
Ġ un
ro w
b er
Ġd o
l l
Ġ el
Ġs elf
at ed
ar y
Ġ .
' ]
u d
Ġ en
ĠT h
ĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠĠĠĠĠĠĠ
t e
_ c
u ct
Ġa b
or k
. get
Ġ #
a w
res s
o b
N ame
ap p
[ '
Ġal l
or y
it ion
an ce
e ar
Ġcon t
v ent
i a
Ġw ill
I N
ĠĠĠĠĠĠĠĠ Ġ
re turn
Ġ< /
d ata
) ĊĊ
R e
p le
il d
th er
Ġy our
" Ċ
( $
Ġ out
) ,
Ġh as
S tring
s o
Ġ up
a x
Ġde f
Ġb o
g e
al se
O N
p er
ic h
Ġb ut
Ġ Ċ
Ġ _
_ m
ad d
que st
od el
s elf
er y
f t
en s
// //
a ke
. C
Ġg o
Ġf unction
Ġ K
iv ate
Ġ im
Ġcon st
. t
Ġ*/ Ċ
) ;čĊ
Ġv oid
Ġs et
ĠS ystem
c ri
( )Ċ
l i
ĉ if
. m
al ly
s et
e p
âĢĻ s
b o
de f
' ,Ċ
Ġm e
Ġ !
at ch
" >
" ,Ċ
e c
ĠI n
p h
Ġ |
_ f
Ġv ar
en ce
I d
re e
in k
le ct
u g
et h
Ġel se
-------- --------
con t
Ġs o
at ic
Ġl o
p ro
t on
s s
ow n
ab el
o int
ou s
el d
S T
T he
ĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ
R E
" :
ol or
t p
e g
ke y
u de
ĠS t
ou nd
Ġa r
" );Ċ
en er
s er
b ject
ess age
f er
Ġm ore
ation s
ent s
Ġh is
Ġthe y
. S
Ġ Y
u se
n e
is h
ol d
_ d
i o
i eld
Ġp er
C ont
ing s
## ##
Ġd ata
Ġs a
e f
f o
Ġon e
en g
Ġd is
A T
Ġn ame
Ġtr ue
v al
le d
. f
Ġn e
Ġ end
. T
c re
ar k
lo g
E x
err or
_ id
ur re
ang e
Ġn ull
rr ay
Ġm y
p an
ic t
at or
V iew
L ist
ĉ return
âĢ Ŀ
Ġp re
Ġ x
cl ude
ar g
o v
. h
Ġ >
Ġthe ir
' )
ir st
ic k
g h
L E
O R
Ġpr ivate
t em
čĊ čĊ
us er
Ġ )
c om
. A
" ;Ċ
Ġ id
re ad
Ġwh o
_ b
" >Ċ
Ġt ime
Ġm an
r y
==== ====
rou p
ro p
p ublic
v el
um ber
b le
Ġwh ich
******** ********
Ġan y
Ġf alse
w e
Ġv alue
Ġl i
" )
nd er
g r
Ġn o
p aram
f ig
.c om
Ġa pp
_ l
ion s
. D
ĠC h
Ġab out
Ġa dd
Ġs u
Ġstr ing
I D
Ġo ver
str ing
. l
our ce
_ C
] Ċ
Ġ qu
ĠS tring
c a
S E
Ġ ro
s h
u al
T ype
s on
n ew
er n
Ġa g
A R
] ;Ċ
] .
Ġ ?
ic al
Ġd es
ut h
i x
ay s
Ġt ype
' t
a ult
Ġin ter
v ar
. b
Ġp art
. d
urre nt
I T
E N
en c
( f
r a
v alue
ch o
ut ton
o se
Ġ! =
at er
à ©
re ate
ol l
p os
y le
n g
A L
us ing
am es
Ġ{ čĊ
at es
el y
Ġw ork
Ġ em
in al
Ġs p
Ġwh en
.s et
ĠĠĠĠ ĠĠ
) :Ċ
t o
qu ire
ind ow
le ment
pe ct
as h
[ i
Ġu se
. F
pe c
Ġa d
o ve
ce ption
eng th
in clude
ad er
ĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠĠĠĠĠĠĠĠĠĠĠ
at us
T h
it le
r it
v oid
() .
( Ċ
Ġof f
Ġo ther
Ġ& &
' ;Ċ
m s
Ġbe en
Ġt e
m l
c o
n c
erv ice
Ġ %
** Ċ
an n
ad e
ĊĊ ĊĊ
lo ck
con st
pon se
Ġs up
+ +
d ate
Ġa cc
Ġh ad
Ġb u
ĠR e
Ġw ere
Ġf ile
Ġw ould
ĠâĢ ľ
v en
is s
Ġ our
c lass
r aw
Ġy ear
D ata
Ġv al
Ġs ome
f ter
y s
Ġ// /
rou nd
v iew
Ġp e
Ġth ere
Ġsa id
d u
o f
l ine
/ *
d uct
Ġh er
ĠĠĠĠĠĠĠĠ ĠĠĠĠĠ
R es
Ġc o
Ġcom m
is e
m in
ĠĠĠĠ Ċ
# include
eth od
. P
ut e
Ġas s
I nt
as k
lo c
Ġli ke
od y
Ġle t
lo ad
Ġa m
ro l
Ġg r
y p
Ġal so
ĠI t
ur l
if ic
or s
_ P
_ n
ig h
Ġth an
C om
A N
U L
at ing
ĠTh is
re f
_ S
Ġst atic
ro ll
Ġj ust
Ġres ult
i an
id th
Ġthe m
) );Ċ
d er
re ak
C on
: //
u le
.. .
ar ch
em ent
Ġ< <
us h
en se
ar r
Ġint o
c ess
am p
i ed
um ent
Ġ \
] ,
w o
al s
Ġwh at
an c
V alue
= '
ol um
Ġp os
ag es
ay er
Ġs c
u es
" )Ċ
_ T
Ġl ist
( s
Ġc ase
C h
ĉĉĉĉ ĉ
//// ////
pon ent
Ġ z
Ġk n
le t
D E
re d
Ġf e
Ġ} ,Ċ
Ġ ,
( t
Ġf irst
' );Ċ
w ord
Ġ import
Ġa ct
Ġch ar
C T
ĠT r
op le
= {
ĉ f
i ent
c ent
. j
le ction
) )Ċ
Ġon ly
Ġpr int
m er
. W
o ck
Ġ --
T ext
Ġo p
an k
Ġit s
Ġb ack
[ "
Ġne ed
Ġc l
Ġs ub
Ġl a
( (
. "
O bject
Ġst art
f ile
( self
n er
e y
Ġus er
Ġ ent
ĠC om
it s
ĠC on
ou ble
ow er
it em
ver y
ĠW e
lic k
Ġ Q
ph p
t tp
' :
ic s
Ġu nder
Ġ* Ċ
. L
) ;
ic es
Ġre g
) čĊ
ĉ public
S S
Ġth en
re at
i ous
. G
e k
ire ct
he ck
cri pt
n ing
ĠU n
Ġm ay
ĠW h
B o
I tem
str uct
. st
re am
ib le
lo at
Ġor g
u nd
s um
_ in
.. /
_ M
Ġh ow
r ite
' Ċ
T o
w w
Ġpe ople
ind ex
. n
ht tp
( m
ect or
Ġin d
Ġj av
] ,Ċ
ĠH e
_ st
f ul
o le
) {Ċ
Ġsh ould
op y
el p
i er
_ name
ers on
I ON
ot e
Ġt est
Ġb et
rr or
ul ar
ã Ģ
Ġ Ð
b s
t ing
Ġm ake
T r
Ġa fter
ar get
R O
olum n
r c
_ re
def ine
Ġr ight
r ight
d ay
Ġl ong
[ ]
( p
t d
con d
ĠP ro
Ġre m
ption s
v id
. g
Ġ ext
Ġ __
' )Ċ
p ace
m p
Ġm in
st ance
a ir
a ction
w h
t ype
ut il
a it
< ?
I C
t ext
Ġp h
Ġf l
. M
cc ess
b r
f ore
ers ion
) ,Ċ
. re
ate g
Ġl oc
in s
- s
tr ib
ĠI nt
Ġa rray
, "
P ro
( c
ess ion
> ĊĊ
Ġs he
" ]
ap h
Ġex p
ert y
ĠS e
Ġp ar
un c
E T
Ġre ad
pr int
Ġre l
Ġfor m
Ġd r
Ex ception
in put
Ġtr ans
#### ####
ord er
B y
Ġa w
it ies
u ff
pl ay
. add
ĠâĢ ĵ
Ġw ant
Ġcom p
ment s
Ġ| |
a z
b e
Ġn umber
Ġre quire
ĠE x
Ġc ol
Ġ key
em ber
Ġt wo
Ġs ize
Ġwh ere
U T
res ult
ĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ
ou gh
or ld
o od
u ch
at ive
g er
are nt
Ġ/ *
Ġar g
Ġwh ile
( this
Ġre c
Ġd if
St ate
Ġs pec
r ide
_ F
Ġlo ok
A M
il ity
et er
âĢĻ t
ĊĊ Ċ
ay out
---------------- ----------------
ag er
Ġc ould
Ġb r
end s
u res
Ġkn ow
et s
ĠI f
ĠS h
. w
b ack
Ġs er
Ġ+ =
Ġf r
() );Ċ
Ġh and
I nd
UL L
I m
() ;ĊĊ
Ġm ost
Ġtr y
Ġn ow
rou gh
> čĊ
ack age
Ġh im
. _
if y
Ġb reak
Ġ );Ċ
re n
# define
it t
Ġa p
ĉ c
( n
ĠY ou
: ĊĊ
- m
Ġe very
ust om
li ent
oc ument
cri ption
E rror
- b
Ð ¾
] [
tr ans
Ġp oint
Ġst d
Ġf il
T ime
Ġm od
Ġ ->
Ġ error
a h
Ġt ext
roll er
lo se
q l
Ġp ol
> </
Ġsh ow
U ser
as ed
Ġ{ ĊĊ
Ġf ind
Ð °
E D
s pan
en u
Ġc urrent
Ġus ed
ce pt
cl ud
Ġpl ay
Ġl og
ut ion
f l
Ġse e
indow s
Ġh elp
Ġthe se
Ġp ass
Ġd own
Ġe ven
as on
u ild
f rom
( d
Ġb l
l abel
el se
Ð µ
Ġ( !
iz ed
() ,
Ġo b
Ġit em
um p
U R
or n
Ġd on
S e
m an
am ple
t n
======== ========
H e
gr am
Ġd id
w n
_ h
iv er
Ġs m
Ġth rough
ĠA n
ch e
Ġin v
ou se
Ġ es
ĠN ew
ex port
m ary
ut o
l er
Ġl ast
Ġe vent
tr y
ï ¼
il y
ign ed
in es
oll ow
ic ense
so le
le ar
( int
Ġag ain
Ġh igh
ht ml
Ind ex
uth or
Ġ/ **Ċ
Ġl ine
E vent
_ D
Ġdo es
it ial
Ġc r
ar s
Ġt em
ca use
f ace
Ġ `
_ A
B utton
at ure
ect ed
E S
ist er
ĉ Ċ
Ġbe fore
a le
o ther
Ġbe cause
ro id
Ġ ed
i k
re g
ĠD e
Ġd ist
} ,Ċ
Ġst ate
Ġcon s
r int
at t
Ġh ere
in ed
Ġf inal
Ġ" "
K ey
L O
Ġd el
pt y
th ing
ĠA nd
Ġr un
Ġ X
y m
. app
Ġv ery
c es
_ N
are d
w ard
l ist
it ed
ol og
it ch
Bo x
if e
Ġa c
Ġm odel
Ġm on
Ġw ay
le te
Ġc all
Ġat t
Ġc al
ver t
Ġde c
le ase
ou n
Ġ} );Ċ
f r
form ation
et ail
Ġn um
a j
qu ery
Ġw ell
Ġo bject
ĠA s
Ġyear s
C olor
I S
Ġdef ault
W h
Ġin s
a int
Ġjav a
Ġs im
ĠA r
m on
t il
() ;čĊ
) :
S et
at ter
Ġv iew
Ġp res
arr ay
W e
A t
Ġb el
Ġman y
M an
end er
Ġbe ing
Ġgo od
ĉĉĉĉ ĉĉ
ation al
w are
. log
{ čĊ
Ġus ing
_ B
Ġ: =
_ w
ist s
l ish
Ġst ud
ĠA l
Ġg u
con fig
ur ing
t ime
ok en
ames pace
Ġre quest
Ġch ild
Ġ Ã
lo b
Ġp aram
Ġ} čĊ
Ġe cho
f unction
**************** ****************
p s
E lement
al k
lic ation
b y
S ize
raw ing
Ġp erson
ĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ
\ n
ob ject
in ce
E n
F ile
u f
ff ect
A C
Ġst yle
sum mary
Ġ que
_ r
Ġ( $
M odel
id ent
Ġm ethod
I L
ot t
les s
IN G
Ġ( )
Ġex pect
y nc
p ackage
ur s
Ġpro t
. /
p re
Ġ )Ċ
m a
Ġs ur
Ġf ound
In fo
p ar
im es
. e
ain s
Ġp ost
- d
ole an
Ġs l
P E
Ġsu ch
se lect
ain er
Ġth ink
Ġdif fer
. r
/ **Ċ
F F
o ol
pl ate
qu al
ĠF or
Ġm uch
u c
( new
od ule
Ġs om
Ġh ttp
ĠL ist
Ġc ount
Ġin st
ch ar
m it
. id
ak ing
Ġg ener
p x
v ice
_ data
ĠN ULL
} čĊ
id d
ãĢ Ĥ
Ġm ed
or g
id er
ach e
w ork
Ġc heck
we en
Ġ( (
th e
ant s
> <
. B
- c
Ġop en
Ġe st
ĠĠĠĠĠĠĠĠ Ċ
Ġn ext
I M
Ñ Ĥ
O T
à ³
Ġf ollow
cont ent
ĠĠĠĠĠĠĠĠ ĠĠĠĠ
Ġin clud
H E
ĠR es
Ġh ref
Ð ¸
Ġc ar
yp es
im age
U n
Ġbo ol
A D
Ġg ame
.F orm
row s
* /
vel op
.D rawing
Ġp ath
is ion
Ġe ach
ĠP l
_t ype
P ath
ne ction
Ġa v
' ).
Ġsup port
EN T
re m
" ).
Ġo wn
Ġc or
c ount
m iss
u ally
Ġm em
st d
i ence
se arch
" ĊĊ
F orm
Ġs ex
en ame
Ġs ign
Ġ et
ĠĠĠĠĠĠĠĠ ĠĠ
', '
ĠA pp
Ġth ose
o ff
Ġ err
Ġs ystem
Ġbe st
c ode
Ġs ame
Ġd i
us s
Ġc reate
ath er
A rray
. in
f e
S ervice
U N
at s
Ġ Z
al th
Ġm ade
tr ue
A B
Ġm ark
r id
if ied
, čĊ
y n
p ress
Ġg roup
Ġf in
ĠL icense
F ield
eg er
Ġw orld
in ess
t y
Ġpro cess
( b
Ġc re
ar n
iv es
Ġm ain
ide o
_ g
A G
val id
im g
P I
Ġc olor
Ġre port
Ġt ake
ri b
O M
Ġd ay
Re quest
Ġs k
b ers
ĉ s
.A dd
o ot
Im age
Ġcom ple
ol lection
Ġto p
Ġf ree
A S
D e
ĠO n
I G
et a
D ate
Ġa ction
O ver
it or
ĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ
n ot
Ġind ex
h er
ic on
O n
;čĊ čĊ
iv ity
m and
.W indows
O L
Ġre al
Ġm ax
l and
.. ..
r aph
Ġbu ild
le g
ass word
? ĊĊ
âĢ ¦
o ok
u ck
Ġm essage
t est
iv ers
Ġin put
Ġar t
Ġbet ween
G et
ent er
g round
en e
à ¡
.l ength
N ode
( i
C lass
f or
ĠâĢ Ķ
t en
o in
Ġ ke
u i
ĠI N
Ġt able
s ub
ĠL e
Ġhe ad
Ġm ust
//////// ////////
. util
Cont ext
Ġor der
Ġm ov
o ver
Ġcont in
Ġs ay
st atic
.T ext
Ġclass Name
pan y
Ġt er
he ad
r g
Ġpro duct
Th is
. âĢĿ
ĠB ut
lo y
Ġd ouble
s g
Ġpl ace
. x
m essage
Ġin formation
pr ivate
Ġo per
c ed
d b
"> </
P aram
ic le
Ġwe ek
Ġpro p
t able
id get
pl ace
P rop
ĠA ll
el s
bo x
.ĊĊ ĊĊ
. R
ĠT o
it er
S h
ur ation
old er
_l ist
c ome
Ġs w
iz ation
ĉf or
b l
Ġpro gram
( e
a pe
che ck
.Form s
Ġu nd
ateg ory
ag s
Ġres ponse
U S
re quest
Ġstr uct
es cription
Ġc ode
_ H
uff er
Ġwith out
lob al
Man ager
il ter
P O
ĉ this
o ption
Ġs ol
Ġ= ==
ak es
Cont roller
M essage
Ġre f
e ver
ĠS o
ain ing
.app end
Ġst ill
Ġpro vid
Ġass ert
m ed
Ġc ap
us iness
Ġre p
t ings
v ed
. N
ap i
O D
Ġf ield
iv en
ot o
âĢ ľ
c ol
( x
g ht
Res ult
C ode
. is
l ink
Ġc our
A n
Ġte am
ĉ int
if t
Ġse cond
Ġgo ing
Ġr ange
_ E
n ess
Ġf am
Ġn il
ĠC ont
ail able
ut es
at ab
Ġf act
Ġv is
( &
ĠA N
A l
t itle
Ġand roid
C E
\ "
ir t
Ġw rit
Ð ½
ĉ m
ft ware
on d
Ġre t
os ition
Ġh ome
Ġle ft
arg s
mer ic
Ġd irect
oc i
P l
A s
re t
ad o
O f
ch n
ĠG et
e e
ro ss
() ;
__ __
.p h
I t
out e
Ġex per
cho ol
ww w
} ,
Ġall ow
Ġ Â
() )
s ize
is m
a i
tr act
an e
.. .ĊĊ
cont ext
Ġbe g
C H
Ġp age
h ip
n o
c ore
s p
Ġdiffer ent
i able
ĠM e
_ IN
b utton
ĠI s
erv ices
Ġc a
Ġa round
A pp
r ation
Ġre ce
Ġre ally
Ġim age
Ġt arget
Ġde p
opy right
tr a
ing le
it al
L ayout
Ġbo th
Over ride
ar m
= >
ater ial
ile d
Ġp ut
Q u
Ñ Ģ
un g
m ap
ĉĉĉĉ ĉĉĉĉ
Ġle vel
Com ponent
bo ok
cre en
_ RE
Ġcon fig
ã ģ
O r
. data
Ġd ocument
", "
trib ute
u x
L og
fer ence
p ost
_ e
Ġloc al
and om
ass ert
V al
lect ed
in a
atab ase
A dd
Ġcont ent
.p rint
s igned
r ic
." ĊĊ
Ġf a
! ĊĊ
- f
iv ed
Ġ quest
. ex
Ġf loat
Ġde velop
о Ð
M ap
ad ing
Ġpos s
U E
n amespace
_ O
ĉ b
.G et
> (
j son
etail s
Ġto o
Ġext ends
ĠN one
Ġf ore
( String
form at
Ġg reat
int er
ca le
Ñ ģ
r on
iv ing
E nt
enc y
x t
o y
Ġmon th
Ġh app
Ġsup er
b ar
def ault
_ de
ord s
l n
( {Ċ
ĠI nd
as es
Ġt itle
Ġcont ext
o h
- p
E m
Ġm et
T est
Ġl ife
_ v
ĠU S
U I
oc ation
m d
Ġ[ Ċ
Ġ ]
s w
Ġin cre
s cript
ent ial
w ays
. de
Ġs rc
Ġc atch
ĠA meric
// Ċ
ĠĠĠĠĠĠĠĠ ĠĠĠĠĠĠ
Ġp ay
pl it
âĢ Ķ
Ġc oun
ob j
.ph p
Ġch ange
eth ing
' re
ast er
lo s
l ation
ĠĠ Ċ
L e
à ¤
( {
read y
ĠN o
Ġpos ition
Ġo ld
Ġbo ok
able d
b ug
H and
} ;ĊĊ
is play
av ing
Ġgo ver
Ġv ersion
S ystem
n ect
res ponse
St yle
U p
ang u
Ġth ree
in it
er o
Ġl aw
end if
Ġb ase
em ail
( l
_ V
Ġcon f
AT E
Ġd uring
t es
Ġcon sole
ĠP r
Ġs pe
v es
p ath
ial og
d ition
_t o
ard s
Ġagain st
et work
ĠP h
_ L
c ur
im it
W ith
Ġp ower
i um
' ;ĊĊ
Ġw om
le ft
our ces
at ri
ĠI m
ĠM an
or th
$ {
qu als
es e
_s ize
Ġis s
ot al
- g
i que
r ame
Ġw idth
er g
) (
itt le
T R
ĠThe y
enc es
r l
on s
Ġl abel
. y
- t
up date
an el
s c
.t o
Ġpro ject
à ¼
Ġe lement
Ġsu ccess
ĉĉ Ċ
.s h
r am
ch ed
() )Ċ
Ġ( Ċ
Ġd ate
Ġto t
_ ST
A ll
ific ation
ĉ var
Ġt ri
ch em
m y
Ġb ig
ĠA d
ĠA t
ot s
n um
A ct
Ġm ap
er a
co pe
. $
, âĢĿ
Ġp op
Ġf ew
Ġl en
u id
et ers
u les
à Ń
s ource
http s
Ġd em
Ġe ar
######## ########
Ġm atch
or ies
ac es
ĠC l
Ġn ode
ir c
loc al
un ity
} ;Ċ
Ġan other
< <
og le
Ġs it
ew ork
T E
. I
N S
olog y
ou ght
.C ont
> >
Ġc are
st ate
ĉ private
Ġe ffect
++ )
_f ile
end ing
L ine
F or
i or
ĠS c
Ġf un
.S ize
ĉ else
] )
st art
v ious
Ġ} ,
our s
Ġle g
Ġs ervice
Ġs ince
ir on
L abel
Ġn on
Ġl os
ict ion
Ġf ull
act er
bo ard
g ress
Ġt urn
ith er
.s ize
Ġb ody
res h
et urn
( _
y les
orm al
p i
Ġsom ething
! --
u int
Ġpro du
Ġst and
Ġpro ble
Ġav ailable
m t
ĠB l
Ġ ...
Ġb lock
In put
Ġke ep
C ount
op en
Ġ[ '
Ġth row
uild er
A ction
Ġth ings
Tr ue
Ġ url
ĠB o
print f
Ġre d
j s
.c reate
ĠO r
St atus
In stance
Ġcont rol
Ġcom e
Ġc ustom
loc ation
m odel
Ġ čĊ
Ġs ource
Ġe as
. out
] ĊĊ
one y
Ġaw ait
Ġpart ic
A P
ub lish
od es
_p ro
p ly
rit er
Ġpro v
Ġm ill
H T
] )Ċ
Ġch ang
Ġas k
ĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠĠĠĠĠ
Ġout put
Ġem ail
.p ush
Ġ} čĊčĊ
in ation
atri x
T able
u ccess
] );Ċ
ĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ
Ġdis c
( [
Ġb usiness
he ight
. html
t a
f ield
Ġrequire d
_ R
Ġgover n
} čĊčĊ
le x
. ,
ĠS et
ur ch
// /
t s
a f
Ġm ight
ist ory
S tr
Ġne ver
Res ponse
ar se
ad a
ĠH ow
Ġ* )
Ġ ;
Ġh ard
A d
Ġinter n
us ed
( data
m od
ann el
Ġn p
ug g
Ġ/ >Ċ
Ġcal led
b ody
Ġch o
( r
_s et
ir d
Ġ> =
Ġ} ;Ċ
Ġo ptions
ĠG ener
Ġhe ight
P oint
Y ou
et y
C lick
Ġsm all
Ġ ide
Ġacc ess
angu age
Ġprot ected
Ġj ob
ĠTh ere
D ef
Ġadd ress
Ġu int
N ot
o o
ap s
< div
ain ed
at ur
Ġs um
- w
ĠD ate
Ġl ittle
Ġf ri
Y PE
Ġp ort
e h
pr ing
_p ath
Ġst atus
a im
bo ol
Ġap pe
Ġo s
. name
ens ion
_ G
Ġup date
Con fig
a ff
ER R
Ġ< =
at ely
# if
u ction
ĠT e
Ġl ink
ĠU ser
.f ind
. org
m e
Ġg iven
O ut
# endif
Ġbet ter
P age
Ġfe el
en n
M L
Ġal ready
Ġinclud ing
o ogle
r u
ic ally
pro p
le an
out er
Ġal ways
ord ing
I f
or age
Ġp arent
v is
ĉĉĉĉ ĉĉĉ
Ġg ot
st and
Ġle ss
/ s
ĠA ss
ap t
ire d
ĠA dd
Ġacc ount
p loy
Ġd er
res ent
Ġl ot
Ġval id
ĉ d
Ġb it
pon ents
Ġfollow ing
_ ex
S ON
Ġs ure
oc ial
Ġp rom
ert ies
he ader
.p ro
Ġbo olean
Ġse arch
k en
Ġor ig
Ġ er
E d
E M
a ut
l ing
al ity
By Id
b ed
ĉc ase
eth er
pos it
Ġinv est
ĠO R
Ġs ays
miss ion
AM E
Ġtem p
o ad
Ġre st
in fo
Ġinter est
A rg
Ġper form
pon s
ĠV iew
Ġv er
l ib
( const
U til
List ener
ar ge
Ġm ult
Ġd ie
Ġs ite
../ ../
E L
Ġval ues
Ġ} )Ċ
p en
N o
ic ro
Ġbe h
Ġ' ./
ac y
re c
() ->
ĉ ĠĠĠ
" ))
Cont ent
_ W
ple ment
Ġw on
Ġv ideo
ad i
p oint
% %
Ġg l
erv ed
v iron
I F
ut ed
ã ĥ
' m
Ġc ert
Ġpro f
Ġc ell
ar i
Ġpl ayer
a is
Ġc ost
Ġh um
( R
Ġoff ic
k s
.t ext
at ures
Ġtot al
Ġ*/ ĊĊ
o pe
Ġst at
U M
Ġlo ad
ight s
Ġc lear
u ro
Ġte chn
up port
I R
Ġ row
Ġse em
Ġ q
Ġsh ort
ĠN ot
ip p
G roup
se ction
m ax
ir l
Ġover ride
Ġcom pany
Ġd one
" );čĊ
Ġg re
. Re
Ġbel ie
r ist
Ġhe alth
AN T
() ĊĊ
ĠB e
. value
ĠG r
ott om
Ġarg s
P T
st atus
f unc
um ents
- h
N umber
: čĊ
ĠL og
er ver
Ġ) ,Ċ
am ent
Ġob j
in c
Ġchild ren
ic y
I Z
and s
ab ly
Ġdist rib
Ġc ur
er ial
Ġd ays
re ated
re ct
- l
ir m
idd en
om b
Ġin itial
.j s
Ġ â
Qu ery
Ġon line
im al
. con
a u
U rl
cont rol
ire ction
Ġin stance
OR T
ĠF r
wh ere
Ġjav ax
Ġorg an
ap ter
Ġre ason
o ptions
ĠM ar
( a
Ġwith in
.âĢĿ ĊĊ
O DE
_ DE
ad min
end ed
Ġdes ign
ĠD ata
un e
ĠF ile
ro ot
Ġc ent
Ġa rr
_ add
l en
p age
, '
_ str
Ġb ro
ab ility
ou th
/ c
p ose
irt ual
ear ch
_ url
arg in
H ttp
Ġs chool
av a
Ġcons ider
.l abel
ĠA rray
we b
o pt
.print ln
ul ation
Ġf unc
P L
Ġ" \
ĠT ext
act ory
(f unction
n ull
Ġen g
d own
Ġin clude
ĠE n
ĠD r
Ġd b
! !
s ide
Ġin it
quire d
ĠS he
C olumn
re act
Ġan n
Ġst op
Ġl ater
ĠTh at
ent ion
d f
U G
I LE
Ġc lient
ra ft
ff er
PO ST
el per
Ġlo ve
qu ote
ou d
Ġj son
Ġab le
Ġm en
A X
ĠC opyright
à ¶
av ig
re q
C lient
} );Ċ
.C om
er c
il t
pec ial
_c om
ro om
. Name
Ġg ive
am b
i ke
Ġcon dition
cl ient
ator s
: "
Ġc opy
ut ure
ivers ity
ern al
{ {
ĠC an
ou nc
d o
Ġo cc
Ġapp ro
th ers
z e
Ġe ither
ĠF l
Ġimport ant
Ġle ad
at tr
AR T
E qual
Ġd a
et ch
ent ity
Ġfam ily
add ing
Ġo ption
Ġex ist
ic a
ĠO bject
' ve
v ers
ition al
out put
ĠTr ue
ĠO F
_t ime
Ġof fer
Ġ} );ĊĊ
H ER
eg in
" "
Ġw ater
Ġc he
ĠM y
ore d
Ġst ep
anc es
C K
A Y
à ¸
str uction
( C
ou ch
St ream
act ive
am a
Ent ity
pro duct
() {Ċ
Ġgovern ment
ĠI D
aj or
A nd
Ġdis play
Ð »
Ġt imes
Ġf our
Ġf ar
Ġpres ent
ĠN S
Ġ\ Ċ
ue st
Ġb as
e cho
ch ild
if ier
Hand ler
Ġl ib
Prop erty
trans lation
Ġro om
Ġon ce
Ġ[ ]
cent er
================ ================
Ġresult s
Ġcontin ue
Ġt alk
_ get
Ġg row
.s w
e b
ĠP ublic
O P
ec ute
ol s
Ġ **
" );ĊĊ
Ġm ass
ure d
.c lass
om ic
Ġme an
ip s
Ġa ut
);čĊ čĊ
Ġun til
Ġmark et
Ġare a
u it
Ġl ength
ĠW ith
struct or
e vent
"> <
ĠS p
I V
Ġm us
if f
Ġk ind
a uthor
ound s
m b
_ key
w idth
posit ory
Ġl ight
u k
R ow
oh n
al f
viron ment
app er
ollection s
Ġs ide
_in fo
Ġex ample
im ary
Ġw r
Ġc amp
cri be
" /
Ġm iss
w ay
Ġb ased
Ġpl an
V is
om ain
un k
Ġaw ay
U P
< T
O S
i od
ĠM on
âĢĻ re
Ġli k
à §
iv ely
. v
im er
iz er
S ub
Ġbut ton
ĠU p
Ġexper ience
C L
Ġre nder
_ value
Ġn ear
UR L
al t
Ġcoun try
ib ility
() ,Ċ
e ad
Ġa uthor
Ġspec ific
b ase
( name
on es
ĠD o
Ġal ong
y ear
Ġexp ress
. '
en v
Ġbeg in
Ġso ftware
Ġim p
Ġw in
ó n
Ġth ing
Tr ans
ĠT HE
Ġ< ?
Ġwh y
Ġdoes n
i j
g ing
ĉ g
Ġs ingle
off set
ar ning
og raph
le y
_c ount
Ġan al
cre ate
/ m
ĠR eg
un ch
= $
is k
Ġright s
( M
Ġ"" "Ċ
ap er
.m odel
Ġp o
em pty
art ment
Ġa nt
ĠWh en
Ġwom en
ĠE d
Ġse ason
Ġde st
à £
( h
Ġposs ible
Ġse ver
Ġb tn
Ġdid n
Ġs ent
Ġen c
Ġcomm and
Ġ ],Ċ
_ x
Ġre cent
ol ution
v ector
ĠB y
ĠM ay
ĠA ct
» ¿
Ġm oney
IN T
bs ite
ĉ p
. čĊ
ï »¿
s l
atter n
ĠC lass
Ġto ld
ud io
c urrent
Ġe qu
Ġa uto
ĠSt ate
d a
ms g
)) ;ĊĊ
Ġwork ing
Ġqu ery
ĠB r
Ġw indow
a uth
on ly
ĉ t
Ġle ast
ag n
Ġex pl
it ter
ar ing
Ġc olumn
ĠGener al
": "
er al
ri or
Ġrec ord
I B
E X
Ġd at
Ġm aking
u ed
ĠC ar
em p
" .
ĠM ed
Ġc lose
Ġper cent
Ġp ast
( g
: (
Ġw rite
Ġm ove
Ġp at
Cont rol
.T o
Ġv i
*/ Ċ
in ate
' ll
ag ed
N ull
Ġspec ial
IZ E
Ġc ity
/* Ċ
ĠE ng
ix ed
in ary
p y
Ġe ff
ar io
Ġt ell
av or
Ġse lect
le vel
im um
op er
B uilder
I P
') ,Ċ
es c
Ġf ont
" ;ĊĊ
ĠA m
ish ed
ill s
Int er
O W
Ġcour se
Ġl ate
idd le
Ġam ount
Ġas ync
in o
c ul
Ġ ì
and le
_ user
Ġb en
ĠC al
Ġ$ _
ĠR ep
Ġen ough
T oken
. user
( j
S c
W idth
n ow
at form
Ġlook ing
Ġh old
M odule
IT Y
v o
is on
.D ata
y c
Ġp ot
ĠTr ump
id ual
id es
r t
Ġprop erty
ĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠĠĠĠĠĠĠĠĠĠĠ
am ework
g o
Ġl ow
Ġpar a
Ġpr ice
ur y
Ġto day
ro y
Ġ' /
Ġpol it
Ġ' '
ym b
P h
Ġad v
Ġatt ack
ĠS te
RO M
an a
Ġme ans
Ġst ory
id s
ak en
Ġme et
Ġm om
ĠâĢ ĺ
Ġ? >
Ġd en
ob ile
ch ange
ĠĠĠĠĠĠĠĠ ĠĠĠĠĊ
ic i
n a
ĠF orm
Ġs ort
Se lect
p are
Ġth ought
_ con
Ġt ask
oc us
ĠD E
ĠM in
Ġo pt
ĉb reak
um er
K E
th en
Ġd et
ĠT est
port s
Ġre view
(' /
m ove
Ġsw itch
ER T
p atch
ann ot
ã Ĥ
Ġab ove
it ive
Ġquest ion
ĠQ u
ãĢĤ ĊĊ
g le
Ġw ord
Ġprov ide
ĠR eturn
Ġre search
ã o
u str
Ġp ublish
chem a
} }
ĠC ON
- in
all back
Ġco ver
\ \
c olor
ĠI S
Ġwh ether
im ate
is c
B ar
Ġd iv
B e
our n
Ġh aving
le m
pl ayer
ab s
am era
ne y
Ġex c
get her
pl ied
a o
[ $
Ġ+ +
i pe
sh ow
/ d
[ :
ag ement
le v
_ ID
r ary
ad es
_ se
a use
Ġem ploy
Ġ*/ čĊ
Ġf re
Ġ' @
Ġcomple t
Ġl arge
r al
\ x
Ġf ac
< String
Ġcre ated
up er
.st ate
Ġh ost
ener ic
/ b
( !
wh ile
i as
B UG
Ġ );ĊĊ
Ġro le
Re g
ĠC olor
St art
Ġp orn
t op
Ġwe b
Ġde v
Ġde al
++ )Ċ
Int eger
pos ition
. on
Ġ( "
ä ¸
Ġproble m
s v
Ġp ress
AB LE
AT ION
ĠSe e
an ch
Ġth ough
le ep
Ġ< !--
Ġpoint s
ĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠĠĠĠĠĠĠĠĠ
. J
Ġ ::
p tr
D B
++ ;Ċ
.p ng
n ode
so ft
pon d
Ġe ver
-------------------------------- --------------------------------
M enu
(' #
Ġs ervices
p g
} )Ċ
param s
Ġact ually
Ġ" /
Em pty
M ethod
Ġid ent
un ic
Ġmill ion
Ġa ff
st yle
Ġcon c
i os
ign ment
UL T
P r
" ;čĊ
Ġunder stand
u ary
Ġhapp en
Ġser ver
ĠC o
S C
Ġle s
Ġfile s
G rid
s ql
Ġof ten
Ġin fo
_ tr
s rc
on y
Ġsp ace
um b
Ġpass word
Ġst ore
, ĊĊ
ĠWh at
g ed
ĠF alse
U s
sw er
_ index
Ġform at
m ost
s m
N ew
Ġd etails
Ġpro b
ĠAN D
() čĊ
il ar
Ġ$ {
ry pt
.C ollections
$ this
ĠF ree
_ of
(f alse
d ated
Ġ> >
Ġf ace
CT ION
Ġs ave
Ġt yp
de v
(" #
AG E
cont ainer
ed it
Q L
Ġitem s
Ġs ocial
i en
ĠRe act
) .ĊĊ
Ġm ar
Ġre du
ĠR E
.p ut
Ġm ajor
C ell
n ext
Ġexpect ed
Ġy et
Ġin div
trib utes
at is
am ed
Ġf ood
S ource
( string
Ġ+ Ċ
it es
d r
Ġmem bers
Ġcom b
item s
ĠP er
T H
= True
Ġb ar
_ SE
com m
( w
)ĊĊ Ċ
Ġs end
Ġin c
un signed
F A
Ġparam s
app ing
ro s
ug in
f a
Ġcon nection
Ġ} ;ĊĊ
Ġbe come
M ode
Ġe v
Ġdif f
ĠUn ited
He ight
ful ly
im ages
Ġm akes
Ġg lobal
Ġcont act
' :Ċ
Ġab s
а Ð
f loat
Ġex cept
ĠP ol
Ch ild
t yp
Ġcert ain
i ón
O UT
Ġim pro
ile s
Ġ-- >Ċ
ĠP art
val ues
os s
/ **
il it
ĠE vent
cur ity
st er
Ġchar acter
Ġnew s
Ġ" ,
Ġde vice
c el
log in
he et
Def ault
@ "
ĉ Ġ
c lick
( value
ĠA b
Ġpre vious
ERR OR
oc al
Ġm aterial
Ġbel ow
ĠCh rist
Ġmed ia
co ver
ĠU I
Ġf ail
Ġbl ack
Ġcom ponent
ĠAmeric an
Ġadd ed
Ġbu y
st it
Ġc ame
Ġde lete
prop erty
od ing
Ġc ard
rop s
Ġhttp s
Ġro ot
Ġhand le
C C
B ack
em plate
Ġget ting
_b y
m ail
_s h
. assert
ĠD ec
( true
Ġcom put
Ġcl aim
' =>
ĠS ub
Ġa ir
op s
n av
em ents
( id
Ġent er
ang ed
E nd
Ġloc ation
Ġn ight
Ġdo ing
ĠR ed
l in
}ĊĊ Ċ
vid er
Ġp ick
Ġw atch
ess ages
Ġhum an
Ġd am
p end
d ir
Ġt ax
Ġg irl
re et
Ġbo x
Ġstr ong
( v
re l
Ġinter face
Ġm sg
f ect
_ at
Ġh ouse
Ġtr ack
' );ĊĊ
j e
ĠJ ohn
ist r
( S
ub e
Ġc e
itt ed
V ER
* )
p arent
Ġapp lication
an y
.sw ing
Ġp ack
\ u
Ġpr act
Ġse ction
ct x
Ġun signed
.P oint
ĠO ne
Ä ±
ip le
a id
Ñ ĥ
V ector
by te
Ġw ait
ĠÃ ł
à ¥
Ġto gether
Ġth rows
F O
' ))
h ost
is ing
. view
Ġter ms
fr amework
- r
Ġapp ly
Ġs ession
O ptions
ugg est
Ġo thers
w itter
Ġf und
In it
__ (
ens or
G ET
Ġsever al
i i
[ j
I O
Ġtem plate
P osition
Ġe con
ach ine
Ġ il
.s pring
m ain
el t
im ent
Re c
m m
ĠUn iversity
urs or
ĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠĠĠĠ
G L
ict ure
ith ub
c er
c ast
F rom
a les
Ġsub ject
p assword
n y
Ġes c
.w rite
ï¼ Į
Wh at
. H
Ġh istory
ĠF e
Ġindiv idual
un it
Ġ-- >
Ġd u
I ST
Ġus ers
f s
f alse
un t
T itle
Ġm ot
Ġf uture
ach ed
Ġstart ed
Ġm ode
Ġ' <
_ array
Ġa x
'] ;Ċ
i res
Th ere
ug ht
t ml
pos ed
ic ult
Ġto ok
Ġg ames
Ġ} }
Ġ? >Ċ
Ġproduct s
I s
Ġb ad
ĠD es
.p ath
' ĊĊ
ĠP ost
av el
( :
Ġneed s
Ġkn own
F l
Ġex ec
Ġse en
um e
Ġb order
Ġl ive
tem p
P er
Ġvar iable
i et
ĠD ef
Ġg e
em e
_b ack
f irst
Ġprovid ed
//////////////// ////////////////
Ġfil ename
Ġh ope
ul y
a uto
f ind
_ string
b tn
it ude
At tribute
Ġyou ng
.t xt
Ġwe bsite
ĠP rop
Ġe y
> ();Ċ
ion al
AR R
iction ary
ur ther
. </
AL L
Ġstud y
il i
Ġn etwork
y l
ist ance
O K
N U
re st
ĠS T
icro soft
Ġl imit
Ġc ut
() :Ċ
Ġc ou
og n
Ġsize of
iv al
Ġw ent
. z
L ink
Ġf ire
Ġac ross
Ġcomm unity
reg ion
N E
Re f
Ġoffic ial
Ġvis it
ol ve
Ġrece ived
Ġto ken
Ġmonth s
Ġan im
Ġpartic ular
st yles
ic o
Ġ ess
.Cont rol
Ġ é
b all
Ġle arn
ind ing
V ar
Ġde cl
( err
LE CT
O ne
ph a
Ġ ~
f ort
as ure
Ġm ind
ĠE nd
C heck
Ġqu ick
" ),
AN D
ut ions
B ase
____ ____
Ġcom ment
IN E
âĢĻ ve
B ut
ĠE l
ĠU s
Ġad min
m ark
ĠN ame
` Ċ
ĠT ype
am ic
p c
lo or
F T
Ġo pp
ck et
) ->
t x
Ġp ur
u el
ymb ol
u ation
ang er
Ġback ground
ec ess
ef ined
.... ....
Ġdes cription
Ġrep resent
") );Ċ
press ion
row ser
Ġser ies
ward s
($ _
a ise
Ġh ot
ac ity
ri es
action s
C reate
ad io
amp les
Ġorig inal
ens ive
f ont
st ream
 using
.spring framework
ser ver
Ġb ill
AC K
il ename
Ġfr ame
Ġ= Ċ
Ed it
adi us
Ġd raw
ank s
Ġd eter
Ġcom es
_ int
Ġfore ach
ang le
Ġe lect
pect ed
He ader
ist ration
F alse
ĠG ame
Ġfil ter
Act ivity
Ġl arg
in ition
Ġ" <
is ed
Ġrem ove
ĠTr ans
m et
se e
Form at
Com mand
ĠE X
N one
Ġfr ont
A SE
ĠR ec
ound ation
Ġv o
= \"
( *
Ch ange
.W rite
g roup
i ents
u y
******************************** ********************************
Ġd ig
h r
( -
Ġg en
n umber
ve c
uro pe
ent ry
L L
Ġst e
Val id
'] ,
_p aram
Ġse lected
Ġacc ording
ĠD is
Ġ util
B uffer
_ error
Ġass oci
_S IZE
Ġw or
Ġprint f
r ag
 ł
D D
ĠV al
Ġact iv
E ng
et ime
Ġv irtual
a ign
a ur
ĠP res
ĠEx ception
Ġany thing
ĠO ff
Ġh ours
Ġw ar
Arg s
ag ing
Ġmodel s
ĠT ime
O b
am s
j oy
Ġear ly
. read
Ġc enter
ĠIn itial
Ġl anguage
l ength
x y
Ġs n
Ġin f
P ost
Ġag o
Ġeas y
_c ode
ĠAN Y
_ ch
Ġdown load
( T
av ed
âĢ ĵ
Ġstud ents
Ġf ig
l ight
x x
Ġbu ffer
ĠD ep
ĠM ath
IT H
Ġvar i
Ġd ue
F actory
Ġp or
Ġe p
ot ype
Ġcan not
Ġwh ite
< int
ter n
Ġreg ister
Ġpre d
cl us
_d ate
Ġ/ **
Ġa uth
Ġ[ ]Ċ
Ġper iod
n own
Ġv ot
Ġs creen
' d
T ypes
Ġt mp
е Ð
ur al
Ġben ef
_ y
Ġn et
ĠSt ates
'] ['
ĠN e
ĠN OT
Ġn eg
Ġcomm on
s cope
Ġc red
g es
_T YPE
Ġs uggest
o om
.ĊĊ Ċ
Ġac cept
Ġr andom
er m
ĠV ector
w ith
T ER
( str
Ġres pons
Ġh it
.S et
gr id
ri a
Ġc lick
und le
C ase
ins ert
Util s
Ġ"" "
Ġim plement
at al
tem pt
tem plate
oc r
return s
Ġplay ers
us ers
ed ef
ĠTh ese
Ġam ong
Ġde b
h a
.get Element
Ġc irc
Ġan swer
Ġw alk
Ġt reat
ĠG e
ĠC reate
Ġa ge
Ġre q
O ST
ang ular
Ñ ı
Ġf ive
Ġdistrib uted
Ġfri end
T P
Ġc lean
ow s
.Control s
d is
Ġw ords
. io
z y
Ġhe ader
ĠC heck
âĢĻ m
j ust
h older
=" <?
ĠG NU
ĠC ol
im est
ent ic
{ ĊĊ
Ġt re
l ast
l a
ĠY ork
L o
Ġdisc uss
ĠG od
Ġiss ue
re w
W indow
Ġl and
Ġst ream
ĠP ar
Ġqu ality
P ar
_n um
Ġs al
el ves
OR D
( user
Ġwork s
Ġh alf
ens es
v as
Ġpol ice
(" /
u a
Ġsim ple
Add ress
Ġem pty
es h
Up date
ĠC reated
(' .
). Ċ
ĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠĠ
Ġag re
ĠF ROM
Ġco ok
Ġevery thing
il ities
.st atus
Ġrel ations
ext ern
Ġno thing
Ġrun ning
ĉ void
R I
_ a
_C ON
p or
.s ub
re quire
ĠC ity
ĠW est
Ġm or
st ore
E quals
od er
Ġn a
Ġ[ [
Ġ( '
ĠD on
ER S
/ p
.j son
ab or
Ġsome one
_t ext
.c ss
.T ab
ĠS ome
at o
d ouble
Ġsh are
( void
_d ir
Ġ ur
St ack
ĠW orld
. X
str act
H ow
.G eneric
ic les
Ġent ry
Ġchang es
Ġperson al
( A
Ġoff set
_p tr
Ġp ie
ĠJ an
-g roup
m odule
Item s
ĠHow ever
ver age
.F ont
Ġevent s
.m in
Ġinv ol
z a
Ġwho le
Ġneed ed
Ġlik ely
ri ef
OR M
v ersion
Ġf ight
Ġe in
F rame
g en
ĠO ut
avig ation
L ength
il led
qu ence
Ġ! ==
ĠSo ftware
Ġwrit ing
Ġr ate
'] ,Ċ
P anel
in ner
Ġ[ "
Ġt w
c d
Ġ ;Ċ
_st ate
ĠS m
ĠM ark
)) ĊĊ
pro t
ĠM r
m ethod
ustom er
I con
Ġcor rect
( object
ĠM ore
Ġf all
Ġv ol
Ġdevelop ment
ent ly
Ġs i
med i
v ing
P P
ak er
Ġin du
Ġel if
Ġpre t
Ġbelie ve
n s
om et
ĠInt ern
R ect
S o
. error
Re ad
Ġfe atures
Ġmin utes
-- -
as ing
cre t
"> čĊ
. annot
Ġcol lection
' .
Ġsim ilar
Ġt aken
(" %
Or der
'] Ċ
-m d
ĠT H
ac ed
Ġis n
/ j
Ġs on
gr aph
ĠInt eger
Ġn ecess
re en
Ġ um
Ġ\ <
Ġmom ent
Ġbr ing
Ġind ic
ys is
Le vel
ver se
urre nc
_t est
Ġent ire
D own
Ġ}ĊĊ Ċ
( result
ĠRe ad
à ¨
M od
Ġtry ing
") ,Ċ
Ġm ember
ĠC or
OD O
- control
un time
ĠS im
D ialog
pl ot
_ on
Ġph ys
} /
Ġn amespace
ĉ čĊ
ac c
Pl ayer
A RE
Ġf oot
Ġbo ard
p art
Ġs us
w ise
ĠM c
Ġp ush
AT A
Ġp lease
ri ed
we et
b it
id ed
V E
ĠS w
U B
Ġt ypes
ed ia
Ġc los
ace book
Wh en
Ġed it
ig ger
Ġen erg
Cont ainer
Ġph ot
ĠC ount
ĠE urope
.I s
ĠR uss
pe ed
ĠS tr
Ġp y
Ġc ult
Ġdef ined
cc ount
Ġob t
.L ocation
Ġth read
il le
Ġinst ead
str ong
ĠS ec
U RE
Ġide a
. se
em y
select ed
Con nection
ac ing
th read
.n ext
Ġc oll
Ġfil m
ist ic
Ġcomp et
Ġcon n
th ough
Ġcom pan
ock et
Ġte ach
= (
Ġph one
Ġact ive
de lete
tr ies
Ġm o
Ġde ath
} );ĊĊ
oc ol
W idget
Ġart icle
ro du
and id
Ñ ĭ
ĠC r
k a
() :
lo od
ĉĉĉ Ċ
Ġal most
Ġs ell
erv let
ri p
Un it
Ġapp lic
Ġcon nect
Ġfe ature
Ġv ia
' ),
Ġl im
ĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ
ĠG u
Eng ine
Ġen s
Ġen vironment
b lock
HER E
N ULL
g y
t ag
) ).
ex p
Ġcom pl
Ġinst all
Ġcomple te
que ue
atur al
Ġgener al
th on
Ġask ed
o res
( res
Ġres erved
S P
ĠâĢ ¦
Å Ĥ
Ġsign ific
O ff
ĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠĠĠĠĠĠĠĠĠĠĠĠĠ
ĠA g
ĠJ ust
ĠE rror
Ġin fl
ad ata
Ġ icon
ask s
' '
_ LO
? .
ac count
Ġ( *
' )ĊĊ
r ap
_ var
ĠF OR
Ġpart y
ĠY our
c at
str y
. new
bo ot
ĠN ov
Ġv ector
Ġn ormal
Ġf urther
Re pository
Ġd atabase
att le
Ġmus ic
Ġspe ed
Ġd oc
pro cess
IG HT
.p arse
Ġt aking
Ġvi ol
ce ed
ĠA fter
Ġfor ward
Ġc rit
"/ >Ċ
ro t
Ġfa iled
ef ore
Ġconc ern
o e
b a
Ġs ender
Ġter m
h as
=" #
Ġpot ential
N um
Ġpublish ed
.c lose
ĠIm age
str aint
U D
ĠO b
Ġprob ably
l im
" :Ċ
olum e
Ġcon sum
ag ue
ens ions
Ġinvest ig
- year
') ;
-s m
Ġen joy
or ig
er ing
c p
le ased
ple ments
Ġreturn s
p at
B O
ĠH ouse
.L abel
Ġwe ight
igh b
Ġcondition s
Ġex ception
d escription
Ġtr ad
- to
Ġ{ }
Ġmod ule
EN D
. ap
.p rops
Ġcon structor
av es
Ġf avor
ĠN ow
; i
ĠM ain
_ k
er ies
âĢĻ ll
trans form
imest amp
P re
Ġm er
. res
st ant
L ocation
_N AME
Ġlos s
Ġ ĊĊ
n et
Ġeng ine
B lock
Ġiss ues
Ġpar se
ĠB ar
Ġst ay
ĠJ SON
Ġd om
air s
w ner
Ġl ower
", čĊ
ĠD em
uf act
Ġp s
Ġper fect
R L
Ġed uc
l s
em ory
ARR ANT
u ge
Ġex act
. key
al led
e ch
ie f
\ /
o ke
Ġfor mer
al loc
Ġs ix
id a
Ġm argin
Ġhe art
al d
p ack
.getElement ById
ĠW ARRANT
Ġr ather
Ġbuild ing
er man
lic e
Ġquest ions
iz es
le ge
irect ory
Ġj e
Ġc as
pro ps
ut f
Ġse curity
Ġhow ever
we ight
Ġins ide
Ġpres ident
Ch ar
ĠW ITH
.m ap
Ġgr aph
Ġt ag
_st atus
Ġat tempt
op p
us es
ĉ const
Ġr ound
, $
Ġfri ends
Em ail
? >
Res ource
KE Y
os p
. query
ĠN orth
able s
ist rib
_c lass
el lo
Th at
Ð º
pecial ly
ĠPres ident
Ġcamp aign
Ġal t
are a
Ġch all
Ġop port
.C on
Ġenerg y
li ke
. string
ing ton
) *
y y
Ġprof ession
ir th
Ġse g
æ ľ
Ġh or
i ers
c an
Ġbeh ind
Pro duct
f g
ĠS k
.j pg
? :
] ;ĊĊ
Ġcall back
ĠH ttp
Ñ Į
l ong
M S
AT H
Ġr aise
Ġwant ed
row n
ut or
l t
] =
el ine
M A
Ġse par
c s
se mb
D is
bs erv
ĠW ill
Ġpol icy
Ġth ird
ph one
Ġb ed
/ g
. __
ĠIn c
iz ing
.re move
in stance
.t ype
Ġs erv
E ach
Ġh ar
ĠM essage
( key
SE LECT
P os
)) ;čĊ
Ġre comm
Ġtr aining
ĠE nt
ĠCh ar
ic ht
(f ile
Ġp rior
G ame
Ġex it
Param s
.c ore
P C
n es
anc ed
( request
P assword
} >Ċ
Ġm ag
Ġre lease
Ġsh all
ud ent
ĠS outh
and o
: '
.Tab Index
s k
ann er
is set
Ġout side
led ge
Ġ å
ĠR ob
Ġim m
! Ċ
ĠWe b
D es
B C
anc ial
R oute
D ec
fer ences
Ġp urch
ĠM odel
ct or
g n
_st art
_ un
. *
is es
Ġg round
Ġun ique
Ġbe aut
{ "
Ġp our
ĠO ct
Ġt ree
set s
_ res
') ->
_re g
(" \
Ġby te
B l
Ġd ating
Ġm atter
ĠR em
Ġ' ../
ĠA ug
ĠL a
Ġ$ (
ourn al
i am
Ġshow s
w rite
Ġb all
Ġsim ply
Ġf ast
Ġmem ory
A SS
ĠO f
ov ed
ant e
a ul
ist ry
)) );Ċ
Ġf it
< string
Ġpolit ical
anc el
_ .
c ard
.c urrent
o ch
_ image
\ t
# Ċ
( L
Ġindu stry
com ing
Ġex tra
Ġreport ed
.st art
Ġres ources
Ġim g
fl ow
_E X
(n ull
ĠP re
Ġwr ong
inter face
Param eter
n ers
á »
t ure
ers ist
oun try
Ġseem s
al ance
de st
ĉ String
Ġm aint
Ġun it
act ers
ĠT R
if ul
export s
pro ject
App lication
leg ate
Ġt akes
ter m
Ġet c
ust er
Ġappe ar
add ress
Ġf em
h s
Ġh om
, -
Ġdiff icult
Ġcom ing
O pen
Ġset tings
ĠW ar
ĠTh en
Ġaut om
ĠF oundation
Ġqu ite
D escription
Ġb log
i qu
P S
_f ield
J son
SS ION
ĠS ch
ĠL O
Ġdes cri
Ġevery one
Ġpret ty
Ġlong er
Ġm enu
Ġcurrent ly
se c
Ġrelations hip
################ ################
ĠM ap
as et
Ġparam eters
Ġcr ush
" čĊ
IL ITY
ig ration
Ġc out
t otal
Ġn ames
nd ef
") ;
ri end
yn amic
Ġeff ort
Ġact ual
Ġfield s
O UN
t ers
Ġf ix
_m odel
Ġc ases
C A
M y
Inter face
ĠS E
] ]
al le
ĠN ational
ĠArray List
in line
. V
ar a
ref ix
as c
Re ader
ĠÐ ¿
ast ic
( ()
C l
.annot ation
Ġperform ance
ail y
.to String
.n et
view s
. end
ay ers
l ate
ĠA pr
ed eral
'] )
.b ody
Ġhigh er
_f l
c r
al ert
_n ode
ĠG oogle
Ġit self
A uth
urrenc y
Ġsignific ant
app end
Ġres pect
str ap
Ġun a
riter ia
P ORT
.ap ache
Out put
Ġpro gress
Ġm id
ĠM icrosoft
Ġres ource
ab lish
Ġd im
. load
.A pp
Ġd irection
Ġadd itional
ĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠĠĠĠĠĠĠĠ
Ġnum bers
Ġcompan ies
.T h
Ġs ound
user name
Ġstat ement
Ġal ert
Ġcon tract
h ome
_l ength
.Com ponent
e v
. Ex
ï¼ ļ
" ;
ĠH igh
Ġ )ĊĊ
ĠP oint
op h
Ġl ines
-> _
" )ĊĊ
o x
app lication
Ġ ]Ċ
ĊĊĊĊ ĊĊ
Ġso on
ction s
ing er
Ġj oin
ĠP e
Ġ ë
Ġl as
. E
c ss
/ or
ĠSt art
ĠT O
Ġsub s
con n
com ponents
DE BUG
qu are
F unction
end ar
. index
Ġf ill
Ä Ļ
Ġcho ose
h ow
ĠAmeric a
ass ets
-------- ----
ĠV alue
Ġoff ice
Ġv eh
Ġtrans form
ĠAr t
Ġin de
Ġf n
Ġim plements
ang o
ple te
+ "
t mp
am ily
Ġhas h
miss ions
E ST
g t
Pro vider
ĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠĠĠĠĠĠ
Ġfl ag
Ġpartic ip
d en
ĠReturn s
Ġnot e
ü r
p m
ide os
Ġspec ified
ĠE N
est er
ol id
Ġup on
( std
ĉ v
Ġ' \
u z
Ġv ert
Ġv ict
ĉ self
Ġ" $
. k
Ġgroup s
g ithub
l ang
Ġm ut
T O
Ġv e
ĠP lease
;ĊĊ Ċ
ac cess
Ġ{ "
re a
Ġr isk
ick er
og gle
ĉ while
AN G
.s end
Ġwom an
Ġget s
Ġ ign
ĠI d
_ log
ON E
Ġe vid
ĠH ar
_s ub
Ġend l
Ġinclud ed
() );ĊĊ
ĠA p
ig r
Ġs em
ĠBl ack
d oc
_t able
ĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ
- up
Ġca use
Ġ ..
Ġv an
_d ict
Ġf ocus
IN D
CE SS
.L og
Ġmult iple
id o
Ġreg ard
- M
and ler
our se
Ġde g
. U
Ġadd ition
Ġvar ious
Ġrece ive
е н
ĠH T
Ob j
D F
Ġincre ase
ĠO pen
] ;
Ġcomm it
? Ċ
ateg ories
at ory
sh ip
ĠM ich
Ġh tml
rom ise
Ġle ave
Ġstr ateg
av en
ĠCon sole
k nown
- n
_ LE
.com ponent
Ġb re
S ession
i ance
Ġal ign
typ edef
_ result
ĠW HERE
.s plit
Ġread ing
FA ULT
Ġc lo
Ġnot ice
_p r
ar ter
Ġlo ck
Ġstand ard
et ic
ell ow
Ġp adding
ĠH is
Ġst ates
_c ast
( P
a a
Ġintern al
e an
ĠP RO
ĠK ey
Ġes pecially
m ing
Ġc ross
Ġn ational
_ object
f ilter
Ġs cript
. update
_ i
ĠAss ert
/ core
%% %%
Ġproble ms
ist or
Ġ. =
Ġar ch
Ġwrit ten
Ġm ilit
M ENT
. ch
ca pe
ĠM us
_ config
ĠA PI
fo ot
Ġim ages
end l
. In
F irst
Ġpl atform
.pro t
O ption
st e
ĠT ODO
Ġfor ce
. cont
ĉ echo
ĠD av
P tr
( B
R T
ĠB ase
] ['
Ġann ounc
con sole
ĠP y
d s
. as
Ġpre vent
ap an
Ġ{ '
} </
ĠS ervice
ĠS en
ad or
pro file
T op
Ġit er
p o
I ES
J SON
I E
i ant
ãĢ ģ
_ j
ĠSe pt
_m ap
b um
( context
ĠH ome
i ans
G B
Ġl iving
Ġp attern
( input
ic ient
C ore
Ġent ity
Ġint eg
Ch anged
Ġuse ful
.in fo
Ġto ol
( item
Ġo k
Ġfe ed
I X
é s
ĠNew s
rem ove
err y
ĉĉĉĉ ĉĉĉĉĉ
ip ment
a res
D o
C urrent
. content
.G roup
ustr al
Ġ Ñģ
} )
Ġpop ular
Ġst re
Ġmethod s
_ ERROR
Le ft
c al
bs p
.To String
Ġd ir
Ġallow ed
Ġimp act
") ]Ċ
. config
Ġelement s
Ġpro te
Ġtr ain
. tr
r s
ĠRep ublic
ĠT ask
ar ies
( D
( get
â̦ ĊĊ
Ġrel ated
Ġv ers
Ġs il
Ġ" ";Ċ
Ġc md
Ġtechn ology
.w idth
F loat
ĠU se
B ody
sh ould
.j oin
F ont
ll um
yc le
ĠB rit
Ġm it
Ġs cale
Ġ( _
ern el
") )Ċ
Ġsc ore
/ v
Ġstud ent
U C
.sh ow
Ġa verage
En abled
( ex
com mon
im ation
: @"
ch ie
Ġ ...ĊĊ
r iver
ĠM arch
c ategory
f in
Ġcour t
Ð ²
S erver
Ġcont ainer
- st
_f or
Ġpart s
Ġdec ision
ob s
ou b
m itted
Ġ$ ('#
Ġs aw
Ġappro ach
IC E
Ġsay ing
Ġany one
m eta
S D
Ġs ong
d isplay
O per
out es
Ġch annel
Ġchang ed
à ª
Ġfin ally
_n umber
P lease
à ¤
or ing
- re
Ġk ill
Ġdr ug
w indow
Ġcon vert
omb re
Ġw ays
H elper
ĠF irst
( __
ur ity
ĠW indows
e es
Ġm at
r apper
Ġpl us
ang es
" ].
az on
/ t
l at
ast e
Ġpro file
Ġread y
#if ndef
ro te
Ġs ense
G ener
ĠCon fig
om y
ĠJ une
Ġlate st
Ġsa f
Ġreg ion
Ġde ep
w itch
ĠP ark
} `
ĠF rom
I I
Ġc v
Ġre ach
Ġcount er
ĠW ork
ĠU RL
ĠUp date
', čĊ
Ġim medi
c lose
ad os
fer red
Ġweek s
ur g
Ġdam age
Ġl ost
an i
_ lo
Ġhim self
Ġd og
) ]Ċ
ï ¿
p ir
t t
Ġp aper
Ġthe ms
se cond
Ġst aff
ĠIn put
" +
ĠF acebook
Ġal loc
Ġs ched
AC E
Ġthems elves
ĠCom ponent
Ġdr iver
j a
(p ath
Ġc ategory
all s
p u
llum inate
ĠA ction
.b utton
ĠG L
ist ics
Ġo il
Ġst ock
> '
Ġde ad
V AL
Q UE
**************************************************************** ********
Ġch arg
R eturn
Ġf ul
d om
Ġr ules
Ġmod ify
Ġe val
h am
at ement
\ <
ul a
= False
R A
Ġcont ains
Ġst ack
m ar
Ġ{ }Ċ
Ġund efined
A ss
ĠCh ina
ve y
* Ċ
Ġplay ing
) /
act or
Ġb ottom
li er
ĠN umber
Ġcou ple
D C
ĠS O
g or
.set Text
s uccess
com mand
F ilter
ĠO ur
_ item
Ġc tx
Ġro ad
V ersion
c ase
ur t
av ior
y ch
semb ly
ĠPro duct
Ġh eld
a fe
Ġinclud es
< quote
Ġa void
ĠF in
ĠM od
Ġt ab
an o
à ±
ipp ing
- e
Ġins ert
t arget
ch an
.M odel
IM E
\ Ċ
Ġm achine
av y
ĠN O
ĠInt er
Ġoper ation
mod al
T ag
] :
Ġprodu ction
Ġare as
Ġre n
_f rom
n bsp
Ġoper ator
m en
app ed
_p er
z en
(" .
.s ave
=" {{
Ġt or
( response
Ġc andid
Ġcon v
a iled
ĠL ib
com p
ur a
ï¿ ½
ĠH ere
Ġarg ument
h ood
Ġest ablish
ograph y
Ġon Click
amb da
Ġs ch
Ġmov ie
Ġse c
Ġact ivity
Ø §
Ġs ql
_ all
inc ip
Ġprovid es
Ġs ys
ack et
Ġwas n
Ġus es
ĠF unction
.g oogle
ĠRes ult
Vis ible
ag ma
el come
ĠS y
ĠC ent
AL SE
ac ión
EX T
Ġl icense
ĠL ong
Ġacc om
Ġab ility
. height
Act ive
olog ical
ol y
)) ,
.S e
Ġparam eter
pr ite
AB ILITY
.s ervice
ĠG roup
_ query
ĠI tem
in ing
Ġj ud
im s
f ix
ind er
ag ram
Ġfunction s
Ġexper i
ĠE m
Ġro t
Ġp en
.b tn
ĠA S
#if def
Ġcho ice
ĠP age
_P RO
Q U
å ı
ant ity
 Ń
word s
Ġread only
Ġf lex
prot ected
ĠAn y
Ġchar acters
enc ed
ĠJ uly
il er
C ard
ur ance
Ġre v
.e vent
al y
Ġwon der
ĠP ort
Ġleg al
ro le
Ġt en
Ġgo es
M P
wh ite
): čĊ
)) čĊ
Ġre ference
Ġm is
ĠPro ject
ick s
> &
C ON
Ġre pl
Ġreg ular
St orage
ram ework
Ġgo al
Ġt ouch
.w idget
Ġbu ilt
d es
P art
( re
Ġw orth
h ib
g ame
ĠÐ ²
ac ion
ĠWh ite
(t ype
( `
Ġn atural
Ġin j
Ġcal cul
ĠApr il
. List
Ġassoci ated
ĉ System
~ ~
= [
Ġst orage
Ġby tes
Ġtr avel
Ġs ou
Ġpass ed
! =
as cript
. open
Ġgr id
Ġb us
Ġrec ogn
A b
Ġh on
ĠC enter
Ġpre c
b uild
HT ML
ĠS an
Ġcoun tries
a led
t oken
k t
Ġqu al
L ast
ad ow
Ġman ufact
id ad
j ango
N ext
x f
. a
Ġporn o
ĠP M
er ve
it ing
_ th
c i
= None
g s
Ġlog in
at ives
'] );Ċ
Ä ħ
Ġ ill
I A
child ren
D O
Ġlevel s
Ġ{ {
Ġlook s
Ġ" #
To String
Ġnecess ary
ĠĠĠ Ċ
c ell
En try
Ġ' #
Ġext rem
Select or
Ġplace holder
L oad
Ġre leased
O RE
En umer
ĠT V
SE T
in q
P ress
ĠDep artment
Ġprop erties
Ġres pond
S earch
a el
Ġre qu
ĠB ook
/ Ċ
( st
Ġfin ancial
ick et
_in put
Ġth reat
( in
Str ip
ì Ŀ
ç ão
Ġevid ence
)) ;
ĠB ro
Ġ[ ];Ċ
Ġ ou
b uf
S cript
d at
Ġr ule
# import
=" /
S erial
Ġstart ing
[ index
a e
Ġcon trib
s ession
_ new
ut able
o ber
Ġ" ./
Ġlog ger
Ġrecent ly
Ġreturn ed
č čĊ
)) )Ċ
ition s
Ġse ek
Ġcomm unic
Ġ" .
Ġuser name
E CT
D S
Ġother wise
ĠG erman
. aw
Ad apter
ix el
Ġsystem s
Ġd rop
Ġstruct ure
Ġ$ ("#
enc ies
ann ing
ĠL ink
ĠRes ponse
Ġst ri
Å ¼
ĠD B
æ Ĺ
and roid
sub mit
ot ion
( @
.t est
ĊĊĊĊ ĊĊĊĊ
] ;čĊ
Ġdirect ly
Ġ" %
r is
el ta
A IL
) {čĊ
m ine
ĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠĠĠĠĠĠĠĠĠĠ
( k
b on
as ic
p ite
__ _
M ax
Ġerror s
ĠWh ile
Ġarg uments
Ġens ure
R ight
-b ased
We b
Ġ- =
Ġint rodu
ĠIn st
ĠW ash
ord in
j oin
D atabase
Ġgr ad
Ġus ually
IT E
Prop s
? >Ċ
ĠG o
@ Override
RE F
Ġ ip
ĠA ustral
Ġ ist
View ById
Ġser ious
Ġcustom er
.prot otype
od o
c or
Ġdo or
ĠWITH OUT
Ġpl ant
Ġbeg an
Ġdist ance
() ).
Ġch ance
Ġor d
c ame
pr agma
Ġprot ect
rag ment
ĠN ode
en ing
Ñ ĩ
Ġr oute
ĠS chool
h i
Ġne ighb
A fter
lic it
Ġcon tr
Ġpr imary
A A
.Write Line
util s
Ġb i
R ed
.L inq
. object
Ġlead ers
un ities
Ġg un
on th
ĠDe v
F ILE
Ġcom ments
_l en
ar row
am ount
R ange
s ert
Grid View
Ġup dated
ĠM o
Ġin form
oci ety
al a
A ccess
Ġh ab
Ġc reat
_ arg
ĠJan uary
ĠD ay
") čĊ
up le
d ocument
gor ith
m enu
ĠO ver
b b
.t itle
_ out
Ġle d
ur i
Ġ? ></
g l
Ġb ank
ay ment
ĉ printf
M D
Ġs ample
Ġhand s
ĠV ersion
u ario
Ġoff ers
ity Engine
Ġsh ape
Ġs leep
_p oint
Set tings
Ġa chie
Ġs old
ot a
.b ind
A m
Ġsa fe
St ore
Ġsh ared
Ġpr iv
_V AL
Ġs ens
) {
Ġrem ember
sh ared
e lement
Ġsh oot
V ert
c out
Ġen v
_l abel
Ġ >Ċ
r un
Ġsc ene
( array
de vice
_t itle
ag on
] čĊ
ab y
Ġbe came
bo olean
Ġp ark
ĠC ode
up load
rid ay
ĠSept ember
F e
Ġs en
c ing
F L
C ol
ut s
_p age
in n
Ġim plied
al ing
Ġyour self
.C ount
con f
Ġa ud
_in it
. )
Ġw rote
N G
. Error
ä »
.f or
Ġe qual
ĠRe quest
Ġser ial
Ġallow s
X X
Ġm iddle
ch or
à ¸
erv al
.C olumn
read ing
Ġesc ort
ĠAug ust
Ġquick ly
Ġwe ap
ĠC G
rop ri
h o
Ġc op
( struct
ĠB ig
Ġv s
Ġfre qu
. Value
Ġaction s
Ġpro per
Ġin n
Ġobject s
Ġm atrix
av ascript
Ġon es
.g roup
Ġgre en
Ġp aint
ool s
y cl
enc ode
ol t
com ment
. api
D ir
Ġun e
iz ont
.p osition
Ġdes igned
_ val
av i
ir ing
t ab
Ġl ayer
Ġview s
Ġre ve
ra el
ĠO N
r ics
n p
Ġc ore
() );čĊ
M ain
Ġexp ert
ĉĉ čĊ
_ en
Ġ/ >
ut ter
I AL
ail s
ĠK ing
*/ ĊĊ
ĠM et
_ end
add r
or a
Ġ ir
M in
Ġsur pr
Ġre pe
Ġdirect ory
P UT
- S
Ġe lection
h aps
.p re
c m
Val ues
Ġ" Ċ
c olumn
iv il
Log in
in ue
Ġbeaut iful
Ġse cret
(e vent
Ġch at
um s
Ġorig in
Ġeffect s
Ġman agement
ill a
t k
Ġset ting
ĠC our
Ġmass age
ĉ end
Ġhapp y
Ġfin ish
Ġc amera
ĠV er
ĠDem ocr
ĠH er
( Q
con s
it a
Ġ' .
{ }
ĉ C
Ġst uff
Ġ :Ċ
ĠA R
T ask
h idden
er os
IG N
at io
ĠHe alth
ol ute
Ent er
' >
ĠT witter
ĠCount y
s cribe
Ġ= >Ċ
Ġh y
f it
Ġmilit ary
Ġsa le
re quired
n on
boot strap
h old
r im
- old
ĠD own
Ġm ention
cont act
_g roup
od ay
Ġto wn
Ġsol ution
u ate
ell ing
] ->
ot es
ent al
om en
osp ital
ĠS up
_ EN
Ġsl ow
SE SSION
Ġbl ue
ag o
Ġl ives
Ġ ^
. un
in st
en ge
Ġcustom ers
Ġc ast
ud get
ï¼ ģ
ic ens
Ġdeter min
Se lected
_ pl
ue ue
Ġd ark
// ĊĊ
s i
ther n
ĠJ apan
/ w
P U
ĠE ast
ov ie
Ġp ackage
Ġn or
Ġap i
b ot
" ];Ċ
_p ost
ul ate
Ġcl ub
') );Ċ
Ġlo op
PI O
ion e
sh ot
In itial
Ġplay ed
reg ister
rou ght
_m ax
ac ement
m atch
raph ics
A ST
Ġexist ing
Ġcomple x
D A
.C h
.com mon
m o
Ġ' ../../
it o
Ġanal ysis
Ġdel iver
ĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ċ
id x
à ł
ong o
ĠEng lish
< !--
Ġcomput er
EN SE
Ġp as
Ġr ais
H ash
Ġm obile
Ġo wner
F IG
ĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ
th es
Ġat tr
w d
.t ime
aw n
Ġtreat ment
ĠA c
. View
im pl
m ore
p ass
Ġh a
.f rom
Ġle ading
FF FF
( error
. ui
at ar
ad ers
d ates
Ġz u
Ġfl ow
T arget
Ġinvol ved
Ġi o
par se
$ _
he st
. int
- item
as y
S p
Ġsh ift
N T
Ġt f
_T R
. web
C S
Ġ} )
Ġey es
_ z
' );čĊ
if orn
Ġ{ @
Ġn ice
.l ist
ĠĠĠĠ čĊ
Ġf loor
Ġred irect
ĠU K
( ['
Ġw ish
Ġcap t
leg al
ĠI O
Ġst age
. String
ĠA fr
ig en
ĠS H
De lete
ell s
Ġsol id
Ġmeet ing
Ġwork ed
Ġed itor
in y
Ð ¼
_ read
. Id
e ff
Off set
ch a
US ER
ĉĉ ĠĠĠ
ipp ed
Ġd ict
ĠR un
.h pp
Ġan g
x ml
im ple
Ġmed ical
_t oken
con nect
Ġh our
Ġcont roller
_m essage
U ID
G r
and ed
_C H
Ġbook s
Ġspe ak
am ing
Ġm ount
Rec ord
ĉ struct
.W eb
ond on
Ġ// Ċ
Ġf elt
.A uto
id ge
_p os
P R
Ġmod ern
C ollection
_m sg
C D
ĠL o
Ġsecond s
ib ly
.e quals
Ġintern ational
# pragma
oo th
W riter
i ate
Ġce le
ĠB it
iv o
iv ery
r d
HE CK
Ġc ache
.c ount
Ġro ll
.Re ad
RE D
Ġset up
izont al
model s
arg v
Ġconsider ed
=" ../
set tings
ĠR el
Ġgrow th
Ġm ix
ĠWash ington
Ġpl t
ĠI M
á º
Ġturn ed
ĠDate Time
ĠW ed
( url
Ġ" -
Ġlet ter
As ync
ĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠĠĠĠĠĠĠĠĠĠĠĠ
ĠOct ober
_l ine
Ġatt ention
Ġcol lect
ĠH ash
Ġim ag
T ree
Ġsit uation
et te
_n o
IV E
Ġv on
.t arget
Ġknow ledge
Ġdr ive
.p ost
Ġb lood
Ġc it
pr imary
Ġconfig uration
te e
Ġph oto
is ode
Tr ace
Ġg ave
Ġsh ot
ĠA ir
Ġm other
pr ice
Ġmor ning
)) {Ċ
- x
Ġtr ade
Ġdes c
Ġ&& Ċ
Ġparent s
A pi
å Ī
t ed
w er
Ġ æ
Ġs y
ĠK e
Par ser
å ħ
anc y
Ġpie ce
iforn ia
to String
r an
id ing
PT ION
com es
/ lic
.c lient
E l
L ong
Ġprofession al
ru pt
v a
Ġcomplet ely
Ġpract ice
Ġse lection
R em
in i
Ġc am
RE E
Ġsit es
p a
AT US
Ñģ ÑĤ
arr ant
* (
_ KEY
ĠB utton
ĠF riday
se qu
Ġre ader
Ġm essages
è ¯
Ġbu f
K e
Ġn ov
H P
M sg
al ign
ar ily
Ġ' ,
_w ith
Ġd as
Ġhe ard
at omic
ri al
) [
Ġdis e
@ end
Ġg old
Ġf air
Ġsa les
. Button
str ict
s ave
Ġme asure
Ġ" +
ec ause
View Controller
ĠT able
.p aram
Ġdec ided
(( (
IN FO
Ġopport unity
T e
IC ENSE
cc ording
k i
ĠU N
Ġcont ain
Ġman ager
Ġp ain
ĠF ire
rom e
Ġpl ans
F ound
l ay
ĠDec ember
Ġinfl u
à º
ren ch
ĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ
az ing
b rief
c all
wo od
Ġload ed
Ġgr and
/ f
im p
_ U
ST R
âĢ ¢
Ġcred it
.C olor
or ge
QUE ST
Ġdiffer ence
ĠP C
w args
Ġp ub
und ay
Ġf ra
.m ax
Ġtri ed
ann els
s end
Ġreport s
Ġad ult
ä º
Ġcons ist
ĠSt reet
ĠPro gram
S QL
M atrix
ounc il
- A
ĉ w
Ġwho se
Ġrel ig
ĠS ex
Ġg ives
n one
.m essage
( G
.aw t
- right
ĠNov ember
ell ig
ut ive
Ä ĥ
over n
Ġeas ily
Ġide as
ĠÐ ½
/c ss
ly ing
el le
C an
_c olor
оР²
Ġp air
ng th
Ġs plit
d rop
art y
on a
Ġcap ital
Ġhe ar
Ġex ists
ĉ log
em o
R un
o i
Ġpar ser
ĠM ethod
Ġeduc ation
[ k
Ġlib rary
> ";Ċ
_ UN
ĉ std
od ed
Ġcall s
h ere
R el
Ġbr and
back ground
g a
_add ress
_param s
C ategory
ĠInd ia
_e vent
Ġ ing
R ender
.c l
ump y
Ġp et
F C
ĠA nt
Ex t
Ġchar ge
en ed
gr ad
E O
Ġdep end
Ġ .ĊĊ
fr ame
Ġd f
Ġh uge
ĠP ART
ed s
; ;
ĠA M
Ġbas ic
ĠL et
lic h
Ġar m
Ġst ar
Ġf ederal
W ork
Ġcar ry
ĠIs rael
( obj
={ {
Ġs aved
Ġs yn
Ġconst ant
V ENT
Ġpos itive
Ġcon duct
Ġsk in
Ġear lier
Ġl ayout
ĠI P
O UR
Ġt im
styles heet
_ cl
ĠC ard
++ ){Ċ
Ġtem per
ĠDav id
ĉ try
.d art
Ġwant s
Ġp icture
Ġv ideos
ĠCom m
is ions
_M AX
M apping
- content
ĠE ar
- de
Ġpre m
br uary
Ġcom ponents
Ġthrough out
Ġp ull
Ġp ages
ent e
res pond
Ġg as
cript or
Ġed ge
Ġb ound
A CT
**** **
Ġcre ating
ĠC H
Ġnull ptr
B r
+ '
.c o
> ::
Ġle arning
.L ength
_S H
Ġpat ients
A IN
Ġk ids
Ġcom fort
Ġsh own
ug ins
ĠB ack
ell a
_C L
Ġl at
Ġdis patch
Ġclass es
. at
.b egin
Ġsuccess ful
b an
Ġobt ain
ĠS l
Ġl ack
iter ator
Th read
(s ize
Ġn one
.h as
_ X
s ort
n ap
p et
b in
ĠCan ada
The y
Ġd ans
ĠM at
< td
Ġh air
Ġ' ',Ċ
Ġc u
Ġlaw s
let ed
p ed
Ġp ow
Ġk new
_C OM
_ ,
ĠM ag
id ents
( req
Ġ ),
- center
Ġw ide
ĠA uthor
st ants
Ġjob s
Ġm ath
et imes
Bo olean
Ġs cope
_ is
Ġme as
Ġkey s
el ay
Ġexact ly
'=> '
ĠP aul
m as
ĉ print
(l en
f d
Ġ) ;
. Event
q li
ir it
ield s
om an
ĠT op
Ġv ote
Ġm ask
Ġthem e
- Ċ
Ġpro ps
Ġf ine
Ġwrit er
_ offset
c ar
Ġal tern
Ġc opyright
Ġdest roy
pp er
Ġgener ate
pp ed
âĢĻ d
ĠĠĠĠĠĠ Ċ
m ake
ĠSh ow
Ġb rowser
Ġfavor ite
Ġcare er
Ġhappen ed
( char
Ġrecomm end
Ġl iter
.f ilter
gr ade
ĠÂ £
Ph one
om s
Ġn amed
- label
ip o
ĠO ther
Ġp anel
Ġro ck
S cale
ĉ assert
Ð ´
Ġtr ust
fr ont
Ġdem on
A r
N et
Ġecon omic
foot er
Ġr ace
(n ode
ĠO ption
s plit
Ġphys ical
if est
Ġrem oved
. http
)) ,Ċ
Ġlook ed
' ;
d ing
g est
atur day
/lic enses
Pr ice
Ġd ro
Ġto wards
Ġun s
ĠC L
ĉ static
Ġ rows
Ġdef ine
.re place
Ġf ather
ĠDes ign
ass ign
m ut
De vice
D id
') )Ċ
omet ry
ay load
Ġh istor
ĠP aram
ĠBo olean
Ġn ature
Ġj s
Ġn ation
i h
Ġdis cover
se m
Hand le
ĉ r
ĠTe chn
Ġw all
{ $
@ property
Ġ" ../
Ġex am
.d raw
opp ing
Ġnear ly
Ġco ol
Ġinde pend
RE S
Ġhand ler
ĠMon day
Ġs un
St yles
ous ly
Ġ ĉ
v est
D isplay
( y
atic ally
Ġpred ict
y ing
Ġsom etimes
" ]Ċ
Ġdr ink
Ġb ul
ific ations
. insert
.re g
Ġtest s
Al ignment
Ġal leg
Ġat tribute
ĠN ote
Ġmy self
art s
N ow
Ġinterest ing
li ents
Ġpop ulation
ĠCal ifornia
" I
å ¹
Ġgre ater
ues day
Ġth ous
Ġcost s
Ġla unch
\ Http
k er
b and
ĠPl ay
Ġb and
.sh ape
es ome
art icle
.r f
Ġw er
á s
em bers
us r
B A
ic an
et t
valid ate
ult i
Ġimmedi ately
z er
Ġfig ure
o es
ell er
irc le
ĠS ign
.d b
Ġr ank
By tes
Ġproject s
_re c
UL AR
A PI
ĠL ine
P ort
Ġp oll
Ġg iving
id ence
-- Ċ
Ġpl ot
ic ial
Ġw arrant
IT ION
ĠD ouble
Ġbill ion
gorith m
Ġequ ipment
D ATE
Ġ@ "
E E
Ġp le
i ation
Ġhead ers
Ġpro ced
.Component Model
ĠOb ama
Ġp a
ĠB est
im ately
.get String
. \
mp loy
Ġr aw
_b lock
und red
" },Ċ
.Group Layout
Ġb rought
NS String
th row
cre ated
.N ew
_ view
C P
ep s
O p
Ġgr atis
Ġ' "
Ġinter view
"" "Ċ
Ġpart ial
Ġa ria
b ing
A uthor
Bo ok
ĠP at
um an
Us ers
pl us
ĠD irect
ven ue
al pha
UC CESS
ĠC all
Ġ );čĊ
im ated
Ġrem ain
Ġant i
ĠL ondon
Ġsaf ety
PO SE
o les
cont roller
By te
ĠCour t
ĠPh il
ĠAss oci
en a
å IJ
_ST R
co in
resh old
Ġb atch
_C lick
entic ation
> ';Ċ
ent y
Ġbegin ning
Ġz ero
ĠCon vert
Ġt err
Ġp aid
Ġincre ased
c atch
-s ize
act ivity
e quals
Ġque ue
Ġ" '
ĠIntern ational
Ġf ür
urs day
Ġsc ient
all ow
ax is
Ġapp ropri
ed ge
Ġid x
S uccess
ent ifier
: \
x is
Ġmax imum
ark s
Ġb irth
( index
Ġmay be
.p y
file s
Ġlim ited
_ check
lo ok
pl ies
Ġmov ement
'] .
Ġbro ad
ĠB E
ĠUn ityEngine
.c pp
ĠE very
Ad min
Ġf ans
p ared
Ċ ĠĠĠĠĊ
Ġfore ign
Ġp an
Ġt our
ĠOr der
Ġmov ing
Ġa uf
C all
c b
Å Ł
vent ory
ĠS ql
Ġful ly
Click Listener
W ORD
Ġannounc ed
) čĊčĊ
Ġagre ed
ri e
Ġe arn
_l ink
. array
(t ext
Ġmaterial s
, p
ff ff
v g
ĠÂ ©
Ġun less
aj ax
LO G
Ġsex ual
Ġ\ "
- time
Ġco ach
Ġsupport ed
Ġphot os
if orm
.C reate
) ]
ri er
Ġd ialog
av er
ig e
) +
_id x
: [
_m in
ĠC ong
Ġpress ure
Ġteam s
S ign
b egin
ri an
NE SS
L S
Ġimpro ve
ĠS unday
Ġdef inition
ig er
roll ers
Ġthink ing
T emplate
- F
Ġem erg
pl ates
ĠUS A
.set State
ĠAl so
re v
Ġen able
ĠC O
PE CT
Ġcon cept
) -
ĠâĢ ¢
Ġset s
Ġmean ing
em on
ĠCon s
c mp
ed er
ann ed
icens ed
ĠS uper
Ġd aily
Ġmult i
_ u
Ġchall eng
_m ode
ĠP romise
Ġstr ict
j o
int on
( list
On ly
> {
Ġveh icle
í ķ
ĠPl ayer
ĠD el
Ġp ool
. url
nes day
();čĊ čĊ
Ġ" );Ċ
L ocal
. ");Ċ
Ġorgan ization
re nder
ĠApp lication
Ġsum mer
ex pected
N A
Ġr ap
_ obj
Ġsur face
ĠP UR
Ġ}, ĊĊ
Ġvariable s
(m essage
Ġop in
.b ack
а н
Ġwork ers
v m
C o
ught er
Ġm aster
Ġ" ",
Ġst ories
. User
Ġcele br
ines e
B S
ĠCom mand
ash board
Ġo g
k g
. image
.st yle
Ġstep s
ĠB en
( args
ĠP erson
, y
Ġofficial s
| Ċ
Ġsk ills
v c
Ġbuild er
Ġg ar
A ccount
ĠA uth
ç Ķ
'] )Ċ
ĠA T
n n
. Int
SS ERT
Ġeffect ive
LE TE
Ġto ols
AR D
Ġdig ital
D ouble
ĠF ind
R C
Ġin line
/ r
AR AM
AS K
Ġint ent
a ight
_add r
Ġrequest s
.f irst
Ġde bug
Ġsp ent
() ));Ċ
Å Ľ
Ġpr incip
Log ger
clud es
. use
Ġsur v
med ia
ĠFe bruary
ĠM ac
Ġmiss ing
Ġw ife
Ġtalk ing
ĠM ake
Ġc art
Ġloc ated
E nc
- a
ch ron
Ġc ards
Ġgu y
Ġp ers
ĠY es
ate ver
ĠA ng
ol ar
ĠE ven
Ġacc ur
ĠP ower
ĠG old
c lear
Pro cess
Ġrec ords
Ġk illed
.c lear
ĠWARRANT IES
Ġpur pose
pan el
J ECT
ÃŃ a
Ġex erc
W S
/ L
. exports
Ġ__ _
Ġs in
S ervlet
Ġd é
.de lete
ro ke
S l
ug h
ear s
Ġpoint er
Ġh op
all ery
Ġo bs
co very
ĉ char
ĉĉĉĉ ĉĉĉĉĉĉ
ĉ def
oc ity
itch en
ul ations
ĠF IT
Ġ ).
straint s
vent ion
Ġrequ ires
ĠO per
M E
OUN T
al let
Ġn orm
I RE
ex as
Ġprogram s
Ġwe ak
' .$
u ing
ĉ ĠĠĠĠĠĠĠ
Ġm il
Ġf irm
init ely
_VAL UE
ap se
atis f
Ġdem and
_m od
Ġdescri bed
Ġpl aces
V ID
Ġal one
Ġex port
Ġv ec
ĠM ax
Ġactiv ities
ict ures
g ener
Ġm a
Ĥ ¬
Ġexpress ion
C allback
_ content
ĠM ost
Ġtest ing
E C
CH ANT
Ġad just
.Th reading
( ctx
Ġag ree
ig hest
Ġu i
ĠL aw
. Y
> <?
Ġp od
-l g
âĢĿ ĊĊ
Ġdes cribe
ĠEurope an
- sh
ĠPUR POSE
OR Y
Ġcon vers
ĠI lluminate
ĠA v
( ch
? "
ch en
im a
D ocument
Ġoper ations
w in
ĉf unction
. Image
Ġsc en
/ h
ĠS C
Ġexp lo
: %
/** čĊ
N AME
æ Ī
( var
Ġdirect or
ON G
Ġy ield
Ġfe et
ĠS earch
ĠI l
Ġrest aur
du c
Ġint eger
Ġ' ';Ċ
Ġhigh ly
check ed
ĠPART IC
ER CHANT
ï¼ ī
Ġopt im
Q ueue
ĠL I
it ation
Ġtrans port
iss ion
f ill
us ion
ĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠĠĠĠĠĠĠĠĠĠĠĠĠĠ
ĉ bool
- th
u pt
Ġess ential
ant ed
Ġbenef its
ĉ S
' ;čĊ
ik i
Ġgirl s
ic ed
b uffer
] +
Ġso cket
Ġpr ices
ĠF re
Ġs at
Ġw ood
Menu Item
AR G
ĠAd min
OW N
d k
Ġres et
Ġfor ms
ĠÐ ¸
æ ĸ
ĠT uesday
ĠInitial ized
_tr ain
or ary
ateg or
Ġd t
T otal
con struct
il ies
Ġgu ys
е ÑĢ
Ġin struction
y led
Ġintern et
et adata
ad y
f aces
je ction
ĠJ ack
Ġre ct
[ -
ĠL eg
Ġdev ices
O C
Ġ* čĊ
or ation
ert ain
Ġgu ard
ost ream
Ġen um
.l ayout
Ġ" ;Ċ
vo ke
ĠO k
H ome
( tr
ET H
Ġdel ay
Ġpurch ase
d c
Ġare n
_on ce
ĉĉĉĉ Ċ
r or
d raw
.r un
(m odel
Time out
li k
ĠAr g
. en
Ġf ish
c py
_f e
ERCHANT ABILITY
( X
_ output
? ?
Ġj o
and ard
Ġd oll
error s
_b ase
ĠPARTIC ULAR
Ġle ader
Ġcomp ar
Ġd oub
ĠV is
Stack Trace
- C
ĠSt ud
stit ute
M ore
ĠD escription
W ARE
ad s
ĠÐ º
b ind
= self
em ploy
[ n
. all
- B
& &
al m
Ġcult ure
h ouse
Ġsu ffer
Ġ' %
Ġstr aight
ĠSt ar
ud o
Ġd ed
ĠC OM
Ġconf irm
ĠG ood
.s c
________ ________
D R
Config uration
Date Time
Ġad vert
Ġcould n
as ync
st ack
') čĊ
K it
Ġh ous
Ġme chan
r ate
Ġa udio
ĉc out
co res
Ġsp ot
Ġincre asing
Ġ ##
)) )
point s
Ġcomp ared
l ig
Ġbeh avior
ĠB Y
ĠAt t
c raft
head ers
et e
end region
Ġd etail
U LE
ĠCom mon
ĉ protected
st on
ĠFIT NESS
Ġf resh
"> ĊĊ
.ex ample
ber g
Ġmov ed
ĉ e
ĠS aturday
Ġpay load
Ä ĩ
) :ĊĊ
Ġbe y
ur er
< script
Ġs ymbol
Ġass um
Ġp ul
E ffect
Ġh undred
To ol
ak ed
con nection
Ġvo ice
Ġp d
Ġtrans action
Ġlink s
E rr
ĠInd ian
T C
atal og
n i
s ign
<< "
j i
y a
Ġdemon str
ul ated
. St
Ġinst it
Ġbo ost
Ġcell s
ol ic
.P ro
: </
Event Listener
ify ing
ĠD i
or row
.ex ecute
Ġcol lege
Y our
Ġlarg est
.d is
Ġqu i
Ġindividual s
_b uffer
Ġn g
S A
ĠCont rol
Ġs ing
Ġsu it
ĠĠĠĠ ĉ
S G
Ġj ump
Ġsm art
om a
ĠEx p
Ġ' -
Ġass ist
Ġsuccess fully
s ys
ĠC re
_ ref
ĠTh ursday
Ġb ur
ĠÐ ´
Ġbey ond
Ġn odes
D etails
in ct
ĠJ ames
Ġa ffect
ex ception
Ġtype of
( čĊ
- se
Ġf etch
` ,
Ġcrush er
} .
ĠB O
Sh ow
Ġr ates
Ġb on
- icon
ĠMed ia
RE SS
ĠVal id
оР»
Ġf uck
ack s
Ġstud ies
M e
Ġown ers
} else
Ġgrow ing
Var iable
ĠB el
.r andom
v ement
on ym
( F
ĠF ALSE
Ġtor ch
( row
ig o
struct ure
Ġcertain ly
D ep
ĠG reen
quest ion
Ġadd ing
ĠDe velop
_ def
Ġm ach
= %
ĉĉ Ġ
cond s
Pro ject
Ġre ject
Ġ Î
Ġpo or
Ġaw are
ĠB uild
ĠBrit ish
ĠN E
Ġnum er
re es
cl aim
Ġm ock
Ġo m
Ġs cre
OL D
. pl
el er
Ġcor respond
_ HE
Ġb inary
_ order
ĠS QL
Ġadv ant
Ġpre v
. [
.assert Equal
pl ier
ar p
Ġclos ed
Ġenc our
ĠQ String
a ud
Ġdevelop ed
Ġper mission
.de bug
oper ator
Ġ' Ċ
Ġs ym
at ively
é e
-c olor
ĠG ET
k y
Ġal though
_re quest
_e lement
........ ........
_D ATA
Ġam azing
Ġs b
ĠDef ault
Event s
Ġfail ure
ac le
Prop erties
Ġd ream
Ġdist r
Ġa u
Ġgener ated
æ ķ
ĠTe am
U SE
Ġin come
Ġey e
_n ot
" ],
_ form
S upport
ord ers
.P rint
v ille
ĠWed nesday
ol ver
Ġopp os
is ation
ol a
C lose
< p
_w idth
In valid
x b
Ġstr ugg
_ action
Ġt xt
ĠP ath
al ar
ĠM ERCHANTABILITY
s ervice
ĠMich ael
able View
De bug
ok es
S he
Ġgu ess
ĠJ ava
_P ATH
Ġparticular ly
ĠI I
Ġd omain
å¹ ´
Ġredu ce
- left
re al
Ġappe ars
Ġcom o
ĠUn it
ĠG overn
al i
alle l
ĠJ ew
_ I
Ġc os
.c olor
ĠG lobal
Ġte le
b en
_ trans
Ġreason s
Ġem b
ens ity
l ines
om in
S creen
а ÑĤ
pect s
cl ip
fo o
re nt
Ġa f
Ġd anger
il i
Download .txt
gitextract_ok9rjsar/

├── .ai/
│   ├── claude.prompt.md
│   ├── context/
│   │   └── 01-overview.md
│   └── gemini.prompt.md
├── .github/
│   ├── FUNDING.yml
│   ├── dependabot.yml
│   └── workflows/
│       ├── tests.yml
│       └── typos.yml
├── .gitignore
├── LICENSE.md
├── README-ja.md
├── README.md
├── XTI_hijack.py
├── _typos.toml
├── anima_minimal_inference.py
├── anima_train.py
├── anima_train_network.py
├── bitsandbytes_windows/
│   ├── cextension.py
│   └── main.py
├── configs/
│   ├── qwen3_06b/
│   │   ├── config.json
│   │   ├── merges.txt
│   │   ├── tokenizer.json
│   │   ├── tokenizer_config.json
│   │   └── vocab.json
│   └── t5_old/
│       ├── config.json
│       ├── spiece.model
│       └── tokenizer.json
├── docs/
│   ├── anima_train_network.md
│   ├── config_README-en.md
│   ├── config_README-ja.md
│   ├── fine_tune.md
│   ├── fine_tune_README_ja.md
│   ├── flux_train_network.md
│   ├── gen_img_README-ja.md
│   ├── gen_img_README.md
│   ├── hunyuan_image_train_network.md
│   ├── lumina_train_network.md
│   ├── masked_loss_README-ja.md
│   ├── masked_loss_README.md
│   ├── sd3_train_network.md
│   ├── sdxl_train_network.md
│   ├── train_README-ja.md
│   ├── train_README-zh.md
│   ├── train_SDXL-en.md
│   ├── train_db_README-ja.md
│   ├── train_db_README-zh.md
│   ├── train_lllite_README-ja.md
│   ├── train_lllite_README.md
│   ├── train_network.md
│   ├── train_network_README-ja.md
│   ├── train_network_README-zh.md
│   ├── train_network_advanced.md
│   ├── train_textual_inversion.md
│   ├── train_ti_README-ja.md
│   ├── validation.md
│   ├── wd14_tagger_README-en.md
│   └── wd14_tagger_README-ja.md
├── fine_tune.py
├── finetune/
│   ├── blip/
│   │   ├── blip.py
│   │   ├── med.py
│   │   ├── med_config.json
│   │   └── vit.py
│   ├── clean_captions_and_tags.py
│   ├── hypernetwork_nai.py
│   ├── make_captions.py
│   ├── make_captions_by_git.py
│   ├── merge_captions_to_metadata.py
│   ├── merge_dd_tags_to_metadata.py
│   ├── prepare_buckets_latents.py
│   └── tag_images_by_wd14_tagger.py
├── flux_minimal_inference.py
├── flux_train.py
├── flux_train_control_net.py
├── flux_train_network.py
├── gen_img.py
├── gen_img_diffusers.py
├── hunyuan_image_minimal_inference.py
├── hunyuan_image_train_network.py
├── library/
│   ├── __init__.py
│   ├── adafactor_fused.py
│   ├── anima_models.py
│   ├── anima_train_utils.py
│   ├── anima_utils.py
│   ├── attention.py
│   ├── attention_processors.py
│   ├── chroma_models.py
│   ├── config_util.py
│   ├── custom_offloading_utils.py
│   ├── custom_train_functions.py
│   ├── deepspeed_utils.py
│   ├── device_utils.py
│   ├── flux_models.py
│   ├── flux_train_utils.py
│   ├── flux_utils.py
│   ├── fp8_optimization_utils.py
│   ├── huggingface_util.py
│   ├── hunyuan_image_models.py
│   ├── hunyuan_image_modules.py
│   ├── hunyuan_image_text_encoder.py
│   ├── hunyuan_image_utils.py
│   ├── hunyuan_image_vae.py
│   ├── hypernetwork.py
│   ├── ipex/
│   │   ├── __init__.py
│   │   ├── attention.py
│   │   ├── diffusers.py
│   │   └── hijacks.py
│   ├── jpeg_xl_util.py
│   ├── lora_utils.py
│   ├── lpw_stable_diffusion.py
│   ├── lumina_models.py
│   ├── lumina_train_util.py
│   ├── lumina_util.py
│   ├── model_util.py
│   ├── original_unet.py
│   ├── qwen_image_autoencoder_kl.py
│   ├── safetensors_utils.py
│   ├── sai_model_spec.py
│   ├── sd3_models.py
│   ├── sd3_train_utils.py
│   ├── sd3_utils.py
│   ├── sdxl_lpw_stable_diffusion.py
│   ├── sdxl_model_util.py
│   ├── sdxl_original_control_net.py
│   ├── sdxl_original_unet.py
│   ├── sdxl_train_util.py
│   ├── slicing_vae.py
│   ├── strategy_anima.py
│   ├── strategy_base.py
│   ├── strategy_flux.py
│   ├── strategy_hunyuan_image.py
│   ├── strategy_lumina.py
│   ├── strategy_sd.py
│   ├── strategy_sd3.py
│   ├── strategy_sdxl.py
│   ├── train_util.py
│   └── utils.py
├── lumina_minimal_inference.py
├── lumina_train.py
├── lumina_train_network.py
├── networks/
│   ├── check_lora_weights.py
│   ├── control_net_lllite.py
│   ├── control_net_lllite_for_train.py
│   ├── convert_anima_lora_to_comfy.py
│   ├── convert_flux_lora.py
│   ├── convert_hunyuan_image_lora_to_comfy.py
│   ├── dylora.py
│   ├── extract_lora_from_dylora.py
│   ├── extract_lora_from_models.py
│   ├── flux_extract_lora.py
│   ├── flux_merge_lora.py
│   ├── lora.py
│   ├── lora_anima.py
│   ├── lora_diffusers.py
│   ├── lora_fa.py
│   ├── lora_flux.py
│   ├── lora_hunyuan_image.py
│   ├── lora_interrogator.py
│   ├── lora_lumina.py
│   ├── lora_sd3.py
│   ├── merge_lora.py
│   ├── merge_lora_old.py
│   ├── oft.py
│   ├── oft_flux.py
│   ├── resize_lora.py
│   ├── sdxl_merge_lora.py
│   └── svd_merge_lora.py
├── pytest.ini
├── pytorch_lightning/
│   ├── __init__.py
│   └── callbacks/
│       ├── __init__.py
│       └── model_checkpoint.py
├── requirements.txt
├── sd3_minimal_inference.py
├── sd3_train.py
├── sd3_train_network.py
├── sdxl_gen_img.py
├── sdxl_minimal_inference.py
├── sdxl_train.py
├── sdxl_train_control_net.py
├── sdxl_train_control_net_lllite.py
├── sdxl_train_control_net_lllite_old.py
├── sdxl_train_network.py
├── sdxl_train_textual_inversion.py
├── setup.py
├── tests/
│   ├── README.md
│   ├── library/
│   │   ├── test_flux_train_utils.py
│   │   ├── test_lumina_models.py
│   │   ├── test_lumina_train_util.py
│   │   ├── test_lumina_util.py
│   │   ├── test_sai_model_spec.py
│   │   └── test_strategy_lumina.py
│   ├── manual_test_anima_cache.py
│   ├── manual_test_anima_real_training.py
│   ├── test_custom_offloading_utils.py
│   ├── test_fine_tune.py
│   ├── test_flux_train.py
│   ├── test_flux_train_network.py
│   ├── test_lumina_train_network.py
│   ├── test_optimizer.py
│   ├── test_sd3_train.py
│   ├── test_sd3_train_network.py
│   ├── test_sdxl_train.py
│   ├── test_sdxl_train_network.py
│   ├── test_train.py
│   ├── test_train_network.py
│   ├── test_train_textual_inversion.py
│   └── test_validation.py
├── tools/
│   ├── cache_latents.py
│   ├── cache_text_encoder_outputs.py
│   ├── canny.py
│   ├── convert_diffusers20_original_sd.py
│   ├── convert_diffusers_to_flux.py
│   ├── detect_face_rotate.py
│   ├── latent_upscaler.py
│   ├── merge_models.py
│   ├── merge_sd3_safetensors.py
│   ├── original_control_net.py
│   ├── resize_images_to_resolution.py
│   └── show_metadata.py
├── train_control_net.py
├── train_controlnet.py
├── train_db.py
├── train_network.py
├── train_textual_inversion.py
└── train_textual_inversion_XTI.py
Download .txt
Showing preview only (241K chars total). Download the full file or copy to clipboard to get everything.
SYMBOL INDEX (2802 symbols across 163 files)

FILE: XTI_hijack.py
  function unet_forward_XTI (line 11) | def unet_forward_XTI(
  function downblock_forward_XTI (line 126) | def downblock_forward_XTI(
  function upblock_forward_XTI (line 164) | def upblock_forward_XTI(

FILE: anima_minimal_inference.py
  class GenerationSettings (line 34) | class GenerationSettings:
    method __init__ (line 35) | def __init__(self, device: torch.device, dit_weight_dtype: Optional[to...
  function parse_args (line 40) | def parse_args() -> argparse.Namespace:
  function parse_prompt_line (line 136) | def parse_prompt_line(line: str) -> Dict[str, Any]:
  function apply_overrides (line 177) | def apply_overrides(args: argparse.Namespace, overrides: Dict[str, Any])...
  function check_inputs (line 200) | def check_inputs(args: argparse.Namespace) -> Tuple[int, int]:
  function load_dit_model (line 221) | def load_dit_model(
  function load_text_encoder (line 288) | def load_text_encoder(
  function decode_latent (line 313) | def decode_latent(
  function process_escape (line 332) | def process_escape(text: str) -> str:
  function prepare_text_inputs (line 344) | def prepare_text_inputs(
  function generate (line 458) | def generate(
  function generate_body (line 504) | def generate_body(
  function get_time_flag (line 579) | def get_time_flag():
  function save_latent (line 583) | def save_latent(latent: torch.Tensor, args: argparse.Namespace, height: ...
  function save_images (line 625) | def save_images(sample: torch.Tensor, args: argparse.Namespace, original...
  function save_output (line 656) | def save_output(
  function preprocess_prompts_for_batch (line 708) | def preprocess_prompts_for_batch(prompt_lines: List[str], base_args: arg...
  function load_shared_models (line 733) | def load_shared_models(args: argparse.Namespace) -> Dict:
  function process_batch_prompts (line 752) | def process_batch_prompts(prompts_data: List[Dict], args: argparse.Names...
  function process_interactive (line 882) | def process_interactive(args: argparse.Namespace) -> None:
  function get_generation_settings (line 951) | def get_generation_settings(args: argparse.Namespace) -> GenerationSetti...
  function main (line 966) | def main():

FILE: anima_train.py
  function train (line 43) | def train(args):
  function setup_parser (line 712) | def setup_parser() -> argparse.ArgumentParser:

FILE: anima_train_network.py
  class AnimaNetworkTrainer (line 33) | class AnimaNetworkTrainer(train_network.NetworkTrainer):
    method __init__ (line 34) | def __init__(self):
    method assert_extra_args (line 38) | def assert_extra_args(
    method load_target_model (line 82) | def load_target_model(self, args, weight_dtype, accelerator):
    method load_unet_lazily (line 101) | def load_unet_lazily(self, args, weight_dtype, accelerator, text_encod...
    method get_tokenize_strategy (line 136) | def get_tokenize_strategy(self, args):
    method get_tokenizers (line 146) | def get_tokenizers(self, tokenize_strategy: strategy_anima.AnimaTokeni...
    method get_latents_caching_strategy (line 149) | def get_latents_caching_strategy(self, args):
    method get_text_encoding_strategy (line 152) | def get_text_encoding_strategy(self, args):
    method post_process_network (line 155) | def post_process_network(self, args, accelerator, network, text_encode...
    method get_models_for_text_encoding (line 158) | def get_models_for_text_encoding(self, args, accelerator, text_encoders):
    method get_text_encoder_outputs_caching_strategy (line 163) | def get_text_encoder_outputs_caching_strategy(self, args):
    method cache_text_encoder_outputs_if_needed (line 170) | def cache_text_encoder_outputs_if_needed(
    method sample_images (line 222) | def sample_images(self, accelerator, args, epoch, global_step, device,...
    method get_noise_scheduler (line 242) | def get_noise_scheduler(self, args: argparse.Namespace, device: torch....
    method encode_images_to_latents (line 246) | def encode_images_to_latents(self, args, vae, images):
    method shift_scale_latents (line 250) | def shift_scale_latents(self, args, latents):
    method get_noise_pred_and_target (line 254) | def get_noise_pred_and_target(
    method process_batch (line 325) | def process_batch(
    method post_process_loss (line 376) | def post_process_loss(self, loss, args, timesteps, noise_scheduler):
    method get_sai_model_spec (line 379) | def get_sai_model_spec(self, args):
    method update_metadata (line 382) | def update_metadata(self, metadata, args):
    method is_text_encoder_not_needed_for_training (line 391) | def is_text_encoder_not_needed_for_training(self, args):
    method prepare_text_encoder_grad_ckpt_workaround (line 394) | def prepare_text_encoder_grad_ckpt_workaround(self, index, text_encoder):
    method prepare_unet_with_accelerator (line 399) | def prepare_unet_with_accelerator(
    method on_validation_step_end (line 417) | def on_validation_step_end(self, args, accelerator, network, text_enco...
  function setup_parser (line 423) | def setup_parser() -> argparse.ArgumentParser:

FILE: bitsandbytes_windows/cextension.py
  class CUDALibrary_Singleton (line 8) | class CUDALibrary_Singleton(object):
    method __init__ (line 11) | def __init__(self):
    method initialize (line 14) | def initialize(self):
    method get_instance (line 36) | def get_instance(cls):

FILE: bitsandbytes_windows/main.py
  function check_cuda_result (line 24) | def check_cuda_result(cuda, result_val):
  function get_cuda_version (line 31) | def get_cuda_version(cuda, cudart_path):
  function get_cuda_lib_handle (line 52) | def get_cuda_lib_handle():
  function get_compute_capabilities (line 65) | def get_compute_capabilities(cuda):
  function get_compute_capability (line 99) | def get_compute_capability(cuda):
  function evaluate_cuda_setup (line 112) | def evaluate_cuda_setup():

FILE: fine_tune.py
  function train (line 46) | def train(args):
  function setup_parser (line 518) | def setup_parser() -> argparse.ArgumentParser:

FILE: finetune/blip/blip.py
  class BLIP_Base (line 29) | class BLIP_Base(nn.Module):
    method __init__ (line 30) | def __init__(self,
    method forward (line 52) | def forward(self, image, caption, mode):
  class BLIP_Decoder (line 84) | class BLIP_Decoder(nn.Module):
    method __init__ (line 85) | def __init__(self,
    method forward (line 111) | def forward(self, image, caption):
    method generate (line 134) | def generate(self, image, sample=False, num_beams=3, max_length=30, mi...
  function blip_decoder (line 179) | def blip_decoder(pretrained='',**kwargs):
  function blip_feature_extractor (line 186) | def blip_feature_extractor(pretrained='',**kwargs):
  function init_tokenizer (line 193) | def init_tokenizer():
  function create_vit (line 201) | def create_vit(vit, image_size, use_grad_checkpointing=False, ckpt_layer...
  function is_url (line 218) | def is_url(url_or_filename):
  function load_checkpoint (line 222) | def load_checkpoint(model,url_or_filename):

FILE: finetune/blip/med.py
  class BertEmbeddings (line 52) | class BertEmbeddings(nn.Module):
    method __init__ (line 55) | def __init__(self, config):
    method forward (line 71) | def forward(
  class BertSelfAttention (line 97) | class BertSelfAttention(nn.Module):
    method __init__ (line 98) | def __init__(self, config, is_cross_attention):
    method save_attn_gradients (line 126) | def save_attn_gradients(self, attn_gradients):
    method get_attn_gradients (line 129) | def get_attn_gradients(self):
    method save_attention_map (line 132) | def save_attention_map(self, attention_map):
    method get_attention_map (line 135) | def get_attention_map(self):
    method transpose_for_scores (line 138) | def transpose_for_scores(self, x):
    method forward (line 143) | def forward(
  class BertSelfOutput (line 228) | class BertSelfOutput(nn.Module):
    method __init__ (line 229) | def __init__(self, config):
    method forward (line 235) | def forward(self, hidden_states, input_tensor):
  class BertAttention (line 242) | class BertAttention(nn.Module):
    method __init__ (line 243) | def __init__(self, config, is_cross_attention=False):
    method prune_heads (line 249) | def prune_heads(self, heads):
    method forward (line 267) | def forward(
  class BertIntermediate (line 291) | class BertIntermediate(nn.Module):
    method __init__ (line 292) | def __init__(self, config):
    method forward (line 300) | def forward(self, hidden_states):
  class BertOutput (line 306) | class BertOutput(nn.Module):
    method __init__ (line 307) | def __init__(self, config):
    method forward (line 313) | def forward(self, hidden_states, input_tensor):
  class BertLayer (line 320) | class BertLayer(nn.Module):
    method __init__ (line 321) | def __init__(self, config, layer_num):
    method forward (line 333) | def forward(
    method feed_forward_chunk (line 380) | def feed_forward_chunk(self, attention_output):
  class BertEncoder (line 386) | class BertEncoder(nn.Module):
    method __init__ (line 387) | def __init__(self, config):
    method forward (line 393) | def forward(
  class BertPooler (line 486) | class BertPooler(nn.Module):
    method __init__ (line 487) | def __init__(self, config):
    method forward (line 492) | def forward(self, hidden_states):
  class BertPredictionHeadTransform (line 501) | class BertPredictionHeadTransform(nn.Module):
    method __init__ (line 502) | def __init__(self, config):
    method forward (line 511) | def forward(self, hidden_states):
  class BertLMPredictionHead (line 518) | class BertLMPredictionHead(nn.Module):
    method __init__ (line 519) | def __init__(self, config):
    method forward (line 532) | def forward(self, hidden_states):
  class BertOnlyMLMHead (line 538) | class BertOnlyMLMHead(nn.Module):
    method __init__ (line 539) | def __init__(self, config):
    method forward (line 543) | def forward(self, sequence_output):
  class BertPreTrainedModel (line 548) | class BertPreTrainedModel(PreTrainedModel):
    method _init_weights (line 558) | def _init_weights(self, module):
  class BertModel (line 571) | class BertModel(BertPreTrainedModel):
    method __init__ (line 581) | def __init__(self, config, add_pooling_layer=True):
    method get_input_embeddings (line 594) | def get_input_embeddings(self):
    method set_input_embeddings (line 597) | def set_input_embeddings(self, value):
    method _prune_heads (line 600) | def _prune_heads(self, heads_to_prune):
    method get_extended_attention_mask (line 609) | def get_extended_attention_mask(self, attention_mask: Tensor, input_sh...
    method forward (line 670) | def forward(
  class BertLMHeadModel (line 811) | class BertLMHeadModel(BertPreTrainedModel):
    method __init__ (line 816) | def __init__(self, config):
    method get_output_embeddings (line 824) | def get_output_embeddings(self):
    method set_output_embeddings (line 827) | def set_output_embeddings(self, new_embeddings):
    method forward (line 830) | def forward(
    method prepare_inputs_for_generation (line 932) | def prepare_inputs_for_generation(self, input_ids, past=None, attentio...
    method _reorder_cache (line 951) | def _reorder_cache(self, past, beam_idx):

FILE: finetune/blip/vit.py
  class Mlp (line 23) | class Mlp(nn.Module):
    method __init__ (line 26) | def __init__(self, in_features, hidden_features=None, out_features=Non...
    method forward (line 35) | def forward(self, x):
  class Attention (line 44) | class Attention(nn.Module):
    method __init__ (line 45) | def __init__(self, dim, num_heads=8, qkv_bias=False, qk_scale=None, at...
    method save_attn_gradients (line 58) | def save_attn_gradients(self, attn_gradients):
    method get_attn_gradients (line 61) | def get_attn_gradients(self):
    method save_attention_map (line 64) | def save_attention_map(self, attention_map):
    method get_attention_map (line 67) | def get_attention_map(self):
    method forward (line 70) | def forward(self, x, register_hook=False):
  class Block (line 89) | class Block(nn.Module):
    method __init__ (line 91) | def __init__(self, dim, num_heads, mlp_ratio=4., qkv_bias=False, qk_sc...
    method forward (line 107) | def forward(self, x, register_hook=False):
  class VisionTransformer (line 113) | class VisionTransformer(nn.Module):
    method __init__ (line 118) | def __init__(self, img_size=224, patch_size=16, in_chans=3, num_classe...
    method _init_weights (line 167) | def _init_weights(self, m):
    method no_weight_decay (line 177) | def no_weight_decay(self):
    method forward (line 180) | def forward(self, x, register_blk=-1):
    method load_pretrained (line 197) | def load_pretrained(self, checkpoint_path, prefix=''):
  function _load_weights (line 202) | def _load_weights(model: VisionTransformer, checkpoint_path: str, prefix...
  function interpolate_pos_embed (line 281) | def interpolate_pos_embed(pos_embed_checkpoint, visual_encoder):

FILE: finetune/clean_captions_and_tags.py
  function clean_tags (line 33) | def clean_tags(image_key, tags):
  function clean_caption (line 119) | def clean_caption(caption):
  function main (line 129) | def main(args):
  function setup_parser (line 170) | def setup_parser() -> argparse.ArgumentParser:

FILE: finetune/hypernetwork_nai.py
  class HypernetworkModule (line 6) | class HypernetworkModule(torch.nn.Module):
    method __init__ (line 7) | def __init__(self, dim, multiplier=1.0):
    method forward (line 21) | def forward(self, x):
  class Hypernetwork (line 25) | class Hypernetwork(torch.nn.Module):
    method __init__ (line 29) | def __init__(self, multiplier=1.0) -> None:
    method apply_to_stable_diffusion (line 37) | def apply_to_stable_diffusion(self, text_encoder, vae, unet):
    method apply_to_diffusers (line 50) | def apply_to_diffusers(self, text_encoder, vae, unet):
    method forward (line 65) | def forward(self, x, context):
    method load_from_state_dict (line 71) | def load_from_state_dict(self, state_dict):
    method get_state_dict (line 90) | def get_state_dict(self):

FILE: finetune/make_captions.py
  class ImageLoadingTransformDataset (line 43) | class ImageLoadingTransformDataset(torch.utils.data.Dataset):
    method __init__ (line 44) | def __init__(self, image_paths):
    method __len__ (line 47) | def __len__(self):
    method __getitem__ (line 50) | def __getitem__(self, idx):
  function collate_fn_remove_corrupted (line 64) | def collate_fn_remove_corrupted(batch):
  function main (line 74) | def main(args):
  function setup_parser (line 162) | def setup_parser() -> argparse.ArgumentParser:

FILE: finetune/make_captions_by_git.py
  function remove_words (line 38) | def remove_words(captions, debug):
  function collate_fn_remove_corrupted (line 51) | def collate_fn_remove_corrupted(batch):
  function main (line 61) | def main(args):
  function setup_parser (line 150) | def setup_parser() -> argparse.ArgumentParser:

FILE: finetune/merge_captions_to_metadata.py
  function main (line 16) | def main(args):
  function setup_parser (line 58) | def setup_parser() -> argparse.ArgumentParser:

FILE: finetune/merge_dd_tags_to_metadata.py
  function main (line 16) | def main(args):
  function setup_parser (line 59) | def setup_parser() -> argparse.ArgumentParser:

FILE: finetune/prepare_buckets_latents.py
  function collate_fn_remove_corrupted (line 38) | def collate_fn_remove_corrupted(batch):
  function get_npz_filename (line 48) | def get_npz_filename(data_dir, image_key, is_full_path, recursive):
  function main (line 62) | def main(args):
  function setup_parser (line 210) | def setup_parser() -> argparse.ArgumentParser:

FILE: finetune/tag_images_by_wd14_tagger.py
  function preprocess_image (line 37) | def preprocess_image(image: Image.Image) -> np.ndarray:
  class ImageLoadingPrepDataset (line 67) | class ImageLoadingPrepDataset(torch.utils.data.Dataset):
    method __init__ (line 68) | def __init__(self, image_paths: list[str], batch_size: int):
    method __len__ (line 72) | def __len__(self):
    method __getitem__ (line 75) | def __getitem__(self, batch_index: int) -> tuple[str, np.ndarray, tupl...
  function collate_fn_no_op (line 100) | def collate_fn_no_op(batch):
  function main (line 105) | def main(args):
  function setup_parser (line 602) | def setup_parser() -> argparse.ArgumentParser:

FILE: flux_minimal_inference.py
  function time_shift (line 37) | def time_shift(mu: float, sigma: float, t: torch.Tensor):
  function get_lin_function (line 41) | def get_lin_function(x1: float = 256, y1: float = 0.5, x2: float = 4096,...
  function get_schedule (line 47) | def get_schedule(
  function denoise (line 66) | def denoise(
  function do_sample (line 140) | def do_sample(
  function generate_image (line 201) | def generate_image(
  function is_fp8 (line 437) | def is_fp8(dt):

FILE: flux_train.py
  function train (line 55) | def train(args):
  function setup_parser (line 785) | def setup_parser() -> argparse.ArgumentParser:

FILE: flux_train_control_net.py
  function train (line 61) | def train(args):
  function setup_parser (line 819) | def setup_parser() -> argparse.ArgumentParser:

FILE: flux_train_network.py
  class FluxNetworkTrainer (line 32) | class FluxNetworkTrainer(train_network.NetworkTrainer):
    method __init__ (line 33) | def __init__(self):
    method assert_extra_args (line 40) | def assert_extra_args(
    method load_target_model (line 99) | def load_target_model(self, args, weight_dtype, accelerator):
    method get_tokenize_strategy (line 162) | def get_tokenize_strategy(self, args):
    method get_tokenizers (line 182) | def get_tokenizers(self, tokenize_strategy: strategy_flux.FluxTokenize...
    method get_latents_caching_strategy (line 185) | def get_latents_caching_strategy(self, args):
    method get_text_encoding_strategy (line 189) | def get_text_encoding_strategy(self, args):
    method post_process_network (line 192) | def post_process_network(self, args, accelerator, network, text_encode...
    method get_models_for_text_encoding (line 201) | def get_models_for_text_encoding(self, args, accelerator, text_encoders):
    method get_text_encoders_train_flags (line 210) | def get_text_encoders_train_flags(self, args, text_encoders):
    method get_text_encoder_outputs_caching_strategy (line 213) | def get_text_encoder_outputs_caching_strategy(self, args):
    method cache_text_encoder_outputs_if_needed (line 226) | def cache_text_encoder_outputs_if_needed(
    method sample_images (line 293) | def sample_images(self, accelerator, args, epoch, global_step, device,...
    method get_noise_scheduler (line 301) | def get_noise_scheduler(self, args: argparse.Namespace, device: torch....
    method encode_images_to_latents (line 306) | def encode_images_to_latents(self, args, vae, images):
    method shift_scale_latents (line 309) | def shift_scale_latents(self, args, latents):
    method get_noise_pred_and_target (line 312) | def get_noise_pred_and_target(
    method post_process_loss (line 436) | def post_process_loss(self, loss, args, timesteps, noise_scheduler):
    method get_sai_model_spec (line 439) | def get_sai_model_spec(self, args):
    method update_metadata (line 446) | def update_metadata(self, metadata, args):
    method is_text_encoder_not_needed_for_training (line 459) | def is_text_encoder_not_needed_for_training(self, args):
    method prepare_text_encoder_grad_ckpt_workaround (line 462) | def prepare_text_encoder_grad_ckpt_workaround(self, index, text_encoder):
    method prepare_text_encoder_fp8 (line 468) | def prepare_text_encoder_fp8(self, index, text_encoder, te_weight_dtyp...
    method on_validation_step_end (line 503) | def on_validation_step_end(self, args, accelerator, network, text_enco...
    method prepare_unet_with_accelerator (line 508) | def prepare_unet_with_accelerator(
  function setup_parser (line 523) | def setup_parser() -> argparse.ArgumentParser:

FILE: gen_img.py
  function replace_unet_modules (line 94) | def replace_unet_modules(unet, mem_eff_attn, xformers, sdpa):
  function replace_vae_modules (line 115) | def replace_vae_modules(vae: diffusers.models.AutoencoderKL, mem_eff_att...
  function replace_vae_attn_to_memory_efficient (line 125) | def replace_vae_attn_to_memory_efficient():
  function replace_vae_attn_to_xformers (line 181) | def replace_vae_attn_to_xformers():
  function replace_vae_attn_to_sdpa (line 237) | def replace_vae_attn_to_sdpa():
  class PipelineLike (line 298) | class PipelineLike:
    method __init__ (line 299) | def __init__(
    method add_token_replacement (line 366) | def add_token_replacement(self, text_encoder_index, target_token_id, r...
    method set_enable_control_net (line 369) | def set_enable_control_net(self, en: bool):
    method get_token_replacer (line 372) | def get_token_replacer(self, tokenizer):
    method set_control_nets (line 392) | def set_control_nets(self, ctrl_nets):
    method set_control_net_lllites (line 395) | def set_control_net_lllites(self, ctrl_net_lllites):
    method set_gradual_latent (line 398) | def set_gradual_latent(self, gradual_latent):
    method __call__ (line 407) | def __call__(
  function parse_prompt_attention (line 962) | def parse_prompt_attention(text):
  function get_prompts_with_weights (line 1051) | def get_prompts_with_weights(tokenizer: CLIPTokenizer, token_replacer, p...
  function pad_tokens_and_weights (line 1102) | def pad_tokens_and_weights(tokens, weights, max_length, bos, eos, pad, n...
  function get_unweighted_text_embeddings (line 1127) | def get_unweighted_text_embeddings(
  function get_weighted_text_embeddings (line 1194) | def get_weighted_text_embeddings(
  function preprocess_image (line 1338) | def preprocess_image(image):
  function preprocess_mask (line 1348) | def preprocess_mask(mask):
  function handle_dynamic_prompt_variants (line 1372) | def handle_dynamic_prompt_variants(prompt, repeat_count, seed_random, se...
  class BatchDataBase (line 1553) | class BatchDataBase(NamedTuple):
  class BatchDataExt (line 1567) | class BatchDataExt(NamedTuple):
  class BatchData (line 1585) | class BatchData(NamedTuple):
  class ListPrompter (line 1591) | class ListPrompter:
    method __init__ (line 1592) | def __init__(self, prompts: List[str]):
    method shuffle (line 1596) | def shuffle(self):
    method __len__ (line 1599) | def __len__(self):
    method __call__ (line 1602) | def __call__(self, *args, **kwargs):
  function main (line 1612) | def main(args):
  function setup_parser (line 3118) | def setup_parser() -> argparse.ArgumentParser:

FILE: gen_img_diffusers.py
  function replace_unet_modules (line 146) | def replace_unet_modules(unet: diffusers.models.unet_2d_condition.UNet2D...
  function replace_vae_modules (line 167) | def replace_vae_modules(vae: diffusers.models.AutoencoderKL, mem_eff_att...
  function replace_vae_attn_to_memory_efficient (line 176) | def replace_vae_attn_to_memory_efficient():
  function replace_vae_attn_to_xformers (line 232) | def replace_vae_attn_to_xformers():
  function replace_vae_attn_to_sdpa (line 288) | def replace_vae_attn_to_sdpa():
  class PipelineLike (line 349) | class PipelineLike:
    method __init__ (line 376) | def __init__(
    method add_token_replacement (line 461) | def add_token_replacement(self, target_token_id, rep_token_ids):
    method set_enable_control_net (line 464) | def set_enable_control_net(self, en: bool):
    method replace_token (line 467) | def replace_token(self, tokens, layer=None):
    method add_token_replacement_XTI (line 484) | def add_token_replacement_XTI(self, target_token_id, rep_token_ids):
    method set_control_nets (line 487) | def set_control_nets(self, ctrl_nets):
    method set_gradual_latent (line 490) | def set_gradual_latent(self, gradual_latent):
    method enable_xformers_memory_efficient_attention (line 500) | def enable_xformers_memory_efficient_attention(self):
    method disable_xformers_memory_efficient_attention (line 510) | def disable_xformers_memory_efficient_attention(self):
    method enable_attention_slicing (line 516) | def enable_attention_slicing(self, slice_size: Optional[Union[str, int...
    method disable_attention_slicing (line 533) | def disable_attention_slicing(self):
    method enable_sequential_cpu_offload (line 541) | def enable_sequential_cpu_offload(self):
    method __call__ (line 563) | def __call__(
    method text2img (line 1139) | def text2img(
    method img2img (line 1231) | def img2img(
    method inpaint (line 1322) | def inpaint(
    method cond_fn (line 1423) | def cond_fn(
    method cond_fn1 (line 1464) | def cond_fn1(
    method cond_fn_vgg16 (line 1534) | def cond_fn_vgg16(self, latents, timestep, index, text_embeddings, noi...
    method cond_fn_vgg16_b1 (line 1557) | def cond_fn_vgg16_b1(self, latents, timestep, index, text_embeddings, ...
  class MakeCutouts (line 1607) | class MakeCutouts(torch.nn.Module):
    method __init__ (line 1608) | def __init__(self, cut_size, cut_power=1.0):
    method forward (line 1614) | def forward(self, pixel_values, num_cutouts):
  function spherical_dist_loss (line 1628) | def spherical_dist_loss(x, y):
  function parse_prompt_attention (line 1654) | def parse_prompt_attention(text):
  function get_prompts_with_weights (line 1743) | def get_prompts_with_weights(pipe: PipelineLike, prompt: List[str], max_...
  function pad_tokens_and_weights (line 1794) | def pad_tokens_and_weights(tokens, weights, max_length, bos, eos, pad, n...
  function get_unweighted_text_embeddings (line 1819) | def get_unweighted_text_embeddings(
  function get_weighted_text_embeddings (line 1880) | def get_weighted_text_embeddings(
  function preprocess_guide_image (line 2024) | def preprocess_guide_image(image):
  function preprocess_vgg16_guide_image (line 2033) | def preprocess_vgg16_guide_image(image, size):
  function preprocess_image (line 2041) | def preprocess_image(image):
  function preprocess_mask (line 2051) | def preprocess_mask(mask):
  function handle_dynamic_prompt_variants (line 2075) | def handle_dynamic_prompt_variants(prompt, repeat_count):
  class BatchDataBase (line 2177) | class BatchDataBase(NamedTuple):
  class BatchDataExt (line 2190) | class BatchDataExt(NamedTuple):
  class BatchData (line 2202) | class BatchData(NamedTuple):
  function main (line 2208) | def main(args):
  function setup_parser (line 3489) | def setup_parser() -> argparse.ArgumentParser:

FILE: hunyuan_image_minimal_inference.py
  class GenerationSettings (line 41) | class GenerationSettings:
    method __init__ (line 42) | def __init__(self, device: torch.device, dit_weight_dtype: Optional[to...
  function parse_args (line 47) | def parse_args() -> argparse.Namespace:
  function parse_prompt_line (line 169) | def parse_prompt_line(line: str) -> Dict[str, Any]:
  function apply_overrides (line 219) | def apply_overrides(args: argparse.Namespace, overrides: Dict[str, Any])...
  function check_inputs (line 242) | def check_inputs(args: argparse.Namespace) -> Tuple[int, int]:
  function load_dit_model (line 263) | def load_dit_model(
  function merge_lora_weights (line 374) | def merge_lora_weights(
  function decode_latent (line 464) | def decode_latent(vae: HunyuanVAE2D, latent: torch.Tensor, device: torch...
  function prepare_text_inputs (line 478) | def prepare_text_inputs(
  function generate (line 603) | def generate(
  function generate_body (line 655) | def generate_body(
  function get_time_flag (line 765) | def get_time_flag():
  function save_latent (line 769) | def save_latent(latent: torch.Tensor, args: argparse.Namespace, height: ...
  function save_images (line 811) | def save_images(sample: torch.Tensor, args: argparse.Namespace, original...
  function save_output (line 842) | def save_output(
  function preprocess_prompts_for_batch (line 890) | def preprocess_prompts_for_batch(prompt_lines: List[str], base_args: arg...
  function load_shared_models (line 915) | def load_shared_models(args: argparse.Namespace) -> Dict:
  function process_batch_prompts (line 942) | def process_batch_prompts(prompts_data: List[Dict], args: argparse.Names...
  function process_interactive (line 1086) | def process_interactive(args: argparse.Namespace) -> None:
  function get_generation_settings (line 1155) | def get_generation_settings(args: argparse.Namespace) -> GenerationSetti...
  function main (line 1170) | def main():

FILE: hunyuan_image_train_network.py
  function sample_images (line 44) | def sample_images(
  function sample_image_inference (line 147) | def sample_image_inference(
  class HunyuanImageNetworkTrainer (line 309) | class HunyuanImageNetworkTrainer(train_network.NetworkTrainer):
    method __init__ (line 310) | def __init__(self):
    method assert_extra_args (line 316) | def assert_extra_args(
    method load_target_model (line 356) | def load_target_model(self, args, weight_dtype, accelerator):
    method load_unet_lazily (line 377) | def load_unet_lazily(self, args, weight_dtype, accelerator, text_encod...
    method get_tokenize_strategy (line 413) | def get_tokenize_strategy(self, args):
    method get_tokenizers (line 416) | def get_tokenizers(self, tokenize_strategy: strategy_hunyuan_image.Hun...
    method get_latents_caching_strategy (line 419) | def get_latents_caching_strategy(self, args):
    method get_text_encoding_strategy (line 422) | def get_text_encoding_strategy(self, args):
    method post_process_network (line 425) | def post_process_network(self, args, accelerator, network, text_encode...
    method get_models_for_text_encoding (line 428) | def get_models_for_text_encoding(self, args, accelerator, text_encoders):
    method get_text_encoders_train_flags (line 434) | def get_text_encoders_train_flags(self, args, text_encoders):
    method get_text_encoder_outputs_caching_strategy (line 438) | def get_text_encoder_outputs_caching_strategy(self, args):
    method cache_text_encoder_outputs_if_needed (line 446) | def cache_text_encoder_outputs_if_needed(
    method sample_images (line 504) | def sample_images(self, accelerator, args, epoch, global_step, device,...
    method get_noise_scheduler (line 510) | def get_noise_scheduler(self, args: argparse.Namespace, device: torch....
    method encode_images_to_latents (line 515) | def encode_images_to_latents(self, args, vae: hunyuan_image_vae.Hunyua...
    method shift_scale_latents (line 518) | def shift_scale_latents(self, args, latents):
    method get_noise_pred_and_target (line 522) | def get_noise_pred_and_target(
    method post_process_loss (line 579) | def post_process_loss(self, loss, args, timesteps, noise_scheduler):
    method get_sai_model_spec (line 582) | def get_sai_model_spec(self, args):
    method update_metadata (line 585) | def update_metadata(self, metadata, args):
    method is_text_encoder_not_needed_for_training (line 594) | def is_text_encoder_not_needed_for_training(self, args):
    method prepare_text_encoder_grad_ckpt_workaround (line 597) | def prepare_text_encoder_grad_ckpt_workaround(self, index, text_encoder):
    method cast_text_encoder (line 601) | def cast_text_encoder(self, args):
    method cast_vae (line 604) | def cast_vae(self, args):
    method cast_unet (line 607) | def cast_unet(self, args):
    method prepare_text_encoder_fp8 (line 610) | def prepare_text_encoder_fp8(self, index, text_encoder, te_weight_dtyp...
    method on_validation_step_end (line 614) | def on_validation_step_end(self, args, accelerator, network, text_enco...
    method prepare_unet_with_accelerator (line 619) | def prepare_unet_with_accelerator(
  function setup_parser (line 634) | def setup_parser() -> argparse.ArgumentParser:

FILE: library/adafactor_fused.py
  function copy_stochastic_ (line 8) | def copy_stochastic_(target: torch.Tensor, source: torch.Tensor):
  function adafactor_step_param (line 32) | def adafactor_step_param(self, p, group):
  function adafactor_step (line 117) | def adafactor_step(self, closure=None):
  function patch_adafactor_fused (line 136) | def patch_adafactor_fused(optimizer: Adafactor):

FILE: library/anima_models.py
  function to_device (line 19) | def to_device(x, device):
  function to_cpu (line 30) | def to_cpu(x):
  function detach_variable (line 47) | def detach_variable(inputs, device=None):
  class UnslothOffloadedGradientCheckpointer (line 75) | class UnslothOffloadedGradientCheckpointer(torch.autograd.Function):
    method forward (line 84) | def forward(ctx, forward_function, hidden_states, *args):
    method backward (line 100) | def backward(ctx, *grads):
  function unsloth_checkpoint (line 122) | def unsloth_checkpoint(function, *args):
  function _rotate_half (line 136) | def _rotate_half(x: torch.Tensor, interleaved: bool) -> torch.Tensor:
  function _apply_rotary_pos_emb_base (line 146) | def _apply_rotary_pos_emb_base(
  function apply_rotary_pos_emb (line 175) | def apply_rotary_pos_emb(
  class RMSNorm (line 222) | class RMSNorm(torch.nn.Module):
    method __init__ (line 225) | def __init__(self, dim: int, eps: float = 1e-5) -> None:
    method reset_parameters (line 230) | def reset_parameters(self) -> None:
    method _norm (line 233) | def _norm(self, x: torch.Tensor) -> torch.Tensor:
    method forward (line 236) | def forward(self, x: torch.Tensor) -> torch.Tensor:
  class GPT2FeedForward (line 242) | class GPT2FeedForward(nn.Module):
    method __init__ (line 245) | def __init__(self, d_model: int, d_ff: int) -> None:
    method init_weights (line 256) | def init_weights(self) -> None:
    method forward (line 265) | def forward(self, x: torch.Tensor) -> torch.Tensor:
  class Attention (line 273) | class Attention(nn.Module):
    method __init__ (line 279) | def __init__(
    method init_weights (line 317) | def init_weights(self) -> None:
    method compute_qkv (line 331) | def compute_qkv(
    method forward (line 355) | def forward(
  class VideoPositionEmb (line 377) | class VideoPositionEmb(nn.Module):
    method __init__ (line 378) | def __init__(self) -> None:
    method seq_dim (line 382) | def seq_dim(self) -> int:
    method forward (line 385) | def forward(self, x_B_T_H_W_C: torch.Tensor, fps: Optional[torch.Tenso...
    method generate_embeddings (line 390) | def generate_embeddings(self, B_T_H_W_C: torch.Size, fps: Optional[tor...
  class VideoRopePosition3DEmb (line 394) | class VideoRopePosition3DEmb(VideoPositionEmb):
    method __init__ (line 397) | def __init__(
    method reset_parameters (line 442) | def reset_parameters(self) -> None:
    method generate_embeddings (line 450) | def generate_embeddings(
    method seq_dim (line 504) | def seq_dim(self) -> int:
  class LearnablePosEmbAxis (line 508) | class LearnablePosEmbAxis(VideoPositionEmb):
    method __init__ (line 511) | def __init__(
    method reset_parameters (line 533) | def reset_parameters(self) -> None:
    method generate_embeddings (line 539) | def generate_embeddings(self, B_T_H_W_C: torch.Size, fps: Optional[tor...
  class Timesteps (line 560) | class Timesteps(nn.Module):
    method __init__ (line 563) | def __init__(self, num_channels: int):
    method forward (line 567) | def forward(self, timesteps_B_T: torch.Tensor) -> torch.Tensor:
  class TimestepEmbedding (line 585) | class TimestepEmbedding(nn.Module):
    method __init__ (line 588) | def __init__(self, in_features: int, out_features: int, use_adaln_lora...
    method init_weights (line 602) | def init_weights(self) -> None:
    method forward (line 608) | def forward(self, sample: torch.Tensor) -> Tuple[torch.Tensor, Optiona...
  class PatchEmbed (line 650) | class PatchEmbed(nn.Module):
    method __init__ (line 653) | def __init__(
    method init_weights (line 677) | def init_weights(self) -> None:
    method forward (line 681) | def forward(self, x: torch.Tensor) -> torch.Tensor:
  class FinalLayer (line 693) | class FinalLayer(nn.Module):
    method __init__ (line 696) | def __init__(
    method init_weights (line 725) | def init_weights(self) -> None:
    method forward (line 736) | def forward(
  class Block (line 759) | class Block(nn.Module):
    method __init__ (line 765) | def __init__(
    method enable_gradient_checkpointing (line 823) | def enable_gradient_checkpointing(self, cpu_offload: bool = False, uns...
    method disable_gradient_checkpointing (line 828) | def disable_gradient_checkpointing(self):
    method reset_parameters (line 833) | def reset_parameters(self) -> None:
    method init_weights (line 851) | def init_weights(self) -> None:
    method _forward (line 857) | def _forward(
    method forward (line 947) | def forward(
  class Anima (line 1019) | class Anima(nn.Module):
    method __init__ (line 1027) | def __init__(
    method init_weights (line 1139) | def init_weights(self) -> None:
    method enable_gradient_checkpointing (line 1150) | def enable_gradient_checkpointing(self, cpu_offload: bool = False, uns...
    method disable_gradient_checkpointing (line 1154) | def disable_gradient_checkpointing(self):
    method device (line 1159) | def device(self):
    method dtype (line 1163) | def dtype(self):
    method build_patch_embed (line 1166) | def build_patch_embed(self) -> None:
    method build_pos_embed (line 1175) | def build_pos_embed(self) -> None:
    method prepare_embedded_sequence (line 1204) | def prepare_embedded_sequence(
    method unpatchify (line 1230) | def unpatchify(self, x_B_T_H_W_M: torch.Tensor) -> torch.Tensor:
    method enable_block_swap (line 1240) | def enable_block_swap(self, num_blocks: int, device: torch.device):
    method move_to_device_except_swap_blocks (line 1250) | def move_to_device_except_swap_blocks(self, device: torch.device):
    method switch_block_swap_for_inference (line 1261) | def switch_block_swap_for_inference(self):
    method switch_block_swap_for_training (line 1268) | def switch_block_swap_for_training(self):
    method prepare_block_swap_before_forward (line 1275) | def prepare_block_swap_before_forward(self):
    method forward_mini_train_dit (line 1280) | def forward_mini_train_dit(
    method forward (line 1345) | def forward(
    method _preprocess_text_embeds (line 1360) | def _preprocess_text_embeds(
  class LLMAdapterRMSNorm (line 1377) | class LLMAdapterRMSNorm(nn.Module):
    method __init__ (line 1380) | def __init__(self, hidden_size, eps=1e-6):
    method forward (line 1385) | def forward(self, hidden_states):
  function _adapter_rotate_half (line 1395) | def _adapter_rotate_half(x):
  function _adapter_apply_rotary_pos_emb (line 1401) | def _adapter_apply_rotary_pos_emb(x, cos, sin, unsqueeze_dim=1):
  class AdapterRotaryEmbedding (line 1408) | class AdapterRotaryEmbedding(nn.Module):
    method __init__ (line 1411) | def __init__(self, head_dim):
    method forward (line 1418) | def forward(self, x, position_ids):
  class LLMAdapterAttention (line 1432) | class LLMAdapterAttention(nn.Module):
    method __init__ (line 1435) | def __init__(self, query_dim, context_dim, n_heads, head_dim):
    method forward (line 1454) | def forward(self, x, mask=None, context=None, position_embeddings=None...
  class LLMAdapterTransformerBlock (line 1479) | class LLMAdapterTransformerBlock(nn.Module):
    method __init__ (line 1482) | def __init__(self, source_dim, model_dim, num_heads=16, mlp_ratio=4.0,...
    method forward (line 1508) | def forward(
    method init_weights (line 1541) | def init_weights(self):
  class LLMAdapter (line 1545) | class LLMAdapter(nn.Module):
    method __init__ (line 1551) | def __init__(
    method forward (line 1573) | def forward(self, source_hidden_states, target_input_ids, target_atten...

FILE: library/anima_train_utils.py
  function add_anima_training_arguments (line 32) | def add_anima_training_arguments(parser: argparse.ArgumentParser):
  function compute_loss_weighting_for_anima (line 143) | def compute_loss_weighting_for_anima(weighting_scheme: str, sigmas: torc...
  function get_anima_param_groups (line 161) | def get_anima_param_groups(
  function save_anima_model_on_train_end (line 250) | def save_anima_model_on_train_end(
  function save_anima_model_on_epoch_end_or_stepwise (line 270) | def save_anima_model_on_epoch_end_or_stepwise(
  function do_sample (line 304) | def do_sample(
  function sample_images (line 384) | def sample_images(
  function _sample_image_inference (line 466) | def _sample_image_inference(

FILE: library/anima_utils.py
  function load_anima_model (line 32) | def load_anima_model(
  function load_qwen3_tokenizer (line 151) | def load_qwen3_tokenizer(qwen3_path: str):
  function load_qwen3_text_encoder (line 181) | def load_qwen3_text_encoder(
  function load_t5_tokenizer (line 260) | def load_t5_tokenizer(t5_tokenizer_path: Optional[str] = None):
  function save_anima_model (line 286) | def save_anima_model(

FILE: library/attention.py
  class AttentionParams (line 31) | class AttentionParams:
    method supports_fp32 (line 41) | def supports_fp32(self) -> bool:
    method requires_same_dtype (line 45) | def requires_same_dtype(self) -> bool:
    method create_attention_params (line 49) | def create_attention_params(attn_mode: Optional[str], split_attn: bool...
    method create_attention_params_from_mask (line 53) | def create_attention_params_from_mask(
  function attention (line 89) | def attention(

FILE: library/attention_processors.py
  class FlashAttentionFunction (line 15) | class FlashAttentionFunction(torch.autograd.function.Function):
    method forward (line 18) | def forward(ctx, q, k, v, mask, causal, q_bucket_size, k_bucket_size):
    method backward (line 111) | def backward(ctx, do):
  class FlashAttnProcessor (line 182) | class FlashAttnProcessor:
    method __call__ (line 183) | def __call__(

FILE: library/chroma_models.py
  function distribute_modulations (line 18) | def distribute_modulations(tensor: torch.Tensor, depth_single_blocks, de...
  class Approximator (line 103) | class Approximator(nn.Module):
    method __init__ (line 104) | def __init__(self, in_dim: int, out_dim: int, hidden_dim: int, n_layer...
    method device (line 112) | def device(self):
    method enable_gradient_checkpointing (line 116) | def enable_gradient_checkpointing(self):
    method disable_gradient_checkpointing (line 120) | def disable_gradient_checkpointing(self):
    method forward (line 124) | def forward(self, x: Tensor) -> Tensor:
  class ModulationOut (line 136) | class ModulationOut:
  function _modulation_shift_scale_fn (line 142) | def _modulation_shift_scale_fn(x, scale, shift):
  function _modulation_gate_fn (line 146) | def _modulation_gate_fn(x, gate, gate_params):
  class DoubleStreamBlock (line 150) | class DoubleStreamBlock(nn.Module):
    method __init__ (line 151) | def __init__(
    method device (line 194) | def device(self):
    method modulation_shift_scale_fn (line 198) | def modulation_shift_scale_fn(self, x, scale, shift):
    method modulation_gate_fn (line 201) | def modulation_gate_fn(self, x, gate, gate_params):
    method enable_gradient_checkpointing (line 204) | def enable_gradient_checkpointing(self):
    method disable_gradient_checkpointing (line 207) | def disable_gradient_checkpointing(self):
    method _forward (line 210) | def _forward(
    method forward (line 318) | def forward(
  class SingleStreamBlock (line 332) | class SingleStreamBlock(nn.Module):
    method __init__ (line 338) | def __init__(
    method device (line 367) | def device(self):
    method modulation_shift_scale_fn (line 371) | def modulation_shift_scale_fn(self, x, scale, shift):
    method modulation_gate_fn (line 374) | def modulation_gate_fn(self, x, gate, gate_params):
    method enable_gradient_checkpointing (line 377) | def enable_gradient_checkpointing(self):
    method disable_gradient_checkpointing (line 380) | def disable_gradient_checkpointing(self):
    method _forward (line 383) | def _forward(self, x: Tensor, pe: list[Tensor], distill_vec: list[Modu...
    method forward (line 429) | def forward(self, x: Tensor, pe: Tensor, distill_vec: list[ModulationO...
  class LastLayer (line 436) | class LastLayer(nn.Module):
    method __init__ (line 437) | def __init__(
    method device (line 448) | def device(self):
    method modulation_shift_scale_fn (line 452) | def modulation_shift_scale_fn(self, x, scale, shift):
    method forward (line 455) | def forward(self, x: Tensor, distill_vec: list[Tensor]) -> Tensor:
  class ChromaParams (line 467) | class ChromaParams:
  function modify_mask_to_attend_padding (line 504) | def modify_mask_to_attend_padding(mask, max_seq_length, num_extra_paddin...
  class Chroma (line 537) | class Chroma(Flux):
    method __init__ (line 542) | def __init__(self, params: ChromaParams):
    method get_model_type (line 621) | def get_model_type(self) -> str:
    method enable_gradient_checkpointing (line 624) | def enable_gradient_checkpointing(self, cpu_offload: bool = False):
    method disable_gradient_checkpointing (line 634) | def disable_gradient_checkpointing(self):
    method get_mod_vectors (line 644) | def get_mod_vectors(self, timesteps: Tensor, guidance: Tensor | None =...
    method forward (line 664) | def forward(

FILE: library/config_util.py
  function add_config_arguments (line 45) | def add_config_arguments(parser: argparse.ArgumentParser):
  class BaseSubsetParams (line 55) | class BaseSubsetParams:
  class DreamBoothSubsetParams (line 82) | class DreamBoothSubsetParams(BaseSubsetParams):
  class FineTuningSubsetParams (line 91) | class FineTuningSubsetParams(BaseSubsetParams):
  class ControlNetSubsetParams (line 97) | class ControlNetSubsetParams(BaseSubsetParams):
  class BaseDatasetParams (line 104) | class BaseDatasetParams:
  class DreamBoothDatasetParams (line 113) | class DreamBoothDatasetParams(BaseDatasetParams):
  class FineTuningDatasetParams (line 123) | class FineTuningDatasetParams(BaseDatasetParams):
  class ControlNetDatasetParams (line 133) | class ControlNetDatasetParams(BaseDatasetParams):
  class SubsetBlueprint (line 143) | class SubsetBlueprint:
  class DatasetBlueprint (line 148) | class DatasetBlueprint:
  class DatasetGroupBlueprint (line 156) | class DatasetGroupBlueprint:
  class Blueprint (line 161) | class Blueprint:
  class ConfigSanitizer (line 165) | class ConfigSanitizer:
    method __validate_and_convert_twodim (line 168) | def __validate_and_convert_twodim(klass, value: Sequence) -> Tuple:
    method __validate_and_convert_scalar_or_twodim (line 174) | def __validate_and_convert_scalar_or_twodim(klass, value: Union[float,...
    method __init__ (line 266) | def __init__(self, support_dreambooth: bool, support_finetuning: bool,...
    method sanitize_user_config (line 370) | def sanitize_user_config(self, user_config: dict) -> dict:
    method sanitize_argparse_namespace (line 380) | def sanitize_argparse_namespace(self, argparse_namespace: argparse.Nam...
    method __merge_dict (line 392) | def __merge_dict(*dict_list: dict) -> dict:
  class BlueprintGenerator (line 401) | class BlueprintGenerator:
    method __init__ (line 404) | def __init__(self, sanitizer: ConfigSanitizer):
    method generate (line 408) | def generate(self, user_config: dict, argparse_namespace: argparse.Nam...
    method generate_params_by_fallbacks (line 454) | def generate_params_by_fallbacks(param_klass, fallbacks: Sequence[dict]):
    method search_value (line 465) | def search_value(key: str, fallbacks: Sequence[dict], default_value=No...
  function generate_dataset_group_by_blueprint (line 473) | def generate_dataset_group_by_blueprint(dataset_group_blueprint: Dataset...
  function generate_dreambooth_subsets_config_by_subdirs (line 607) | def generate_dreambooth_subsets_config_by_subdirs(train_data_dir: Option...
  function generate_controlnet_subsets_config_by_subdirs (line 647) | def generate_controlnet_subsets_config_by_subdirs(
  function load_user_config (line 675) | def load_user_config(file: str) -> dict:

FILE: library/custom_offloading_utils.py
  function _clean_memory_on_device (line 10) | def _clean_memory_on_device(device: torch.device):
  function _synchronize_device (line 25) | def _synchronize_device(device: torch.device):
  function swap_weight_devices_cuda (line 34) | def swap_weight_devices_cuda(device: torch.device, layer_to_cpu: nn.Modu...
  function swap_weight_devices_no_cuda (line 78) | def swap_weight_devices_no_cuda(device: torch.device, layer_to_cpu: nn.M...
  function weighs_to_device (line 103) | def weighs_to_device(layer: nn.Module, device: torch.device):
  class Offloader (line 109) | class Offloader:
    method __init__ (line 114) | def __init__(self, num_blocks: int, blocks_to_swap: int, device: torch...
    method swap_weight_devices (line 124) | def swap_weight_devices(self, block_to_cpu: nn.Module, block_to_cuda: ...
    method _submit_move_blocks (line 130) | def _submit_move_blocks(self, blocks, block_idx_to_cpu, block_idx_to_c...
    method _wait_blocks_move (line 149) | def _wait_blocks_move(self, block_idx):
  class ModelOffloader (line 170) | class ModelOffloader(Offloader):
    method __init__ (line 175) | def __init__(
    method set_forward_only (line 197) | def set_forward_only(self, forward_only: bool):
    method __del__ (line 203) | def __del__(self):
    method create_backward_hook (line 208) | def create_backward_hook(
    method prepare_block_devices_before_forward (line 236) | def prepare_block_devices_before_forward(self, blocks: Union[list[nn.M...
    method wait_for_block (line 258) | def wait_for_block(self, block_idx: int):
    method submit_move_blocks (line 263) | def submit_move_blocks(self, blocks: Union[list[nn.Module], nn.ModuleL...
  function to_device (line 284) | def to_device(x: Any, device: torch.device) -> Any:
  function to_cpu (line 297) | def to_cpu(x: Any) -> Any:
  function create_cpu_offloading_wrapper (line 320) | def create_cpu_offloading_wrapper(func: Callable, device: torch.device) ...

FILE: library/custom_train_functions.py
  function prepare_scheduler_for_custom_training (line 16) | def prepare_scheduler_for_custom_training(noise_scheduler, device):
  function fix_noise_scheduler_betas_for_zero_terminal_snr (line 30) | def fix_noise_scheduler_betas_for_zero_terminal_snr(noise_scheduler):
  function apply_snr_weight (line 68) | def apply_snr_weight(loss: torch.Tensor, timesteps: torch.IntTensor, noi...
  function scale_v_prediction_loss_like_noise_prediction (line 79) | def scale_v_prediction_loss_like_noise_prediction(loss: torch.Tensor, ti...
  function get_snr_scale (line 85) | def get_snr_scale(timesteps: torch.IntTensor, noise_scheduler: DDPMSched...
  function add_v_prediction_like_loss (line 94) | def add_v_prediction_like_loss(loss: torch.Tensor, timesteps: torch.IntT...
  function apply_debiased_estimation (line 101) | def apply_debiased_estimation(loss: torch.Tensor, timesteps: torch.IntTe...
  function add_custom_train_arguments (line 115) | def add_custom_train_arguments(parser: argparse.ArgumentParser, support_...
  function parse_prompt_attention (line 167) | def parse_prompt_attention(text):
  function get_prompts_with_weights (line 253) | def get_prompts_with_weights(tokenizer, prompt: List[str], max_length: i...
  function pad_tokens_and_weights (line 288) | def pad_tokens_and_weights(tokens, weights, max_length, bos, eos, no_bos...
  function get_unweighted_text_embeddings (line 313) | def get_unweighted_text_embeddings(
  function get_weighted_text_embeddings (line 375) | def get_weighted_text_embeddings(
  function pyramid_noise_like (line 458) | def pyramid_noise_like(noise, device, iterations=6, discount=0.4) -> tor...
  function apply_noise_offset (line 471) | def apply_noise_offset(latents, noise, noise_offset, adaptive_noise_scal...
  function apply_masked_loss (line 487) | def apply_masked_loss(loss, batch) -> torch.FloatTensor:

FILE: library/deepspeed_utils.py
  function add_deepspeed_arguments (line 16) | def add_deepspeed_arguments(parser: argparse.ArgumentParser):
  function prepare_deepspeed_args (line 64) | def prepare_deepspeed_args(args: argparse.Namespace):
  function prepare_deepspeed_plugin (line 72) | def prepare_deepspeed_plugin(args: argparse.Namespace):
  function prepare_deepspeed_model (line 121) | def prepare_deepspeed_model(args: argparse.Namespace, **models):

FILE: library/device_utils.py
  function clean_memory (line 32) | def clean_memory():
  function clean_memory_on_device (line 42) | def clean_memory_on_device(device: Optional[Union[str, torch.device]]):
  function synchronize_device (line 60) | def synchronize_device(device: Optional[Union[str, torch.device]]):
  function get_preferred_device (line 74) | def get_preferred_device() -> torch.device:
  function init_ipex (line 90) | def init_ipex():

FILE: library/flux_models.py
  class FluxParams (line 28) | class FluxParams:
  class AutoEncoderParams (line 47) | class AutoEncoderParams:
  function swish (line 59) | def swish(x: Tensor) -> Tensor:
  class AttnBlock (line 63) | class AttnBlock(nn.Module):
    method __init__ (line 64) | def __init__(self, in_channels: int):
    method attention (line 75) | def attention(self, h_: Tensor) -> Tensor:
    method forward (line 89) | def forward(self, x: Tensor) -> Tensor:
  class ResnetBlock (line 93) | class ResnetBlock(nn.Module):
    method __init__ (line 94) | def __init__(self, in_channels: int, out_channels: int):
    method forward (line 107) | def forward(self, x):
  class Downsample (line 123) | class Downsample(nn.Module):
    method __init__ (line 124) | def __init__(self, in_channels: int):
    method forward (line 129) | def forward(self, x: Tensor):
  class Upsample (line 136) | class Upsample(nn.Module):
    method __init__ (line 137) | def __init__(self, in_channels: int):
    method forward (line 141) | def forward(self, x: Tensor):
  class Encoder (line 147) | class Encoder(nn.Module):
    method __init__ (line 148) | def __init__(
    method forward (line 197) | def forward(self, x: Tensor) -> Tensor:
  class Decoder (line 221) | class Decoder(nn.Module):
    method __init__ (line 222) | def __init__(
    method forward (line 275) | def forward(self, z: Tensor) -> Tensor:
  class DiagonalGaussian (line 300) | class DiagonalGaussian(nn.Module):
    method __init__ (line 301) | def __init__(self, sample: bool = True, chunk_dim: int = 1):
    method forward (line 306) | def forward(self, z: Tensor) -> Tensor:
  class AutoEncoder (line 315) | class AutoEncoder(nn.Module):
    method __init__ (line 316) | def __init__(self, params: AutoEncoderParams):
    method device (line 341) | def device(self) -> torch.device:
    method dtype (line 345) | def dtype(self) -> torch.dtype:
    method encode (line 348) | def encode(self, x: Tensor) -> Tensor:
    method decode (line 353) | def decode(self, z: Tensor) -> Tensor:
    method forward (line 357) | def forward(self, x: Tensor) -> Tensor:
  class ModelSpec (line 366) | class ModelSpec:
  function attention (line 449) | def attention(q: Tensor, k: Tensor, v: Tensor, pe: Tensor, attn_mask: Op...
  function rope (line 458) | def rope(pos: Tensor, dim: int, theta: int) -> Tensor:
  function apply_rope (line 468) | def apply_rope(xq: Tensor, xk: Tensor, freqs_cis: Tensor) -> tuple[Tenso...
  function to_cuda (line 485) | def to_cuda(x):
  function to_cpu (line 496) | def to_cpu(x):
  class EmbedND (line 507) | class EmbedND(nn.Module):
    method __init__ (line 508) | def __init__(self, dim: int, theta: int, axes_dim: list[int]):
    method forward (line 514) | def forward(self, ids: Tensor) -> Tensor:
  function timestep_embedding (line 524) | def timestep_embedding(t: Tensor, dim, max_period=10000, time_factor: fl...
  class MLPEmbedder (line 546) | class MLPEmbedder(nn.Module):
    method __init__ (line 547) | def __init__(self, in_dim: int, hidden_dim: int):
    method enable_gradient_checkpointing (line 555) | def enable_gradient_checkpointing(self):
    method disable_gradient_checkpointing (line 558) | def disable_gradient_checkpointing(self):
    method _forward (line 561) | def _forward(self, x: Tensor) -> Tensor:
    method forward (line 564) | def forward(self, *args, **kwargs):
  class RMSNorm (line 581) | class RMSNorm(torch.nn.Module):
    method __init__ (line 582) | def __init__(self, dim: int):
    method forward (line 586) | def forward(self, x: Tensor):
  class QKNorm (line 594) | class QKNorm(torch.nn.Module):
    method __init__ (line 595) | def __init__(self, dim: int):
    method forward (line 600) | def forward(self, q: Tensor, k: Tensor, v: Tensor) -> tuple[Tensor, Te...
  class SelfAttention (line 606) | class SelfAttention(nn.Module):
    method __init__ (line 607) | def __init__(self, dim: int, num_heads: int = 8, qkv_bias: bool = False):
    method forward (line 617) | def forward(self, x: Tensor, pe: Tensor) -> Tensor:
  class ModulationOut (line 627) | class ModulationOut:
  class Modulation (line 633) | class Modulation(nn.Module):
    method __init__ (line 634) | def __init__(self, dim: int, double: bool):
    method forward (line 640) | def forward(self, vec: Tensor) -> tuple[ModulationOut, ModulationOut |...
  class DoubleStreamBlock (line 649) | class DoubleStreamBlock(nn.Module):
    method __init__ (line 650) | def __init__(self, hidden_size: int, num_heads: int, mlp_ratio: float,...
    method enable_gradient_checkpointing (line 681) | def enable_gradient_checkpointing(self, cpu_offload: bool = False):
    method disable_gradient_checkpointing (line 685) | def disable_gradient_checkpointing(self):
    method _forward (line 689) | def _forward(
    method forward (line 738) | def forward(
  class SingleStreamBlock (line 762) | class SingleStreamBlock(nn.Module):
    method __init__ (line 768) | def __init__(
    method enable_gradient_checkpointing (line 798) | def enable_gradient_checkpointing(self, cpu_offload: bool = False):
    method disable_gradient_checkpointing (line 802) | def disable_gradient_checkpointing(self):
    method _forward (line 806) | def _forward(self, x: Tensor, vec: Tensor, pe: Tensor, txt_attention_m...
    method forward (line 839) | def forward(self, x: Tensor, vec: Tensor, pe: Tensor, txt_attention_ma...
  class LastLayer (line 861) | class LastLayer(nn.Module):
    method __init__ (line 862) | def __init__(self, hidden_size: int, patch_size: int, out_channels: int):
    method forward (line 868) | def forward(self, x: Tensor, vec: Tensor) -> Tensor:
  class Flux (line 878) | class Flux(nn.Module):
    method __init__ (line 883) | def __init__(self, params: FluxParams):
    method get_model_type (line 933) | def get_model_type(self) -> str:
    method device (line 937) | def device(self):
    method dtype (line 941) | def dtype(self):
    method enable_gradient_checkpointing (line 944) | def enable_gradient_checkpointing(self, cpu_offload: bool = False):
    method disable_gradient_checkpointing (line 958) | def disable_gradient_checkpointing(self):
    method enable_block_swap (line 972) | def enable_block_swap(self, num_blocks: int, device: torch.device):
    method move_to_device_except_swap_blocks (line 992) | def move_to_device_except_swap_blocks(self, device: torch.device):
    method prepare_block_swap_before_forward (line 1006) | def prepare_block_swap_before_forward(self):
    method get_mod_vectors (line 1012) | def get_mod_vectors(self, timesteps: Tensor, guidance: Tensor | None =...
    method forward (line 1015) | def forward(
  function zero_module (line 1092) | def zero_module(module):
  class ControlNetFlux (line 1098) | class ControlNetFlux(nn.Module):
    method __init__ (line 1103) | def __init__(self, params: FluxParams, controlnet_depth=2, controlnet_...
    method device (line 1183) | def device(self):
    method dtype (line 1187) | def dtype(self):
    method enable_gradient_checkpointing (line 1190) | def enable_gradient_checkpointing(self, cpu_offload: bool = False):
    method disable_gradient_checkpointing (line 1204) | def disable_gradient_checkpointing(self):
    method enable_block_swap (line 1218) | def enable_block_swap(self, num_blocks: int, device: torch.device):
    method move_to_device_except_swap_blocks (line 1238) | def move_to_device_except_swap_blocks(self, device: torch.device):
    method prepare_block_swap_before_forward (line 1252) | def prepare_block_swap_before_forward(self):
    method forward (line 1258) | def forward(

FILE: library/flux_train_utils.py
  function sample_images (line 34) | def sample_images(
  function sample_image_inference (line 139) | def sample_image_inference(
  function time_shift (line 306) | def time_shift(mu: float, sigma: float, t: torch.Tensor):
  function get_lin_function (line 310) | def get_lin_function(x1: float = 256, y1: float = 0.5, x2: float = 4096,...
  function get_schedule (line 316) | def get_schedule(
  function denoise (line 335) | def denoise(
  function get_sigmas (line 423) | def get_sigmas(noise_scheduler, timesteps, device, n_dim=4, dtype=torch....
  function compute_density_for_timestep_sampling (line 433) | def compute_density_for_timestep_sampling(
  function compute_loss_weighting_for_sd3 (line 454) | def compute_loss_weighting_for_sd3(weighting_scheme: str, sigmas=None):
  function get_noisy_model_input_and_timesteps (line 471) | def get_noisy_model_input_and_timesteps(
  function apply_model_prediction_type (line 532) | def apply_model_prediction_type(args, model_pred, noisy_model_input, sig...
  function save_models (line 550) | def save_models(
  function save_flux_model_on_train_end (line 574) | def save_flux_model_on_train_end(
  function save_flux_model_on_epoch_end_or_stepwise (line 586) | def save_flux_model_on_epoch_end_or_stepwise(
  function add_flux_train_arguments (line 617) | def add_flux_train_arguments(parser: argparse.ArgumentParser):

FILE: library/flux_utils.py
  function analyze_checkpoint_state (line 29) | def analyze_checkpoint_state(ckpt_path: str) -> Tuple[bool, bool, Tuple[...
  function load_flow_model (line 95) | def load_flow_model(
  function load_ae (line 176) | def load_ae(
  function load_controlnet (line 191) | def load_controlnet(
  function dummy_clip_l (line 207) | def dummy_clip_l() -> torch.nn.Module:
  class DummyTextModel (line 214) | class DummyTextModel(torch.nn.Module):
    method __init__ (line 215) | def __init__(self):
  class DummyCLIPL (line 220) | class DummyCLIPL(torch.nn.Module):
    method __init__ (line 221) | def __init__(self):
    method device (line 232) | def device(self):
    method dtype (line 236) | def dtype(self):
    method forward (line 239) | def forward(self, *args, **kwargs):
  function load_clip_l (line 247) | def load_clip_l(
  function load_t5xxl (line 357) | def load_t5xxl(
  function get_t5xxl_actual_dtype (line 412) | def get_t5xxl_actual_dtype(t5xxl: T5EncoderModel) -> torch.dtype:
  function prepare_img_ids (line 417) | def prepare_img_ids(batch_size: int, packed_latent_height: int, packed_l...
  function unpack_latents (line 425) | def unpack_latents(x: torch.Tensor, packed_latent_height: int, packed_la...
  function pack_latents (line 433) | def pack_latents(x: torch.Tensor) -> torch.Tensor:
  function make_diffusers_to_bfl_map (line 503) | def make_diffusers_to_bfl_map(num_double_blocks: int, num_single_blocks:...
  function convert_diffusers_sd_to_bfl (line 525) | def convert_diffusers_sd_to_bfl(

FILE: library/fp8_optimization_utils.py
  function calculate_fp8_maxval (line 21) | def calculate_fp8_maxval(exp_bits=4, mantissa_bits=3, sign_bits=1):
  function quantize_fp8 (line 60) | def quantize_fp8(tensor, scale, fp8_dtype, max_value, min_value):
  function optimize_state_dict_with_fp8 (line 88) | def optimize_state_dict_with_fp8(
  function quantize_weight (line 177) | def quantize_weight(
  function load_safetensors_with_fp8_optimization (line 239) | def load_safetensors_with_fp8_optimization(
  function fp8_linear_forward_patch (line 355) | def fp8_linear_forward_patch(self: nn.Linear, x, use_scaled_mm=False, ma...
  function apply_fp8_monkey_patch (line 428) | def apply_fp8_monkey_patch(model, optimized_state_dict, use_scaled_mm=Fa...

FILE: library/huggingface_util.py
  function exists_repo (line 12) | def exists_repo(repo_id: str, repo_type: str, revision: str = "main", to...
  function upload (line 23) | def upload(
  function list_dir (line 72) | def list_dir(

FILE: library/hunyuan_image_models.py
  class HYImageDiffusionTransformer (line 43) | class HYImageDiffusionTransformer(nn.Module):
    method __init__ (line 54) | def __init__(self, attn_mode: str = "torch", split_attn: bool = False):
    method device (line 147) | def device(self):
    method dtype (line 151) | def dtype(self):
    method enable_gradient_checkpointing (line 154) | def enable_gradient_checkpointing(self, cpu_offload: bool = False):
    method disable_gradient_checkpointing (line 163) | def disable_gradient_checkpointing(self):
    method enable_block_swap (line 172) | def enable_block_swap(self, num_blocks: int, device: torch.device, sup...
    method switch_block_swap_for_inference (line 193) | def switch_block_swap_for_inference(self):
    method switch_block_swap_for_training (line 200) | def switch_block_swap_for_training(self):
    method move_to_device_except_swap_blocks (line 207) | def move_to_device_except_swap_blocks(self, device: torch.device):
    method prepare_block_swap_before_forward (line 221) | def prepare_block_swap_before_forward(self):
    method get_rotary_pos_embed (line 227) | def get_rotary_pos_embed(self, rope_sizes):
    method reorder_txt_token (line 240) | def reorder_txt_token(
    method forward (line 291) | def forward(
    method unpatchify_2d (line 393) | def unpatchify_2d(self, x, h, w):
  function create_model (line 417) | def create_model(attn_mode: str, split_attn: bool, dtype: Optional[torch...
  function load_hunyuan_image_model (line 425) | def load_hunyuan_image_model(

FILE: library/hunyuan_image_modules.py
  class ByT5Mapper (line 17) | class ByT5Mapper(nn.Module):
    method __init__ (line 32) | def __init__(self, in_dim, out_dim, hidden_dim, out_dim1, use_residual...
    method forward (line 43) | def forward(self, x):
  class PatchEmbed2D (line 65) | class PatchEmbed2D(nn.Module):
    method __init__ (line 78) | def __init__(self, patch_size=16, in_chans=3, embed_dim=768):
    method forward (line 85) | def forward(self, x):
  class TimestepEmbedder (line 92) | class TimestepEmbedder(nn.Module):
    method __init__ (line 106) | def __init__(self, hidden_size, act_layer, frequency_embedding_size=25...
    method forward (line 117) | def forward(self, t):
  class TextProjection (line 122) | class TextProjection(nn.Module):
    method __init__ (line 134) | def __init__(self, in_channels, hidden_size, act_layer):
    method forward (line 140) | def forward(self, caption):
  class MLP (line 147) | class MLP(nn.Module):
    method __init__ (line 164) | def __init__(
    method forward (line 190) | def forward(self, x):
  class IndividualTokenRefinerBlock (line 200) | class IndividualTokenRefinerBlock(nn.Module):
    method __init__ (line 218) | def __init__(
    method forward (line 252) | def forward(self, x: torch.Tensor, c: torch.Tensor, attn_params: Atten...
  class IndividualTokenRefiner (line 281) | class IndividualTokenRefiner(nn.Module):
    method __init__ (line 299) | def __init__(
    method forward (line 328) | def forward(self, x: torch.Tensor, c: torch.LongTensor, attn_params: A...
  class SingleTokenRefiner (line 345) | class SingleTokenRefiner(nn.Module):
    method __init__ (line 359) | def __init__(self, in_channels: int, hidden_size: int, heads_num: int,...
    method forward (line 385) | def forward(self, x: torch.Tensor, t: torch.LongTensor, attn_params: A...
  class FinalLayer (line 411) | class FinalLayer(nn.Module):
    method __init__ (line 425) | def __init__(self, hidden_size, patch_size, out_channels, act_layer):
    method forward (line 439) | def forward(self, x, c):
  class RMSNorm (line 447) | class RMSNorm(nn.Module):
    method __init__ (line 459) | def __init__(self, dim: int, eps: float = 1e-6):
    method _norm (line 464) | def _norm(self, x):
    method reset_parameters (line 476) | def reset_parameters(self):
    method forward (line 479) | def forward(self, x):
  class ModulateDiT (line 520) | class ModulateDiT(nn.Module):
    method __init__ (line 533) | def __init__(self, hidden_size: int, factor: int, act_layer: Callable):
    method forward (line 538) | def forward(self, x: torch.Tensor) -> torch.Tensor:
  class MMDoubleStreamBlock (line 542) | class MMDoubleStreamBlock(nn.Module):
    method __init__ (line 560) | def __init__(
    method enable_gradient_checkpointing (line 608) | def enable_gradient_checkpointing(self, cpu_offload: bool = False):
    method disable_gradient_checkpointing (line 612) | def disable_gradient_checkpointing(self):
    method _forward (line 616) | def _forward(
    method forward (line 709) | def forward(
  class MMSingleStreamBlock (line 722) | class MMSingleStreamBlock(nn.Module):
    method __init__ (line 739) | def __init__(
    method enable_gradient_checkpointing (line 781) | def enable_gradient_checkpointing(self, cpu_offload: bool = False):
    method disable_gradient_checkpointing (line 785) | def disable_gradient_checkpointing(self):
    method _forward (line 789) | def _forward(
    method forward (line 846) | def forward(

FILE: library/hunyuan_image_text_encoder.py
  function add_special_token (line 148) | def add_special_token(tokenizer: T5Tokenizer, text_encoder: T5Stack):
  function load_byt5 (line 170) | def load_byt5(
  function load_qwen2_5_vl (line 237) | def load_qwen2_5_vl(
  function get_qwen_prompt_embeds (line 507) | def get_qwen_prompt_embeds(
  function get_qwen_tokens (line 514) | def get_qwen_tokens(tokenizer: Qwen2Tokenizer, prompt: Union[str, list[s...
  function get_qwen_prompt_embeds_from_tokens (line 532) | def get_qwen_prompt_embeds_from_tokens(
  function format_prompt (line 571) | def format_prompt(texts, styles):
  function get_glyph_prompt_embeds (line 588) | def get_glyph_prompt_embeds(
  function get_byt5_prompt_embeds_from_tokens (line 595) | def get_byt5_prompt_embeds_from_tokens(
  function get_byt5_text_tokens (line 617) | def get_byt5_text_tokens(tokenizer, prompt):

FILE: library/hunyuan_image_utils.py
  function _to_tuple (line 21) | def _to_tuple(x, dim=2):
  function get_meshgrid_nd (line 40) | def get_meshgrid_nd(start, dim=2):
  function get_nd_rotary_pos_embed (line 71) | def get_nd_rotary_pos_embed(rope_dim_list, start, theta=10000.0):
  function get_1d_rotary_pos_embed (line 100) | def get_1d_rotary_pos_embed(
  function timestep_embedding (line 124) | def timestep_embedding(t, dim, max_period=10000):
  function modulate (line 148) | def modulate(x, shift=None, scale=None):
  function apply_gate (line 173) | def apply_gate(x, gate=None, tanh=False):
  function reshape_for_broadcast (line 196) | def reshape_for_broadcast(
  function rotate_half (line 226) | def rotate_half(x):
  function apply_rotary_emb (line 243) | def apply_rotary_emb(
  function get_timesteps_sigmas (line 276) | def get_timesteps_sigmas(sampling_steps: int, shift: float, device: torc...
  function step (line 295) | def step(latents, noise_pred, sigmas, step_i):
  class MomentumBuffer (line 317) | class MomentumBuffer:
    method __init__ (line 322) | def __init__(self, momentum: float):
    method update (line 326) | def update(self, update_value: torch.Tensor):
  function normalized_guidance_apg (line 331) | def normalized_guidance_apg(
  class AdaptiveProjectedGuidance (line 387) | class AdaptiveProjectedGuidance:
    method __init__ (line 395) | def __init__(
    method __call__ (line 412) | def __call__(self, pred_cond: torch.Tensor, pred_uncond: Optional[torc...
  function rescale_noise_cfg (line 432) | def rescale_noise_cfg(guided_noise, conditional_noise, rescale_factor=0.0):
  function apply_classifier_free_guidance (line 467) | def apply_classifier_free_guidance(

FILE: library/hunyuan_image_vae.py
  function swish (line 24) | def swish(x: Tensor) -> Tensor:
  class AttnBlock (line 29) | class AttnBlock(nn.Module):
    method __init__ (line 32) | def __init__(self, in_channels: int, chunk_size: Optional[int] = None):
    method attention (line 47) | def attention(self, x: Tensor) -> Tensor:
    method forward (line 61) | def forward(self, x: Tensor) -> Tensor:
  class ChunkedConv2d (line 65) | class ChunkedConv2d(nn.Conv2d):
    method __init__ (line 75) | def __init__(self, *args, **kwargs):
    method forward (line 89) | def forward(self, x: Tensor) -> Tensor:
  class ResnetBlock (line 146) | class ResnetBlock(nn.Module):
    method __init__ (line 159) | def __init__(self, in_channels: int, out_channels: int, chunk_size: Op...
    method forward (line 183) | def forward(self, x: Tensor) -> Tensor:
  class Downsample (line 200) | class Downsample(nn.Module):
    method __init__ (line 213) | def __init__(self, in_channels: int, out_channels: int, chunk_size: Op...
    method forward (line 226) | def forward(self, x: Tensor) -> Tensor:
  class Upsample (line 239) | class Upsample(nn.Module):
    method __init__ (line 252) | def __init__(self, in_channels: int, out_channels: int, chunk_size: Op...
    method forward (line 263) | def forward(self, x: Tensor) -> Tensor:
  class Encoder (line 275) | class Encoder(nn.Module):
    method __init__ (line 294) | def __init__(
    method forward (line 356) | def forward(self, x: Tensor) -> Tensor:
  class Decoder (line 384) | class Decoder(nn.Module):
    method __init__ (line 403) | def __init__(
    method forward (line 462) | def forward(self, z: Tensor) -> Tensor:
  class HunyuanVAE2D (line 488) | class HunyuanVAE2D(nn.Module):
    method __init__ (line 496) | def __init__(self, chunk_size: Optional[int] = None):
    method dtype (line 537) | def dtype(self):
    method device (line 542) | def device(self):
    method enable_spatial_tiling (line 546) | def enable_spatial_tiling(self, use_tiling: bool = True):
    method disable_spatial_tiling (line 550) | def disable_spatial_tiling(self):
    method enable_tiling (line 554) | def enable_tiling(self, use_tiling: bool = True):
    method disable_tiling (line 558) | def disable_tiling(self):
    method blend_h (line 562) | def blend_h(self, a: torch.Tensor, b: torch.Tensor, blend_extent: int)...
    method blend_v (line 580) | def blend_v(self, a: torch.Tensor, b: torch.Tensor, blend_extent: int)...
    method spatial_tiled_encode (line 598) | def spatial_tiled_encode(self, x: torch.Tensor) -> torch.Tensor:
    method spatial_tiled_decode (line 641) | def spatial_tiled_decode(self, z: torch.Tensor) -> torch.Tensor:
    method encode (line 679) | def encode(self, x: Tensor) -> DiagonalGaussianDistribution:
    method decode (line 712) | def decode(self, z: Tensor):
  function load_vae (line 745) | def load_vae(vae_path: str, device: torch.device, disable_mmap: bool = F...

FILE: library/hypernetwork.py
  function apply_single_hypernetwork (line 19) | def apply_single_hypernetwork(
  function apply_hypernetworks (line 26) | def apply_hypernetworks(context_k, context_v, layer=None):
  function xformers_forward (line 39) | def xformers_forward(
  function sliced_attn_forward (line 90) | def sliced_attn_forward(
  function v2_0_forward (line 155) | def v2_0_forward(
  function replace_attentions_for_hypernetwork (line 214) | def replace_attentions_for_hypernetwork():

FILE: library/ipex/__init__.py
  function ipex_init (line 15) | def ipex_init(): # pylint: disable=too-many-statements

FILE: library/ipex/attention.py
  function find_split_size (line 14) | def find_split_size(original_size, slice_block_size, slice_rate=2):
  function find_sdpa_slice_sizes (line 27) | def find_sdpa_slice_sizes(query_shape, key_shape, query_element_size, sl...
  function dynamic_scaled_dot_product_attention (line 60) | def dynamic_scaled_dot_product_attention(query, key, value, attn_mask=No...

FILE: library/ipex/diffusers.py
  function fourier_filter (line 13) | def fourier_filter(x_in, threshold, scale):
  class FluxPosEmbed (line 19) | class FluxPosEmbed(torch.nn.Module):
    method __init__ (line 20) | def __init__(self, theta: int, axes_dim):
    method forward (line 25) | def forward(self, ids: torch.Tensor) -> torch.Tensor:
  function hidream_rope (line 46) | def hidream_rope(pos: torch.Tensor, dim: int, theta: int) -> torch.Tensor:
  function get_1d_sincos_pos_embed_from_grid (line 64) | def get_1d_sincos_pos_embed_from_grid(embed_dim, pos, output_type="np"):
  function apply_rotary_emb (line 84) | def apply_rotary_emb(x, freqs_cis, use_real: bool = True, use_real_unbin...
  function ipex_diffusers (line 113) | def ipex_diffusers(device_supports_fp64=False):

FILE: library/ipex/hijacks.py
  class DummyDataParallel (line 27) | class DummyDataParallel(torch.nn.Module): # pylint: disable=missing-clas...
    method __new__ (line 28) | def __new__(cls, module, device_ids=None, output_device=None, dim=0): ...
  function return_null_context (line 33) | def return_null_context(*args, **kwargs): # pylint: disable=unused-argument
  function is_cuda (line 37) | def is_cuda(self):
  function check_device_type (line 40) | def check_device_type(device, device_type: str) -> bool:
  function check_cuda (line 46) | def check_cuda(device) -> bool:
  function return_xpu (line 49) | def return_xpu(device): # keep the device instance type, aka return stri...
  function autocast_init (line 56) | def autocast_init(self, device_type=None, dtype=None, enabled=True, cach...
  function GradScaler_init (line 65) | def GradScaler_init(self, device: str = None, init_scale: float = 2.0**1...
  function torch_is_autocast_enabled (line 74) | def torch_is_autocast_enabled(device_type=None):
  function torch_get_autocast_dtype (line 83) | def torch_get_autocast_dtype(device_type=None):
  function interpolate (line 94) | def interpolate(tensor, size=None, scale_factor=None, mode='nearest', al...
  function from_numpy (line 108) | def from_numpy(ndarray):
  function as_tensor (line 116) | def as_tensor(data, dtype=None, device=None):
  function scaled_dot_product_attention (line 135) | def scaled_dot_product_attention(query, key, value, attn_mask=None, drop...
  function torch_bmm (line 147) | def torch_bmm(input, mat2, *, out=None):
  function fft_fftn (line 155) | def fft_fftn(input, s=None, dim=None, norm=None, *, out=None):
  function fft_ifftn (line 162) | def fft_ifftn(input, s=None, dim=None, norm=None, *, out=None):
  function functional_group_norm (line 169) | def functional_group_norm(input, num_groups, weight=None, bias=None, eps...
  function functional_layer_norm (line 179) | def functional_layer_norm(input, normalized_shape, weight=None, bias=Non...
  function functional_linear (line 189) | def functional_linear(input, weight, bias=None):
  function functional_conv1d (line 198) | def functional_conv1d(input, weight, bias=None, stride=1, padding=0, dil...
  function functional_conv2d (line 207) | def functional_conv2d(input, weight, bias=None, stride=1, padding=0, dil...
  function functional_conv3d (line 217) | def functional_conv3d(input, weight, bias=None, stride=1, padding=0, dil...
  function functional_pad (line 227) | def functional_pad(input, pad, mode='constant', value=None):
  function torch_tensor (line 236) | def torch_tensor(data, *args, dtype=None, device=None, **kwargs):
  function Tensor_to (line 250) | def Tensor_to(self, device=None, *args, **kwargs):
  function Tensor_cuda (line 258) | def Tensor_cuda(self, device=None, *args, **kwargs):
  function Tensor_pin_memory (line 266) | def Tensor_pin_memory(self, device=None, *args, **kwargs):
  function UntypedStorage_init (line 274) | def UntypedStorage_init(*args, device=None, **kwargs):
  function UntypedStorage_to (line 283) | def UntypedStorage_to(self, *args, device=None, **kwargs):
  function UntypedStorage_cuda (line 291) | def UntypedStorage_cuda(self, device=None, non_blocking=False, **kwargs):
  function torch_empty (line 299) | def torch_empty(*args, device=None, **kwargs):
  function torch_randn (line 307) | def torch_randn(*args, device=None, dtype=None, **kwargs):
  function torch_ones (line 317) | def torch_ones(*args, device=None, **kwargs):
  function torch_zeros (line 325) | def torch_zeros(*args, device=None, **kwargs):
  function torch_full (line 333) | def torch_full(*args, device=None, **kwargs):
  function torch_linspace (line 341) | def torch_linspace(*args, device=None, **kwargs):
  function torch_eye (line 349) | def torch_eye(*args, device=None, **kwargs):
  function torch_load (line 357) | def torch_load(f, map_location=None, *args, **kwargs):
  function torch_cuda_synchronize (line 364) | def torch_cuda_synchronize(device=None):
  function torch_cuda_device (line 371) | def torch_cuda_device(device):
  function torch_cuda_set_device (line 378) | def torch_cuda_set_device(device):
  class torch_Generator (line 386) | class torch_Generator(original_torch_Generator):
    method __new__ (line 387) | def __new__(self, device=None):
  function ipex_hijacks (line 396) | def ipex_hijacks():

FILE: library/jpeg_xl_util.py
  class JXLBitstream (line 7) | class JXLBitstream:
    method __init__ (line 12) | def __init__(self, file, offset: int = 0, offsets: List[List[int]] = N...
    method get_bits (line 24) | def get_bits(self, length: int = 1) -> int:
    method partial_read (line 37) | def partial_read(self, current_length: int, length: int) -> None:
  function decode_codestream (line 49) | def decode_codestream(file, offset: int = 0, offsets: List[List[int]] = ...
  function decode_container (line 109) | def decode_container(file) -> Tuple[int,int]:
  function get_jxl_size (line 182) | def get_jxl_size(path: str) -> Tuple[int,int]:

FILE: library/lora_utils.py
  function filter_lora_state_dict (line 17) | def filter_lora_state_dict(
  function load_safetensors_with_lora_and_fp8 (line 45) | def load_safetensors_with_lora_and_fp8(
  function load_safetensors_with_fp8_optimization_and_hook (line 213) | def load_safetensors_with_fp8_optimization_and_hook(

FILE: library/lpw_stable_diffusion.py
  function parse_prompt_attention (line 63) | def parse_prompt_attention(text):
  function get_prompts_with_weights (line 149) | def get_prompts_with_weights(pipe: StableDiffusionPipeline, prompt: List...
  function pad_tokens_and_weights (line 184) | def pad_tokens_and_weights(tokens, weights, max_length, bos, eos, no_bos...
  function get_unweighted_text_embeddings (line 209) | def get_unweighted_text_embeddings(
  function get_weighted_text_embeddings (line 270) | def get_weighted_text_embeddings(
  function preprocess_image (line 405) | def preprocess_image(image):
  function preprocess_mask (line 415) | def preprocess_mask(mask, scale_factor=8):
  function prepare_controlnet_image (line 428) | def prepare_controlnet_image(
  class StableDiffusionLongPromptWeightingPipeline (line 480) | class StableDiffusionLongPromptWeightingPipeline(StableDiffusionPipeline):
    method __init__ (line 511) | def __init__(
    method __init__additional__ (line 539) | def __init__additional__(self):
    method _execution_device (line 544) | def _execution_device(self):
    method _encode_prompt (line 561) | def _encode_prompt(
    method check_inputs (line 620) | def check_inputs(self, prompt, height, width, strength, callback_steps):
    method get_timesteps (line 638) | def get_timesteps(self, num_inference_steps, strength, device, is_text...
    method run_safety_checker (line 651) | def run_safety_checker(self, image, device, dtype):
    method decode_latents (line 659) | def decode_latents(self, latents):
    method prepare_extra_step_kwargs (line 667) | def prepare_extra_step_kwargs(self, generator, eta):
    method prepare_latents (line 684) | def prepare_latents(self, image, timestep, batch_size, height, width, ...
    method __call__ (line 724) | def __call__(
    method latents_to_image (line 940) | def latents_to_image(self, latents):
    method text2img (line 946) | def text2img(
    method img2img (line 1041) | def img2img(
    method inpaint (line 1135) | def inpaint(

FILE: library/lumina_models.py
  class RMSNorm (line 57) | class RMSNorm(torch.nn.Module):
    method __init__ (line 58) | def __init__(self, dim: int, eps: float = 1e-6):
    method _norm (line 75) | def _norm(self, x) -> Tensor:
    method forward (line 88) | def forward(self, x: Tensor):
  class LuminaParams (line 107) | class LuminaParams:
    method __post_init__ (line 126) | def __post_init__(self):
    method get_2b_config (line 133) | def get_2b_config(cls) -> "LuminaParams":
    method get_7b_config (line 149) | def get_7b_config(cls) -> "LuminaParams":
  class GradientCheckpointMixin (line 162) | class GradientCheckpointMixin(nn.Module):
    method __init__ (line 163) | def __init__(self, *args, **kwargs) -> None:
    method enable_gradient_checkpointing (line 169) | def enable_gradient_checkpointing(self, cpu_offload: bool = False):
    method disable_gradient_checkpointing (line 172) | def disable_gradient_checkpointing(self, cpu_offload: bool = False):
    method forward (line 175) | def forward(self, *args, **kwargs):
  function modulate (line 183) | def modulate(x, scale):
  class TimestepEmbedder (line 192) | class TimestepEmbedder(GradientCheckpointMixin):
    method __init__ (line 197) | def __init__(self, hidden_size, frequency_embedding_size=256):
    method timestep_embedding (line 220) | def timestep_embedding(t, dim, max_period=10000):
    method _forward (line 238) | def _forward(self, t):
  function to_cuda (line 244) | def to_cuda(x):
  function to_cpu (line 255) | def to_cpu(x):
  class JointAttention (line 271) | class JointAttention(nn.Module):
    method __init__ (line 274) | def __init__(
    method set_attention_processor (line 329) | def set_attention_processor(self, attention_processor):
    method get_attention_processor (line 332) | def get_attention_processor(self):
    method forward (line 335) | def forward(
    method _upad_input (line 402) | def _upad_input(self, query_layer, key_layer, value_layer, attention_m...
    method sage_attn (line 454) | def sage_attn(self, q: Tensor, k: Tensor, v: Tensor, x_mask: Tensor, s...
    method flash_attn (line 507) | def flash_attn(
  function apply_rope (line 553) | def apply_rope(
  class FeedForward (line 584) | class FeedForward(nn.Module):
    method __init__ (line 585) | def __init__(
    method _forward_silu_gating (line 630) | def _forward_silu_gating(self, x1, x3):
    method forward (line 633) | def forward(self, x):
  class JointTransformerBlock (line 637) | class JointTransformerBlock(GradientCheckpointMixin):
    method __init__ (line 638) | def __init__(
    method _forward (line 700) | def _forward(
  class FinalLayer (line 752) | class FinalLayer(GradientCheckpointMixin):
    method __init__ (line 757) | def __init__(self, hidden_size, patch_size, out_channels):
    method forward (line 791) | def forward(self, x, c):
  class RopeEmbedder (line 798) | class RopeEmbedder:
    method __init__ (line 799) | def __init__(
    method __call__ (line 811) | def __call__(self, ids: torch.Tensor):
  class NextDiT (line 822) | class NextDiT(nn.Module):
    method __init__ (line 827) | def __init__(
    method device (line 966) | def device(self):
    method dtype (line 970) | def dtype(self):
    method enable_gradient_checkpointing (line 973) | def enable_gradient_checkpointing(self, cpu_offload: bool = False):
    method disable_gradient_checkpointing (line 986) | def disable_gradient_checkpointing(self):
    method unpatchify (line 999) | def unpatchify(
    method patchify_and_embed (line 1037) | def patchify_and_embed(
    method forward (line 1133) | def forward(self, x: Tensor, t: Tensor, cap_feats: Tensor, cap_mask: T...
    method forward_with_cfg (line 1167) | def forward_with_cfg(
    method precompute_freqs_cis (line 1222) | def precompute_freqs_cis(
    method parameter_count (line 1258) | def parameter_count(self) -> int:
    method get_fsdp_wrap_module_list (line 1271) | def get_fsdp_wrap_module_list(self) -> List[nn.Module]:
    method get_checkpointing_wrap_module_list (line 1274) | def get_checkpointing_wrap_module_list(self) -> List[nn.Module]:
    method enable_block_swap (line 1277) | def enable_block_swap(self, blocks_to_swap: int, device: torch.device):
    method move_to_device_except_swap_blocks (line 1298) | def move_to_device_except_swap_blocks(self, device: torch.device):
    method prepare_block_swap_before_forward (line 1315) | def prepare_block_swap_before_forward(self):
  function NextDiT_2B_GQA_patch2_Adaln_Refiner (line 1330) | def NextDiT_2B_GQA_patch2_Adaln_Refiner(params: Optional[LuminaParams] =...
  function NextDiT_3B_GQA_patch2_Adaln_Refiner (line 1351) | def NextDiT_3B_GQA_patch2_Adaln_Refiner(**kwargs):
  function NextDiT_4B_GQA_patch2_Adaln_Refiner (line 1364) | def NextDiT_4B_GQA_patch2_Adaln_Refiner(**kwargs):
  function NextDiT_7B_GQA_patch2_Adaln_Refiner (line 1377) | def NextDiT_7B_GQA_patch2_Adaln_Refiner(**kwargs):

FILE: library/lumina_train_util.py
  function batchify (line 36) | def batchify(
  function sample_images (line 102) | def sample_images(
  function sample_image_inference (line 249) | def sample_image_inference(
  function time_shift (line 480) | def time_shift(mu: float, sigma: float, t: torch.Tensor):
  function get_lin_function (line 486) | def get_lin_function(
  function get_schedule (line 507) | def get_schedule(
  function retrieve_timesteps (line 542) | def retrieve_timesteps(
  function denoise (line 606) | def denoise(
  function get_sigmas (line 714) | def get_sigmas(
  function compute_density_for_timestep_sampling (line 745) | def compute_density_for_timestep_sampling(
  function compute_loss_weighting_for_sd3 (line 783) | def compute_loss_weighting_for_sd3(weighting_scheme: str, sigmas=None) -...
  function get_noisy_model_input_and_timesteps (line 807) | def get_noisy_model_input_and_timesteps(
  function apply_model_prediction_type (line 876) | def apply_model_prediction_type(
  function save_models (line 910) | def save_models(
  function save_lumina_model_on_train_end (line 946) | def save_lumina_model_on_train_end(
  function save_lumina_model_on_epoch_end_or_stepwise (line 972) | def save_lumina_model_on_epoch_end_or_stepwise(
  function add_lumina_train_arguments (line 1025) | def add_lumina_train_arguments(parser: argparse.ArgumentParser):

FILE: library/lumina_util.py
  function load_lumina_model (line 24) | def load_lumina_model(
  function load_ae (line 67) | def load_ae(
  function load_gemma2 (line 104) | def load_gemma2(
  function unpack_latents (line 188) | def unpack_latents(x: torch.Tensor, packed_latent_height: int, packed_la...
  function pack_latents (line 196) | def pack_latents(x: torch.Tensor) -> torch.Tensor:
  function convert_diffusers_sd_to_alpha_vllm (line 234) | def convert_diffusers_sd_to_alpha_vllm(sd: dict, num_double_blocks: int)...

FILE: library/model_util.py
  function shave_segments (line 62) | def shave_segments(path, n_shave_prefix_segments=1):
  function renew_resnet_paths (line 72) | def renew_resnet_paths(old_list, n_shave_prefix_segments=0):
  function renew_vae_resnet_paths (line 94) | def renew_vae_resnet_paths(old_list, n_shave_prefix_segments=0):
  function renew_attention_paths (line 110) | def renew_attention_paths(old_list, n_shave_prefix_segments=0):
  function renew_vae_attention_paths (line 131) | def renew_vae_attention_paths(old_list, n_shave_prefix_segments=0):
  function assign_to_checkpoint (line 174) | def assign_to_checkpoint(
  function conv_attn_to_linear (line 234) | def conv_attn_to_linear(checkpoint):
  function linear_transformer_to_conv (line 246) | def linear_transformer_to_conv(checkpoint):
  function convert_ldm_unet_checkpoint (line 255) | def convert_ldm_unet_checkpoint(v2, checkpoint, config):
  function convert_ldm_vae_checkpoint (line 404) | def convert_ldm_vae_checkpoint(checkpoint, config):
  function create_unet_diffusers_config (line 508) | def create_unet_diffusers_config(v2, use_linear_projection_in_v2=False):
  function create_vae_diffusers_config (line 548) | def create_vae_diffusers_config():
  function convert_ldm_clip_checkpoint_v1 (line 571) | def convert_ldm_clip_checkpoint_v1(checkpoint):
  function convert_ldm_clip_checkpoint_v2 (line 585) | def convert_ldm_clip_checkpoint_v2(checkpoint, max_length):
  function conv_transformer_to_linear (line 668) | def conv_transformer_to_linear(checkpoint):
  function convert_unet_state_dict_to_sd (line 677) | def convert_unet_state_dict_to_sd(v2, unet_state_dict):
  function controlnet_conversion_map (line 773) | def controlnet_conversion_map():
  function convert_controlnet_state_dict_to_sd (line 834) | def convert_controlnet_state_dict_to_sd(controlnet_state_dict):
  function convert_controlnet_state_dict_to_diffusers (line 853) | def convert_controlnet_state_dict_to_diffusers(controlnet_state_dict):
  function reshape_weight_for_sd (line 877) | def reshape_weight_for_sd(w):
  function convert_vae_state_dict (line 882) | def convert_vae_state_dict(vae_state_dict):
  function is_safetensors (line 964) | def is_safetensors(path):
  function load_checkpoint_with_text_encoder_conversion (line 968) | def load_checkpoint_with_text_encoder_conversion(ckpt_path, device="cpu"):
  function load_models_from_stable_diffusion_checkpoint (line 1002) | def load_models_from_stable_diffusion_checkpoint(v2, ckpt_path, device="...
  function get_model_version_str_for_sd1_sd2 (line 1081) | def get_model_version_str_for_sd1_sd2(v2, v_parameterization):
  function convert_text_encoder_state_dict_to_sd_v2 (line 1093) | def convert_text_encoder_state_dict_to_sd_v2(checkpoint, make_dummy_weig...
  function save_stable_diffusion_checkpoint (line 1164) | def save_stable_diffusion_checkpoint(
  function save_diffusers_checkpoint (line 1235) | def save_diffusers_checkpoint(v2, output_dir, text_encoder, unet, pretra...
  function load_vae (line 1269) | def load_vae(vae_id, dtype):
  function make_bucket_resolutions (line 1316) | def make_bucket_resolutions(max_reso, min_size=256, max_size=1024, divis...

FILE: library/original_unet.py
  function exists (line 153) | def exists(val):
  function default (line 157) | def default(val, d):
  class FlashAttentionFunction (line 166) | class FlashAttentionFunction(torch.autograd.Function):
    method forward (line 169) | def forward(ctx, q, k, v, mask, causal, q_bucket_size, k_bucket_size):
    method backward (line 249) | def backward(ctx, do):
  function get_parameter_dtype (line 321) | def get_parameter_dtype(parameter: torch.nn.Module):
  function get_parameter_device (line 325) | def get_parameter_device(parameter: torch.nn.Module):
  function get_timestep_embedding (line 329) | def get_timestep_embedding(
  function resize_like (line 371) | def resize_like(x, target, mode="bicubic", align_corners=False):
  class SampleOutput (line 387) | class SampleOutput:
    method __init__ (line 388) | def __init__(self, sample):
  class TimestepEmbedding (line 392) | class TimestepEmbedding(nn.Module):
    method __init__ (line 393) | def __init__(self, in_channels: int, time_embed_dim: int, act_fn: str ...
    method forward (line 409) | def forward(self, sample):
  class Timesteps (line 419) | class Timesteps(nn.Module):
    method __init__ (line 420) | def __init__(self, num_channels: int, flip_sin_to_cos: bool, downscale...
    method forward (line 426) | def forward(self, timesteps):
  class ResnetBlock2D (line 436) | class ResnetBlock2D(nn.Module):
    method __init__ (line 437) | def __init__(
    method forward (line 464) | def forward(self, input_tensor, temb):
  class DownBlock2D (line 488) | class DownBlock2D(nn.Module):
    method __init__ (line 489) | def __init__(
    method set_use_memory_efficient_attention (line 517) | def set_use_memory_efficient_attention(self, xformers, mem_eff):
    method set_use_sdpa (line 520) | def set_use_sdpa(self, sdpa):
    method forward (line 523) | def forward(self, hidden_states, temb=None):
  class Downsample2D (line 552) | class Downsample2D(nn.Module):
    method __init__ (line 553) | def __init__(self, channels, out_channels):
    method forward (line 561) | def forward(self, hidden_states):
  class CrossAttention (line 568) | class CrossAttention(nn.Module):
    method __init__ (line 569) | def __init__(
    method set_use_memory_efficient_attention (line 600) | def set_use_memory_efficient_attention(self, xformers, mem_eff):
    method set_use_sdpa (line 604) | def set_use_sdpa(self, sdpa):
    method reshape_heads_to_batch_dim (line 607) | def reshape_heads_to_batch_dim(self, tensor):
    method reshape_batch_dim_to_heads (line 614) | def reshape_batch_dim_to_heads(self, tensor):
    method set_processor (line 621) | def set_processor(self):
    method get_processor (line 624) | def get_processor(self):
    method forward (line 627) | def forward(self, hidden_states, context=None, mask=None, **kwargs):
    method _attention (line 660) | def _attention(self, query, key, value):
    method forward_memory_efficient_xformers (line 685) | def forward_memory_efficient_xformers(self, x, context=None, mask=None):
    method forward_memory_efficient_mem_eff (line 708) | def forward_memory_efficient_mem_eff(self, x, context=None, mask=None):
    method forward_sdpa (line 731) | def forward_sdpa(self, x, context=None, mask=None):
  function translate_attention_names_from_diffusers (line 750) | def translate_attention_names_from_diffusers(
  class GEGLU (line 768) | class GEGLU(nn.Module):
    method __init__ (line 777) | def __init__(self, dim_in: int, dim_out: int):
    method gelu (line 781) | def gelu(self, gate):
    method forward (line 787) | def forward(self, hidden_states):
  class FeedForward (line 792) | class FeedForward(nn.Module):
    method __init__ (line 793) | def __init__(
    method forward (line 808) | def forward(self, hidden_states):
  class BasicTransformerBlock (line 814) | class BasicTransformerBlock(nn.Module):
    method __init__ (line 815) | def __init__(
    method set_use_memory_efficient_attention (line 845) | def set_use_memory_efficient_attention(self, xformers: bool, mem_eff: ...
    method set_use_sdpa (line 849) | def set_use_sdpa(self, sdpa: bool):
    method forward (line 853) | def forward(self, hidden_states, context=None, timestep=None):
  class Transformer2DModel (line 869) | class Transformer2DModel(nn.Module):
    method __init__ (line 870) | def __init__(
    method set_use_memory_efficient_attention (line 910) | def set_use_memory_efficient_attention(self, xformers, mem_eff):
    method set_use_sdpa (line 914) | def set_use_sdpa(self, sdpa):
    method forward (line 918) | def forward(self, hidden_states, encoder_hidden_states=None, timestep=...
  class CrossAttnDownBlock2D (line 953) | class CrossAttnDownBlock2D(nn.Module):
    method __init__ (line 954) | def __init__(
    method set_use_memory_efficient_attention (line 995) | def set_use_memory_efficient_attention(self, xformers, mem_eff):
    method set_use_sdpa (line 999) | def set_use_sdpa(self, sdpa):
    method forward (line 1003) | def forward(self, hidden_states, temb=None, encoder_hidden_states=None):
  class UNetMidBlock2DCrossAttn (line 1039) | class UNetMidBlock2DCrossAttn(nn.Module):
    method __init__ (line 1040) | def __init__(
    method set_use_memory_efficient_attention (line 1078) | def set_use_memory_efficient_attention(self, xformers, mem_eff):
    method set_use_sdpa (line 1082) | def set_use_sdpa(self, sdpa):
    method forward (line 1086) | def forward(self, hidden_states, temb=None, encoder_hidden_states=None):
  class Upsample2D (line 1117) | class Upsample2D(nn.Module):
    method __init__ (line 1118) | def __init__(self, channels, out_channels):
    method forward (line 1124) | def forward(self, hidden_states, output_size):
  class UpBlock2D (line 1153) | class UpBlock2D(nn.Module):
    method __init__ (line 1154) | def __init__(
    method set_use_memory_efficient_attention (line 1186) | def set_use_memory_efficient_attention(self, xformers, mem_eff):
    method set_use_sdpa (line 1189) | def set_use_sdpa(self, sdpa):
    method forward (line 1192) | def forward(self, hidden_states, res_hidden_states_tuple, temb=None, u...
  class CrossAttnUpBlock2D (line 1221) | class CrossAttnUpBlock2D(nn.Module):
    method __init__ (line 1222) | def __init__(
    method set_use_memory_efficient_attention (line 1271) | def set_use_memory_efficient_attention(self, xformers, mem_eff):
    method set_use_sdpa (line 1275) | def set_use_sdpa(self, sdpa):
    method forward (line 1279) | def forward(
  function get_down_block (line 1322) | def get_down_block(
  function get_up_block (line 1350) | def get_up_block(
  class UNet2DConditionModel (line 1381) | class UNet2DConditionModel(nn.Module):
    method __init__ (line 1384) | def __init__(
    method prepare_config (line 1491) | def prepare_config(self, *args, **kwargs):
    method dtype (line 1495) | def dtype(self) -> torch.dtype:
    method device (line 1500) | def device(self) -> torch.device:
    method set_attention_slice (line 1504) | def set_attention_slice(self, slice_size):
    method is_gradient_checkpointing (line 1507) | def is_gradient_checkpointing(self) -> bool:
    method enable_gradient_checkpointing (line 1510) | def enable_gradient_checkpointing(self):
    method disable_gradient_checkpointing (line 1513) | def disable_gradient_checkpointing(self):
    method set_use_memory_efficient_attention (line 1516) | def set_use_memory_efficient_attention(self, xformers: bool, mem_eff: ...
    method set_use_sdpa (line 1521) | def set_use_sdpa(self, sdpa: bool) -> None:
    method set_gradient_checkpointing (line 1526) | def set_gradient_checkpointing(self, value=False):
    method forward (line 1534) | def forward(
    method handle_unusual_timesteps (line 1656) | def handle_unusual_timesteps(self, sample, timesteps):
  class InferUNet2DConditionModel (line 1678) | class InferUNet2DConditionModel:
    method __init__ (line 1679) | def __init__(self, original_unet: UNet2DConditionModel):
    method __getattr__ (line 1716) | def __getattr__(self, name):
    method __call__ (line 1719) | def __call__(self, *args, **kwargs):
    method set_deep_shrink (line 1722) | def set_deep_shrink(self, ds_depth_1, ds_timesteps_1=650, ds_depth_2=N...
    method up_block_forward (line 1740) | def up_block_forward(self, _self, hidden_states, res_hidden_states_tup...
    method cross_attn_up_block_forward (line 1759) | def cross_attn_up_block_forward(
    method forward (line 1787) | def forward(

FILE: library/qwen_image_autoencoder_kl.py
  class DiagonalGaussianDistribution (line 49) | class DiagonalGaussianDistribution(object):
    method __init__ (line 50) | def __init__(self, parameters: torch.Tensor, deterministic: bool = Fal...
    method sample (line 60) | def sample(self, generator: Optional[torch.Generator] = None) -> torch...
    method kl (line 72) | def kl(self, other: "DiagonalGaussianDistribution" = None) -> torch.Te...
    method nll (line 87) | def nll(self, sample: torch.Tensor, dims: Tuple[int, ...] = [1, 2, 3])...
    method mode (line 96) | def mode(self) -> torch.Tensor:
  class ChunkedConv2d (line 103) | class ChunkedConv2d(nn.Conv2d):
    method __init__ (line 115) | def __init__(self, *args, **kwargs):
    method forward (line 129) | def forward(self, x: torch.Tensor) -> torch.Tensor:
  class QwenImageCausalConv3d (line 191) | class QwenImageCausalConv3d(nn.Conv3d):
    method __init__ (line 206) | def __init__(
    method _forward_chunked_height (line 231) | def _forward_chunked_height(self, x: torch.Tensor) -> torch.Tensor:
    method forward (line 263) | def forward(self, x, cache_x=None):
  class QwenImageRMS_norm (line 273) | class QwenImageRMS_norm(nn.Module):
    method __init__ (line 285) | def __init__(self, dim: int, channel_first: bool = True, images: bool ...
    method forward (line 295) | def forward(self, x):
  class QwenImageUpsample (line 299) | class QwenImageUpsample(nn.Upsample):
    method forward (line 310) | def forward(self, x):
  class QwenImageResample (line 314) | class QwenImageResample(nn.Module):
    method __init__ (line 328) | def __init__(self, dim: int, mode: str) -> None:
    method forward (line 355) | def forward(self, x, feat_cache=None, feat_idx=[0]):
  class QwenImageResidualBlock (line 399) | class QwenImageResidualBlock(nn.Module):
    method __init__ (line 410) | def __init__(
    method forward (line 431) | def forward(self, x, feat_cache=None, feat_idx=[0]):
  class QwenImageAttentionBlock (line 474) | class QwenImageAttentionBlock(nn.Module):
    method __init__ (line 482) | def __init__(self, dim):
    method forward (line 491) | def forward(self, x):
  class QwenImageMidBlock (line 519) | class QwenImageMidBlock(nn.Module):
    method __init__ (line 529) | def __init__(self, dim: int, dropout: float = 0.0, non_linearity: str ...
    method forward (line 544) | def forward(self, x, feat_cache=None, feat_idx=[0]):
  class QwenImageEncoder3d (line 558) | class QwenImageEncoder3d(nn.Module):
    method __init__ (line 574) | def __init__(
    method forward (line 628) | def forward(self, x, feat_cache=None, feat_idx=[0]):
  class QwenImageUpBlock (line 668) | class QwenImageUpBlock(nn.Module):
    method __init__ (line 681) | def __init__(
    method forward (line 711) | def forward(self, x, feat_cache=None, feat_idx=[0]):
  class QwenImageDecoder3d (line 737) | class QwenImageDecoder3d(nn.Module):
    method __init__ (line 753) | def __init__(
    method forward (line 819) | def forward(self, x, feat_cache=None, feat_idx=[0]):
  class AutoencoderKLQwenImage (line 857) | class AutoencoderKLQwenImage(nn.Module):  # ModelMixin, ConfigMixin, Fro...
    method __init__ (line 868) | def __init__(
    method dtype (line 969) | def dtype(self):
    method device (line 973) | def device(self):
    method enable_tiling (line 976) | def enable_tiling(
    method disable_tiling (line 1006) | def disable_tiling(self) -> None:
    method enable_slicing (line 1013) | def enable_slicing(self) -> None:
    method disable_slicing (line 1020) | def disable_slicing(self) -> None:
    method enable_spatial_chunking (line 1027) | def enable_spatial_chunking(self, spatial_chunk_size: int) -> None:
    method disable_spatial_chunking (line 1040) | def disable_spatial_chunking(self) -> None:
    method disable_cache (line 1051) | def disable_cache(self) -> None:
    method clear_cache (line 1060) | def clear_cache(self):
    method _encode (line 1076) | def _encode(self, x: torch.Tensor):
    method encode (line 1102) | def encode(
    method _decode (line 1127) | def _decode(self, z: torch.Tensor, return_dict: bool = True):
    method decode (line 1154) | def decode(self, z: torch.Tensor, return_dict: bool = True) -> Union[D...
    method decode_to_pixels (line 1178) | def decode_to_pixels(self, latents: torch.Tensor) -> torch.Tensor:
    method encode_pixels_to_latents (line 1194) | def encode_pixels_to_latents(self, pixels: torch.Tensor) -> torch.Tensor:
    method blend_v (line 1229) | def blend_v(self, a: torch.Tensor, b: torch.Tensor, blend_extent: int)...
    method blend_h (line 1235) | def blend_h(self, a: torch.Tensor, b: torch.Tensor, blend_extent: int)...
    method tiled_encode (line 1241) | def tiled_encode(self, x: torch.Tensor) -> torch.Tensor:
    method tiled_decode (line 1307) | def tiled_decode(self, z: torch.Tensor, return_dict: bool = True) -> U...
    method forward (line 1370) | def forward(
  function convert_comfyui_state_dict (line 1399) | def convert_comfyui_state_dict(sd):
  function load_vae (line 1542) | def load_vae(
  function encode_decode_image (line 1665) | def encode_decode_image(image_path, output_path):
  function process_directory (line 1688) | def process_directory(input_dir, output_dir):

FILE: library/safetensors_utils.py
  function mem_eff_save_file (line 15) | def mem_eff_save_file(tensors: Dict[str, torch.Tensor], filename: str, m...
  class MemoryEfficientSafeOpen (line 86) | class MemoryEfficientSafeOpen:
    method __init__ (line 93) | def __init__(self, filename, disable_numpy_memmap=False):
    method __enter__ (line 105) | def __enter__(self):
    method __exit__ (line 109) | def __exit__(self, exc_type, exc_val, exc_tb):
    method keys (line 113) | def keys(self):
    method metadata (line 121) | def metadata(self) -> Dict[str, str]:
    method _read_header (line 129) | def _read_header(self):
    method get_tensor (line 141) | def get_tensor(self, key: str, device: Optional[torch.device] = None, ...
    method _deserialize_tensor (line 217) | def _deserialize_tensor(self, byte_tensor: torch.Tensor, metadata: Dict):
    method _get_torch_dtype (line 238) | def _get_torch_dtype(dtype_str):
    method _convert_float8 (line 268) | def _convert_float8(byte_tensor, dtype_str, shape):
  function load_safetensors (line 292) | def load_safetensors(
  function get_split_weight_filenames (line 321) | def get_split_weight_filenames(file_path: str) -> Optional[list[str]]:
  function load_split_weights (line 344) | def load_split_weights(
  function find_key (line 364) | def find_key(safetensors_file: str, starts_with: Optional[str] = None, e...
  class WeightTransformHooks (line 379) | class WeightTransformHooks:
  class TensorWeightAdapter (line 385) | class TensorWeightAdapter:
    method __init__ (line 403) | def __init__(self, weight_convert_hook: WeightTransformHooks, original...
    method keys (line 447) | def keys(self) -> list[str]:
    method get_tensor (line 450) | def get_tensor(self, new_key: str, device: Optional[torch.device] = No...

FILE: library/sai_model_spec.py
  class ModelSpecMetadata (line 104) | class ModelSpecMetadata:
    method to_metadata_dict (line 142) | def to_metadata_dict(self) -> dict[str, str]:
    method from_args (line 161) | def from_args(cls, args, **kwargs) -> "ModelSpecMetadata":
  function determine_architecture (line 193) | def determine_architecture(
  function determine_implementation (line 246) | def determine_implementation(
  function get_implementation_version (line 272) | def get_implementation_version() -> str:
  function file_to_data_url (line 296) | def file_to_data_url(file_path: str) -> str:
  function determine_resolution (line 316) | def determine_resolution(
  function load_bytes_in_safetensors (line 349) | def load_bytes_in_safetensors(tensors):
  function precalculate_safetensors_hashes (line 363) | def precalculate_safetensors_hashes(state_dict):
  function update_hash_sha256 (line 374) | def update_hash_sha256(metadata: dict, state_dict: dict):
  function build_metadata_dataclass (line 378) | def build_metadata_dataclass(
  function build_metadata (line 501) | def build_metadata(
  function get_title (line 559) | def get_title(metadata: dict) -> str | None:
  function load_metadata_from_safetensors (line 563) | def load_metadata_from_safetensors(model: str) -> dict:
  function build_merged_from (line 574) | def build_merged_from(models: list[str]) -> str:
  function add_model_spec_arguments (line 586) | def add_model_spec_arguments(parser: argparse.ArgumentParser):

FILE: library/sd3_models.py
  class SD3Params (line 48) | class SD3Params:
  function get_2d_sincos_pos_embed (line 61) | def get_2d_sincos_pos_embed(
  function get_2d_sincos_pos_embed_from_grid (line 81) | def get_2d_sincos_pos_embed_from_grid(embed_dim, grid):
  function get_scaled_2d_sincos_pos_embed (line 92) | def get_scaled_2d_sincos_pos_embed(embed_dim, grid_size, cls_token=False...
  function get_1d_sincos_pos_embed_from_grid (line 164) | def get_1d_sincos_pos_embed_from_grid(embed_dim, pos):
  function get_1d_sincos_pos_embed_from_grid_torch (line 185) | def get_1d_sincos_pos_embed_from_grid_torch(
  function get_2d_sincos_pos_embed_torch (line 199) | def get_2d_sincos_pos_embed_torch(
  function modulate (line 222) | def modulate(x, shift, scale):
  function default (line 228) | def default(x, default_value):
  function timestep_embedding (line 234) | def timestep_embedding(t, dim, max_period=10000):
  class PatchEmbed (line 249) | class PatchEmbed(nn.Module):
    method __init__ (line 250) | def __init__(
    method forward (line 280) | def forward(self, x):
  class UnPatch (line 296) | class UnPatch(nn.Module):
    method __init__ (line 297) | def __init__(self, hidden_size=512, patch_size=4, out_channels=3):
    method forward (line 310) | def forward(self, x: torch.Tensor, cmod, H=None, W=None):
  class MLP (line 332) | class MLP(nn.Module):
    method __init__ (line 333) | def __init__(
    method forward (line 355) | def forward(self, x):
  class TimestepEmbedding (line 363) | class TimestepEmbedding(nn.Module):
    method __init__ (line 364) | def __init__(self, hidden_size, freq_embed_size=256):
    method forward (line 373) | def forward(self, t, dtype=None, **kwargs):
  class Embedder (line 379) | class Embedder(nn.Module):
    method __init__ (line 380) | def __init__(self, input_dim, hidden_size):
    method forward (line 388) | def forward(self, x):
  function rmsnorm (line 392) | def rmsnorm(x, eps=1e-6):
  class RMSNorm (line 396) | class RMSNorm(torch.nn.Module):
    method __init__ (line 397) | def __init__(
    method forward (line 422) | def forward(self, x):
  class SwiGLUFeedForward (line 437) | class SwiGLUFeedForward(nn.Module):
    method __init__ (line 438) | def __init__(
    method forward (line 456) | def forward(self, x):
  class AttentionLinears (line 461) | class AttentionLinears(nn.Module):
    method __init__ (line 462) | def __init__(
    method pre_attention (line 491) | def pre_attention(self, x: torch.Tensor) -> torch.Tensor:
    method post_attention (line 503) | def post_attention(self, x: torch.Tensor) -> torch.Tensor:
  function vanilla_attention (line 532) | def vanilla_attention(q, k, v, mask, scale=None):
  function attention (line 545) | def attention(q, k, v, head_dim, mask=None, scale=None, mode="xformers"):
  class SingleDiTBlock (line 569) | class SingleDiTBlock(nn.Module):
    method __init__ (line 574) | def __init__(
    method pre_attention (line 633) | def pre_attention(self, x: torch.Tensor, c: torch.Tensor) -> torch.Ten...
    method pre_attention_x (line 652) | def pre_attention_x(self, x: torch.Tensor, c: torch.Tensor) -> torch.T...
    method post_attention (line 662) | def post_attention(self, attn, x, gate_msa, shift_mlp, scale_mlp, gate...
    method post_attention_x (line 668) | def post_attention_x(self, attn, attn2, x, gate_msa, shift_mlp, scale_...
  class MMDiTBlock (line 685) | class MMDiTBlock(nn.Module):
    method __init__ (line 686) | def __init__(self, *args, **kwargs):
    method enable_gradient_checkpointing (line 698) | def enable_gradient_checkpointing(self):
    method _forward (line 701) | def _forward(self, context, x, c):
    method forward (line 733) | def forward(self, *args, **kwargs):
  class MMDiT (line 740) | class MMDiT(nn.Module):
    method __init__ (line 748) | def __init__(
    method enable_scaled_pos_embed (line 869) | def enable_scaled_pos_embed(self, use_scaled_pos_embed: bool, latent_s...
    method model_type (line 910) | def model_type(self):
    method device (line 914) | def device(self):
    method dtype (line 918) | def dtype(self):
    method enable_gradient_checkpointing (line 921) | def enable_gradient_checkpointing(self):
    method disable_gradient_checkpointing (line 926) | def disable_gradient_checkpointing(self):
    method initialize_weights (line 931) | def initialize_weights(self):
    method set_pos_emb_random_crop_rate (line 977) | def set_pos_emb_random_crop_rate(self, rate: float):
    method cropped_pos_embed (line 980) | def cropped_pos_embed(self, h, w, device=None, random_crop: bool = Fal...
    method cropped_scaled_pos_embed (line 1008) | def cropped_scaled_pos_embed(self, h, w, device=None, dtype=None, rand...
    method enable_block_swap (line 1075) | def enable_block_swap(self, num_blocks: int, device: torch.device):
    method move_to_device_except_swap_blocks (line 1087) | def move_to_device_except_swap_blocks(self, device: torch.device):
    method prepare_block_swap_before_forward (line 1098) | def prepare_block_swap_before_forward(self):
    method forward (line 1103) | def forward(
  function create_sd3_mmdit (line 1159) | def create_sd3_mmdit(params: SD3Params, attn_mode: str = "torch") -> MMDiT:
  function Normalize (line 1187) | def Normalize(in_channels, num_groups=32, dtype=torch.float32, device=No...
  class ResnetBlock (line 1191) | class ResnetBlock(torch.nn.Module):
    method __init__ (line 1192) | def __init__(self, *, in_channels, out_channels=None, dtype=torch.floa...
    method forward (line 1210) | def forward(self, x):
  class AttnBlock (line 1223) | class AttnBlock(torch.nn.Module):
    method __init__ (line 1224) | def __init__(self, in_channels, dtype=torch.float32, device=None):
    method forward (line 1232) | def forward(self, x):
  class Downsample (line 1245) | class Downsample(torch.nn.Module):
    method __init__ (line 1246) | def __init__(self, in_channels, dtype=torch.float32, device=None):
    method forward (line 1250) | def forward(self, x):
  class Upsample (line 1257) | class Upsample(torch.nn.Module):
    method __init__ (line 1258) | def __init__(self, in_channels, dtype=torch.float32, device=None):
    method forward (line 1262) | def forward(self, x):
  class VAEEncoder (line 1273) | class VAEEncoder(torch.nn.Module):
    method __init__ (line 1274) | def __init__(
    method forward (line 1309) | def forward(self, x):
  class VAEDecoder (line 1330) | class VAEDecoder(torch.nn.Module):
    method __init__ (line 1331) | def __init__(
    method forward (line 1373) | def forward(self, z):
  class SDVAE (line 1393) | class SDVAE(torch.nn.Module):
    method __init__ (line 1394) | def __init__(self, dtype=torch.float32, device=None):
    method device (line 1400) | def device(self):
    method dtype (line 1404) | def dtype(self):
    method decode (line 1408) | def decode(self, latent):
    method encode (line 1412) | def encode(self, image):
    method process_in (line 1420) | def process_in(latent):
    method process_out (line 1424) | def process_out(latent):

FILE: library/sd3_train_utils.py
  function save_models (line 34) | def save_models(
  function save_sd3_model_on_train_end (line 88) | def save_sd3_model_on_train_end(
  function save_sd3_model_on_epoch_end_or_stepwise (line 110) | def save_sd3_model_on_epoch_end_or_stepwise(
  function add_sd3_training_arguments (line 144) | def add_sd3_training_arguments(parser: argparse.ArgumentParser):
  function verify_sdxl_training_args (line 245) | def verify_sdxl_training_args(args: argparse.Namespace, supportTextEncod...
  function get_all_sigmas (line 282) | def get_all_sigmas(sampling: sd3_utils.ModelSamplingDiscreteFlow, steps):
  function max_denoise (line 294) | def max_denoise(model_sampling, sigmas):
  function do_sample (line 300) | def do_sample(
  function sample_images (line 374) | def sample_images(
  function sample_image_inference (line 473) | def sample_image_inference(
  class FlowMatchEulerDiscreteSchedulerOutput (line 614) | class FlowMatchEulerDiscreteSchedulerOutput(BaseOutput):
  class FlowMatchEulerDiscreteScheduler (line 627) | class FlowMatchEulerDiscreteScheduler(SchedulerMixin, ConfigMixin):
    method __init__ (line 648) | def __init__(
    method step_index (line 669) | def step_index(self):
    method begin_index (line 676) | def begin_index(self):
    method set_begin_index (line 683) | def set_begin_index(self, begin_index: int = 0):
    method scale_noise (line 693) | def scale_noise(
    method _sigma_to_t (line 720) | def _sigma_to_t(self, sigma):
    method set_timesteps (line 723) | def set_timesteps(self, num_inference_steps: int, device: Union[str, t...
    method index_for_timestep (line 748) | def index_for_timestep(self, timestep, schedule_timesteps=None):
    method _init_step_index (line 762) | def _init_step_index(self, timestep):
    method step (line 770) | def step(
    method __len__ (line 861) | def __len__(self):
  function get_sigmas (line 865) | def get_sigmas(noise_scheduler, timesteps, device, n_dim=4, dtype=torch....
  function compute_density_for_timestep_sampling (line 877) | def compute_density_for_timestep_sampling(
  function compute_loss_weighting_for_sd3 (line 898) | def compute_loss_weighting_for_sd3(weighting_scheme: str, sigmas=None):
  function get_noisy_model_input_and_timesteps (line 918) | def get_noisy_model_input_and_timesteps(args, latents, noise, device, dt...

FILE: library/sd3_utils.py
  function analyze_state_dict_state (line 30) | def analyze_state_dict_state(state_dict: Dict, prefix: str = ""):
  function load_mmdit (line 78) | def load_mmdit(
  function load_clip_l (line 100) | def load_clip_l(
  function load_clip_g (line 160) | def load_clip_g(
  function load_t5xxl (line 215) | def load_t5xxl(
  function load_vae (line 239) | def load_vae(
  class ModelSamplingDiscreteFlow (line 270) | class ModelSamplingDiscreteFlow:
    method __init__ (line 273) | def __init__(self, shift=1.0):
    method sigma_min (line 279) | def sigma_min(self):
    method sigma_max (line 283) | def sigma_max(self):
    method timestep (line 286) | def timestep(self, sigma):
    method sigma (line 289) | def sigma(self, timestep: torch.Tensor):
    method calculate_denoised (line 295) | def calculate_denoised(self, sigma, model_output, model_input):
    method noise_scaling (line 299) | def noise_scaling(self, sigma, noise, latent_image, max_denoise=False):

FILE: library/sdxl_lpw_stable_diffusion.py
  function parse_prompt_attention (line 75) | def parse_prompt_attention(text):
  function get_prompts_with_weights (line 161) | def get_prompts_with_weights(pipe: StableDiffusionPipeline, prompt: List...
  function pad_tokens_and_weights (line 196) | def pad_tokens_and_weights(tokens, weights, max_length, bos, eos, pad, n...
  function get_hidden_states (line 221) | def get_hidden_states(text_encoder, input_ids, is_sdxl_text_encoder2: bo...
  function get_unweighted_text_embeddings (line 239) | def get_unweighted_text_embeddings(
  function get_weighted_text_embeddings (line 296) | def get_weighted_text_embeddings(
  function preprocess_image (line 437) | def preprocess_image(image):
  function preprocess_mask (line 447) | def preprocess_mask(mask, scale_factor=8):
  function prepare_controlnet_image (line 460) | def prepare_controlnet_image(
  class SdxlStableDiffusionLongPromptWeightingPipeline (line 512) | class SdxlStableDiffusionLongPromptWeightingPipeline:
    method __init__ (line 543) | def __init__(
    method to (line 578) | def to(self, device=None, dtype=None):
    method _execution_device (line 588) | def _execution_device(self):
    method check_inputs (line 605) | def check_inputs(self, prompt, height, width, strength, callback_steps):
    method get_timesteps (line 622) | def get_timesteps(self, num_inference_steps, strength, device, is_text...
    method run_safety_checker (line 635) | def run_safety_checker(self, image, device, dtype):
    method decode_latents (line 643) | def decode_latents(self, latents):
    method prepare_extra_step_kwargs (line 660) | def prepare_extra_step_kwargs(self, generator, eta):
    method prepare_latents (line 677) | def prepare_latents(self, image, timestep, batch_size, height, width, ...
    method __call__ (line 717) | def __call__(
    method latents_to_image (line 962) | def latents_to_image(self, latents):
    method numpy_to_pil (line 969) | def numpy_to_pil(self, images: np.ndarray) -> Image.Image:
    method text2img (line 984) | def text2img(
    method img2img (line 1079) | def img2img(
    method inpaint (line 1173) | def inpaint(

FILE: library/sdxl_model_util.py
  function convert_sdxl_text_encoder_2_checkpoint (line 73) | def convert_sdxl_text_encoder_2_checkpoint(checkpoint, max_length):
  function _load_state_dict_on_device (line 148) | def _load_state_dict_on_device(model, state_dict, device, dtype=None):
  function load_models_from_sdxl_checkpoint (line 169) | def load_models_from_sdxl_checkpoint(model_version, ckpt_path, map_locat...
  function make_unet_conversion_map (line 299) | def make_unet_conversion_map():
  function convert_diffusers_unet_state_dict_to_sdxl (line 383) | def convert_diffusers_unet_state_dict_to_sdxl(du_sd):
  function convert_unet_state_dict (line 390) | def convert_unet_state_dict(src_sd, conversion_map):
  function convert_sdxl_unet_state_dict_to_diffusers (line 408) | def convert_sdxl_unet_state_dict_to_diffusers(sd):
  function convert_text_encoder_2_state_dict_to_sdxl (line 415) | def convert_text_encoder_2_state_dict_to_sdxl(checkpoint, logit_scale):
  function save_stable_diffusion_checkpoint (line 479) | def save_stable_diffusion_checkpoint(
  function save_diffusers_checkpoint (line 534) | def save_diffusers_checkpoint(

FILE: library/sdxl_original_control_net.py
  class ControlNetConditioningEmbedding (line 22) | class ControlNetConditioningEmbedding(nn.Module):
    method __init__ (line 23) | def __init__(self):
    method forward (line 41) | def forward(self, x):
  class SdxlControlNet (line 51) | class SdxlControlNet(sdxl_original_unet.SdxlUNet2DConditionModel):
    method __init__ (line 52) | def __init__(self, multiplier: Optional[float] = None, **kwargs):
    method init_from_unet (line 73) | def init_from_unet(self, unet: sdxl_original_unet.SdxlUNet2DConditionM...
    method load_state_dict (line 81) | def load_state_dict(self, state_dict: dict, strict: bool = True, assig...
    method state_dict (line 91) | def state_dict(self, destination=None, prefix="", keep_vars=False):
    method forward (line 102) | def forward(
  class SdxlControlledUNet (line 148) | class SdxlControlledUNet(sdxl_original_unet.SdxlUNet2DConditionModel):
    method __init__ (line 153) | def __init__(self, **kwargs):
    method forward (line 156) | def forward(self, x, timesteps=None, context=None, y=None, input_resi_...

FILE: library/sdxl_original_unet.py
  function exists (line 62) | def exists(val):
  function default (line 66) | def default(val, d):
  class FlashAttentionFunction (line 75) | class FlashAttentionFunction(torch.autograd.Function):
    method forward (line 78) | def forward(ctx, q, k, v, mask, causal, q_bucket_size, k_bucket_size):
    method backward (line 158) | def backward(ctx, do):
  function get_parameter_dtype (line 230) | def get_parameter_dtype(parameter: torch.nn.Module):
  function get_parameter_device (line 234) | def get_parameter_device(parameter: torch.nn.Module):
  function get_timestep_embedding (line 238) | def get_timestep_embedding(
  function resize_like (line 275) | def resize_like(x, target, mode="bicubic", align_corners=False):
  class GroupNorm32 (line 291) | class GroupNorm32(nn.GroupNorm):
    method forward (line 292) | def forward(self, x):
  class ResnetBlock2D (line 298) | class ResnetBlock2D(nn.Module):
    method __init__ (line 299) | def __init__(
    method forward_body (line 330) | def forward_body(self, x, emb):
    method forward (line 338) | def forward(self, x, emb):
  class Downsample2D (line 355) | class Downsample2D(nn.Module):
    method __init__ (line 356) | def __init__(self, channels, out_channels):
    method forward_body (line 366) | def forward_body(self, hidden_states):
    method forward (line 372) | def forward(self, hidden_states):
  class CrossAttention (line 391) | class CrossAttention(nn.Module):
    method __init__ (line 392) | def __init__(
    method set_use_memory_efficient_attention (line 420) | def set_use_memory_efficient_attention(self, xformers, mem_eff):
    method set_use_sdpa (line 424) | def set_use_sdpa(self, sdpa):
    method reshape_heads_to_batch_dim (line 427) | def reshape_heads_to_batch_dim(self, tensor):
    method reshape_batch_dim_to_heads (line 434) | def reshape_batch_dim_to_heads(self, tensor):
    method forward (line 441) | def forward(self, hidden_states, context=None, mask=None):
    method _attention (line 465) | def _attention(self, query, key, value):
    method forward_memory_efficient_xformers (line 490) | def forward_memory_efficient_xformers(self, x, context=None, mask=None):
    method forward_memory_efficient_mem_eff (line 514) | def forward_memory_efficient_mem_eff(self, x, context=None, mask=None):
    method forward_sdpa (line 537) | def forward_sdpa(self, x, context=None, mask=None):
  class GEGLU (line 557) | class GEGLU(nn.Module):
    method __init__ (line 566) | def __init__(self, dim_in: int, dim_out: int):
    method gelu (line 570) | def gelu(self, gate):
    method forward (line 576) | def forward(self, hidden_states):
  class FeedForward (line 581) | class FeedForward(nn.Module):
    method __init__ (line 582) | def __init__(
    method forward (line 597) | def forward(self, hidden_states):
  class BasicTransformerBlock (line 603) | class BasicTransformerBlock(nn.Module):
    method __init__ (line 604) | def __init__(
    method set_use_memory_efficient_attention (line 636) | def set_use_memory_efficient_attention(self, xformers: bool, mem_eff: ...
    method set_use_sdpa (line 640) | def set_use_sdpa(self, sdpa: bool):
    method forward_body (line 644) | def forward_body(self, hidden_states, context=None, timestep=None):
    method forward (line 659) | def forward(self, hidden_states, context=None, timestep=None):
  class Transformer2DModel (line 678) | class Transformer2DModel(nn.Module):
    method __init__ (line 679) | def __init__(
    method set_use_memory_efficient_attention (line 725) | def set_use_memory_efficient_attention(self, xformers, mem_eff):
    method set_use_sdpa (line 729) | def set_use_sdpa(self, sdpa):
    method forward (line 733) | def forward(self, hidden_states, encoder_hidden_states=None, timestep=...
  class Upsample2D (line 765) | class Upsample2D(nn.Module):
    method __init__ (line 766) | def __init__(self, channels, out_channels):
    method forward_body (line 774) | def forward_body(self, hidden_states, output_size=None):
    method forward (line 802) | def forward(self, hidden_states, output_size=None):
  class SdxlUNet2DConditionModel (line 821) | class SdxlUNet2DConditionModel(nn.Module):
    method __init__ (line 824) | def __init__(
    method prepare_config (line 1022) | def prepare_config(self):
    method dtype (line 1026) | def dtype(self) -> torch.dtype:
    method device (line 1031) | def device(self) -> torch.device:
    method set_attention_slice (line 1035) | def set_attention_slice(self, slice_size):
    method is_gradient_checkpointing (line 1038) | def is_gradient_checkpointing(self) -> bool:
    method enable_gradient_checkpointing (line 1041) | def enable_gradient_checkpointing(self):
    method disable_gradient_checkpointing (line 1045) | def disable_gradient_checkpointing(self):
    method set_use_memory_efficient_attention (line 1049) | def set_use_memory_efficient_attention(self, xformers: bool, mem_eff: ...
    method set_use_sdpa (line 1057) | def set_use_sdpa(self, sdpa: bool) -> None:
    method set_gradient_checkpointing (line 1064) | def set_gradient_checkpointing(self, value=False):
    method forward (line 1074) | def forward(self, x, timesteps=None, context=None, y=None, **kwargs):
  class InferSdxlUNet2DConditionModel (line 1119) | class InferSdxlUNet2DConditionModel:
    method __init__ (line 1120) | def __init__(self, original_unet: SdxlUNet2DConditionModel, **kwargs):
    method __getattr__ (line 1135) | def __getattr__(self, name):
    method __call__ (line 1138) | def __call__(self, *args, **kwargs):
    method set_deep_shrink (line 1141) | def set_deep_shrink(self, ds_depth_1, ds_timesteps_1=650, ds_depth_2=N...
    method forward (line 1159) | def forward(self, x, timesteps=None, context=None, y=None, input_resi_...

FILE: library/sdxl_train_util.py
  function load_target_model (line 28) | def load_target_model(args, accelerator, model_version: str, weight_dtype):
  function _load_target_model (line 65) | def _load_target_model(
  function load_tokenizers (line 136) | def load_tokenizers(args: argparse.Namespace):
  function match_mixed_precision (line 167) | def match_mixed_precision(args, weight_dtype):
  function timestep_embedding (line 182) | def timestep_embedding(timesteps, dim, max_period=10000):
  function get_timestep_embedding (line 202) | def get_timestep_embedding(x, outdim):
  function get_size_embeddings (line 211) | def get_size_embeddings(orig_size, crop_size, target_size, device):
  function save_sd_model_on_train_end (line 219) | def save_sd_model_on_train_end(
  function save_sd_model_on_epoch_end_or_stepwise (line 269) | def save_sd_model_on_epoch_end_or_stepwise(
  function add_sdxl_training_arguments (line 329) | def add_sdxl_training_arguments(parser: argparse.ArgumentParser, support...
  function verify_sdxl_training_args (line 348) | def verify_sdxl_training_args(args: argparse.Namespace, support_text_enc...
  function sample_images (line 380) | def sample_images(*args, **kwargs):

FILE: library/slicing_vae.py
  function slice_h (line 34) | def slice_h(x, num_slices):
  function cat_h (line 53) | def cat_h(sliced):
  function resblock_forward (line 68) | def resblock_forward(_self, num_slices, input_tensor, temb, **kwargs):
  class SlicingEncoder (line 177) | class SlicingEncoder(nn.Module):
    method __init__ (line 178) | def __init__(
    method forward (line 268) | def forward(self, x):
    method downsample_forward (line 310) | def downsample_forward(self, _self, num_slices, hidden_states):
  class SlicingDecoder (line 360) | class SlicingDecoder(nn.Module):
    method __init__ (line 361) | def __init__(
    method forward (line 451) | def forward(self, z):
    method upsample_forward (line 489) | def upsample_forward(self, _self, num_slices, hidden_states, output_si...
  class SlicingAutoencoderKL (line 541) | class SlicingAutoencoderKL(ModelMixin, ConfigMixin):
    method __init__ (line 563) | def __init__(
    method encode (line 608) | def encode(self, x: torch.FloatTensor, return_dict: bool = True) -> Au...
    method _decode (line 618) | def _decode(self, z: torch.FloatTensor, return_dict: bool = True) -> U...
    method enable_slicing (line 628) | def enable_slicing(self):
    method disable_slicing (line 637) | def disable_slicing(self):
    method decode (line 644) | def decode(self, z: torch.FloatTensor, return_dict: bool = True) -> Un...
    method forward (line 656) | def forward(

FILE: library/strategy_anima.py
  class AnimaTokenizeStrategy (line 22) | class AnimaTokenizeStrategy(TokenizeStrategy):
    method __init__ (line 31) | def __init__(
    method tokenize (line 53) | def tokenize(self, text: Union[str, List[str]]) -> List[torch.Tensor]:
  class AnimaTextEncodingStrategy (line 72) | class AnimaTextEncodingStrategy(TextEncodingStrategy):
    method __init__ (line 79) | def __init__(self) -> None:
    method encode_tokens (line 82) | def encode_tokens(
    method drop_cached_text_encoder_outputs (line 109) | def drop_cached_text_encoder_outputs(
  class AnimaTextEncoderOutputsCachingStrategy (line 151) | class AnimaTextEncoderOutputsCachingStrategy(TextEncoderOutputsCachingSt...
    method __init__ (line 159) | def __init__(
    method get_outputs_npz_path (line 168) | def get_outputs_npz_path(self, image_abs_path: str) -> str:
    method is_disk_cached_outputs_expected (line 171) | def is_disk_cached_outputs_expected(self, npz_path: str) -> bool:
    method load_outputs_npz (line 197) | def load_outputs_npz(self, npz_path: str) -> List[np.ndarray]:
    method cache_batch_outputs (line 206) | def cache_batch_outputs(
  class AnimaLatentsCachingStrategy (line 250) | class AnimaLatentsCachingStrategy(LatentsCachingStrategy):
    method __init__ (line 259) | def __init__(self, cache_to_disk: bool, batch_size: int, skip_disk_cac...
    method cache_suffix (line 263) | def cache_suffix(self) -> str:
    method get_latents_npz_path (line 266) | def get_latents_npz_path(self, absolute_path: str, image_size: Tuple[i...
    method is_disk_cached_latents_expected (line 269) | def is_disk_cached_latents_expected(self, bucket_reso: Tuple[int, int]...
    method load_latents_from_disk (line 272) | def load_latents_from_disk(
    method cache_batch_latents (line 277) | def cache_batch_latents(self, vae, image_infos: List, flip_aug: bool, ...

FILE: library/strategy_base.py
  class TokenizeStrategy (line 23) | class TokenizeStrategy:
    method set_strategy (line 45) | def set_strategy(cls, strategy):
    method get_strategy (line 51) | def get_strategy(cls) -> Optional["TokenizeStrategy"]:
    method _load_tokenizer (line 54) | def _load_tokenizer(
    method tokenize (line 73) | def tokenize(self, text: Union[str, List[str]]) -> List[torch.Tensor]:
    method tokenize_with_weights (line 76) | def tokenize_with_weights(self, text: Union[str, List[str]]) -> Tuple[...
    method _get_weighted_input_ids (line 82) | def _get_weighted_input_ids(
    method _get_input_ids (line 221) | def _get_input_ids(
  class TextEncodingStrategy (line 287) | class TextEncodingStrategy:
    method set_strategy (line 291) | def set_strategy(cls, strategy):
    method get_strategy (line 297) | def get_strategy(cls) -> Optional["TextEncodingStrategy"]:
    method encode_tokens (line 300) | def encode_tokens(
    method encode_tokens_with_weights (line 310) | def encode_tokens_with_weights(
  class TextEncoderOutputsCachingStrategy (line 322) | class TextEncoderOutputsCachingStrategy:
    method __init__ (line 325) | def __init__(
    method set_strategy (line 340) | def set_strategy(cls, strategy):
    method get_strategy (line 346) | def get_strategy(cls) -> Optional["TextEncoderOutputsCachingStrategy"]:
    method cache_to_disk (line 350) | def cache_to_disk(self):
    method batch_size (line 354) | def batch_size(self):
    method is_partial (line 358) | def is_partial(self):
    method is_weighted (line 362) | def is_weighted(self):
    method get_outputs_npz_path (line 365) | def get_outputs_npz_path(self, image_abs_path: str) -> str:
    method load_outputs_npz (line 368) | def load_outputs_npz(self, npz_path: str) -> List[np.ndarray]:
    method is_disk_cached_outputs_expected (line 371) | def is_disk_cached_outputs_expected(self, npz_path: str) -> bool:
    method cache_batch_outputs (line 374) | def cache_batch_outputs(
  class LatentsCachingStrategy (line 380) | class LatentsCachingStrategy:
    method __init__ (line 385) | def __init__(self, cache_to_disk: bool, batch_size: int, skip_disk_cac...
    method set_strategy (line 391) | def set_strategy(cls, strategy):
    method get_strategy (line 397) | def get_strategy(cls) -> Optional["LatentsCachingStrategy"]:
    method cache_to_disk (line 401) | def cache_to_disk(self):
    method batch_size (line 405) | def batch_size(self):
    method cache_suffix (line 409) | def cache_suffix(self):
    method get_image_size_from_disk_cache_path (line 412) | def get_image_size_from_disk_cache_path(self, absolute_path: str, npz_...
    method get_latents_npz_path (line 416) | def get_latents_npz_path(self, absolute_path: str, image_size: Tuple[i...
    method is_disk_cached_latents_expected (line 419) | def is_disk_cached_latents_expected(
    method cache_batch_latents (line 424) | def cache_batch_latents(self, model: Any, batch: List, flip_aug: bool,...
    method _default_is_disk_cached_latents_expected (line 427) | def _default_is_disk_cached_latents_expected(
    method _default_cache_batch_latents (line 475) | def _default_cache_batch_latents(
    method load_latents_from_disk (line 542) | def load_latents_from_disk(
    method _default_load_latents_from_disk (line 563) | def _default_load_latents_from_disk(
    method save_latents_to_disk (line 598) | def save_latents_to_disk(

FILE: library/strategy_flux.py
  class FluxTokenizeStrategy (line 23) | class FluxTokenizeStrategy(TokenizeStrategy):
    method __init__ (line 24) | def __init__(self, t5xxl_max_length: int = 512, tokenizer_cache_dir: O...
    method tokenize (line 29) | def tokenize(self, text: Union[str, List[str]]) -> List[torch.Tensor]:
  class FluxTextEncodingStrategy (line 42) | class FluxTextEncodingStrategy(TextEncodingStrategy):
    method __init__ (line 43) | def __init__(self, apply_t5_attn_mask: Optional[bool] = None) -> None:
    method encode_tokens (line 50) | def encode_tokens(
  class FluxTextEncoderOutputsCachingStrategy (line 88) | class FluxTextEncoderOutputsCachingStrategy(TextEncoderOutputsCachingStr...
    method __init__ (line 91) | def __init__(
    method get_outputs_npz_path (line 104) | def get_outputs_npz_path(self, image_abs_path: str) -> str:
    method is_disk_cached_outputs_expected (line 107) | def is_disk_cached_outputs_expected(self, npz_path: str):
    method load_outputs_npz (line 136) | def load_outputs_npz(self, npz_path: str) -> List[np.ndarray]:
    method cache_batch_outputs (line 145) | def cache_batch_outputs(
  class FluxLatentsCachingStrategy (line 197) | class FluxLatentsCachingStrategy(LatentsCachingStrategy):
    method __init__ (line 200) | def __init__(self, cache_to_disk: bool, batch_size: int, skip_disk_cac...
    method cache_suffix (line 204) | def cache_suffix(self) -> str:
    method get_latents_npz_path (line 207) | def get_latents_npz_path(self, absolute_path: str, image_size: Tuple[i...
    method is_disk_cached_latents_expected (line 214) | def is_disk_cached_latents_expected(self, bucket_reso: Tuple[int, int]...
    method load_latents_from_disk (line 217) | def load_latents_from_disk(
    method cache_batch_latents (line 223) | def cache_batch_latents(self, vae, image_infos: List, flip_aug: bool, ...

FILE: library/strategy_hunyuan_image.py
  class HunyuanImageTokenizeStrategy (line 18) | class HunyuanImageTokenizeStrategy(TokenizeStrategy):
    method __init__ (line 19) | def __init__(self, tokenizer_cache_dir: Optional[str] = None) -> None:
    method tokenize (line 27) | def tokenize(self, text: Union[str, List[str]]) -> List[torch.Tensor]:
  class HunyuanImageTextEncodingStrategy (line 49) | class HunyuanImageTextEncodingStrategy(TextEncodingStrategy):
    method __init__ (line 50) | def __init__(self) -> None:
    method encode_tokens (line 53) | def encode_tokens(
  class HunyuanImageTextEncoderOutputsCachingStrategy (line 82) | class HunyuanImageTextEncoderOutputsCachingStrategy(TextEncoderOutputsCa...
    method __init__ (line 85) | def __init__(
    method get_outputs_npz_path (line 90) | def get_outputs_npz_path(self, image_abs_path: str) -> str:
    method is_disk_cached_outputs_expected (line 96) | def is_disk_cached_outputs_expected(self, npz_path: str):
    method load_outputs_npz (line 122) | def load_outputs_npz(self, npz_path: str) -> List[np.ndarray]:
    method cache_batch_outputs (line 131) | def cache_batch_outputs(
  class HunyuanImageLatentsCachingStrategy (line 174) | class HunyuanImageLatentsCachingStrategy(LatentsCachingStrategy):
    method __init__ (line 177) | def __init__(self, cache_to_disk: bool, batch_size: int, skip_disk_cac...
    method cache_suffix (line 181) | def cache_suffix(self) -> str:
    method get_latents_npz_path (line 184) | def get_latents_npz_path(self, absolute_path: str, image_size: Tuple[i...
    method is_disk_cached_latents_expected (line 191) | def is_disk_cached_latents_expected(self, bucket_reso: Tuple[int, int]...
    method load_latents_from_disk (line 194) | def load_latents_from_disk(
    method cache_batch_latents (line 200) | def cache_batch_latents(

FILE: library/strategy_lumina.py
  class LuminaTokenizeStrategy (line 26) | class LuminaTokenizeStrategy(TokenizeStrategy):
    method __init__ (line 27) | def __init__(
    method tokenize (line 46) | def tokenize(
    method tokenize_with_weights (line 74) | def tokenize_with_weights(
  class LuminaTextEncodingStrategy (line 91) | class LuminaTextEncodingStrategy(TextEncodingStrategy):
    method __init__ (line 92) | def __init__(self) -> None:
    method encode_tokens (line 95) | def encode_tokens(
    method encode_tokens_with_weights (line 125) | def encode_tokens_with_weights(
  class LuminaTextEncoderOutputsCachingStrategy (line 147) | class LuminaTextEncoderOutputsCachingStrategy(TextEncoderOutputsCachingS...
    method __init__ (line 150) | def __init__(
    method get_outputs_npz_path (line 164) | def get_outputs_npz_path(self, image_abs_path: str) -> str:
    method is_disk_cached_outputs_expected (line 170) | def is_disk_cached_outputs_expected(self, npz_path: str) -> bool:
    method load_outputs_npz (line 199) | def load_outputs_npz(self, npz_path: str) -> List[np.ndarray]:
    method cache_batch_outputs (line 213) | def cache_batch_outputs(
  class LuminaLatentsCachingStrategy (line 284) | class LuminaLatentsCachingStrategy(LatentsCachingStrategy):
    method __init__ (line 287) | def __init__(
    method cache_suffix (line 293) | def cache_suffix(self) -> str:
    method get_latents_npz_path (line 296) | def get_latents_npz_path(
    method is_disk_cached_latents_expected (line 305) | def is_disk_cached_latents_expected(
    method load_latents_from_disk (line 323) | def load_latents_from_disk(
    method cache_batch_latents (line 351) | def cache_batch_latents(

FILE: library/strategy_sd.py
  class SdTokenizeStrategy (line 21) | class SdTokenizeStrategy(TokenizeStrategy):
    method __init__ (line 22) | def __init__(self, v2: bool, max_length: Optional[int], tokenizer_cach...
    method tokenize (line 39) | def tokenize(self, text: Union[str, List[str]]) -> List[torch.Tensor]:
    method tokenize_with_weights (line 43) | def tokenize_with_weights(self, text: str | List[str]) -> Tuple[List[t...
  class SdTextEncodingStrategy (line 54) | class SdTextEncodingStrategy(TextEncodingStrategy):
    method __init__ (line 55) | def __init__(self, clip_skip: Optional[int] = None) -> None:
    method encode_tokens (line 58) | def encode_tokens(
    method encode_tokens_with_weights (line 108) | def encode_tokens_with_weights(
  class SdSdxlLatentsCachingStrategy (line 133) | class SdSdxlLatentsCachingStrategy(LatentsCachingStrategy):
    method __init__ (line 141) | def __init__(self, sd: bool, cache_to_disk: bool, batch_size: int, ski...
    method cache_suffix (line 149) | def cache_suffix(self) -> str:
    method get_latents_npz_path (line 152) | def get_latents_npz_path(self, absolute_path: str, image_size: Tuple[i...
    method is_disk_cached_latents_expected (line 159) | def is_disk_cached_latents_expected(self, bucket_reso: Tuple[int, int]...
    method cache_batch_latents (line 163) | def cache_batch_latents(self, vae, image_infos: List, flip_aug: bool, ...

FILE: library/strategy_sd3.py
  class Sd3TokenizeStrategy (line 26) | class Sd3TokenizeStrategy(TokenizeStrategy):
    method __init__ (line 27) | def __init__(self, t5xxl_max_length: int = 256, tokenizer_cache_dir: O...
    method tokenize (line 34) | def tokenize(self, text: Union[str, List[str]]) -> List[torch.Tensor]:
  class Sd3TextEncodingStrategy (line 51) | class Sd3TextEncodingStrategy(TextEncodingStrategy):
    method __init__ (line 52) | def __init__(
    method encode_tokens (line 70) | def encode_tokens(
    method drop_cached_text_encoder_outputs (line 212) | def drop_cached_text_encoder_outputs(
    method concat_encodings (line 247) | def concat_encodings(
  class Sd3TextEncoderOutputsCachingStrategy (line 256) | class Sd3TextEncoderOutputsCachingStrategy(TextEncoderOutputsCachingStra...
    method __init__ (line 259) | def __init__(
    method get_outputs_npz_path (line 272) | def get_outputs_npz_path(self, image_abs_path: str) -> str:
    method is_disk_cached_outputs_expected (line 275) | def is_disk_cached_outputs_expected(self, npz_path: str):
    method load_outputs_npz (line 311) | def load_outputs_npz(self, npz_path: str) -> List[np.ndarray]:
    method cache_batch_outputs (line 324) | def cache_batch_outputs(
  class Sd3LatentsCachingStrategy (line 384) | class Sd3LatentsCachingStrategy(LatentsCachingStrategy):
    method __init__ (line 387) | def __init__(self, cache_to_disk: bool, batch_size: int, skip_disk_cac...
    method cache_suffix (line 391) | def cache_suffix(self) -> str:
    method get_latents_npz_path (line 394) | def get_latents_npz_path(self, absolute_path: str, image_size: Tuple[i...
    method is_disk_cached_latents_expected (line 401) | def is_disk_cached_latents_expected(self, bucket_reso: Tuple[int, int]...
    method load_latents_from_disk (line 404) | def load_latents_from_disk(
    method cache_batch_latents (line 410) | def cache_batch_latents(self, vae, image_infos: List, flip_aug: bool, ...

FILE: library/strategy_sdxl.py
  class SdxlTokenizeStrategy (line 22) | class SdxlTokenizeStrategy(TokenizeStrategy):
    method __init__ (line 23) | def __init__(self, max_length: Optional[int], tokenizer_cache_dir: Opt...
    method tokenize (line 33) | def tokenize(self, text: Union[str, List[str]]) -> List[torch.Tensor]:
    method tokenize_with_weights (line 40) | def tokenize_with_weights(self, text: str | List[str]) -> Tuple[List[t...
  class SdxlTextEncodingStrategy (line 57) | class SdxlTextEncodingStrategy(TextEncodingStrategy):
    method __init__ (line 58) | def __init__(self) -> None:
    method _pool_workaround (line 61) | def _pool_workaround(
    method _get_hidden_states_sdxl (line 105) | def _get_hidden_states_sdxl(
    method encode_tokens (line 171) | def encode_tokens(
    method encode_tokens_with_weights (line 195) | def encode_tokens_with_weights(
  class SdxlTextEncoderOutputsCachingStrategy (line 222) | class SdxlTextEncoderOutputsCachingStrategy(TextEncoderOutputsCachingStr...
    method __init__ (line 225) | def __init__(
    method get_outputs_npz_path (line 235) | def get_outputs_npz_path(self, image_abs_path: str) -> str:
    method is_disk_cached_outputs_expected (line 238) | def is_disk_cached_outputs_expected(self, npz_path: str):
    method load_outputs_npz (line 256) | def load_outputs_npz(self, npz_path: str) -> List[np.ndarray]:
    method cache_batch_outputs (line 263) | def cache_batch_outputs(

FILE: library/train_util.py
  function split_train_val (line 142) | def split_train_val(
  class ImageInfo (line 181) | class ImageInfo:
    method __init__ (line 182) | def __init__(
  class BucketManager (line 216) | class BucketManager:
    method __init__ (line 217) | def __init__(self, no_upscale, max_reso, min_size, max_size, reso_step...
    method add_image (line 240) | def add_image(self, reso, image_or_info):
    method shuffle (line 244) | def shuffle(self):
    method sort (line 248) | def sort(self):
    method make_buckets (line 264) | def make_buckets(self):
    method set_predefined_resos (line 268) | def set_predefined_resos(self, resos):
    method add_if_new_reso (line 274) | def add_if_new_reso(self, reso):
    method round_to_steps (line 282) | def round_to_steps(self, x):
    method select_bucket (line 286) | def select_bucket(self, image_width, image_height):
    method get_crop_ltrb (line 349) | def get_crop_ltrb(bucket_reso: Tuple[int, int], image_size: Tuple[int,...
  class BucketBatchIndex (line 369) | class BucketBatchIndex(NamedTuple):
  class AugHelper (line 375) | class AugHelper:
    method __init__ (line 378) | def __init__(self):
    method color_aug (line 381) | def color_aug(self, image: np.ndarray):
    method get_augmentor (line 408) | def get_augmentor(self, use_color_aug: bool):  # -> Optional[Callable[...
  class BaseSubset (line 412) | class BaseSubset:
    method __init__ (line 413) | def __init__(
  class DreamBoothSubset (line 472) | class DreamBoothSubset(BaseSubset):
    method __init__ (line 473) | def __init__(
    method __eq__ (line 540) | def __eq__(self, other) -> bool:
  class FineTuningSubset (line 546) | class FineTuningSubset(BaseSubset):
    method __init__ (line 547) | def __init__(
    method __eq__ (line 606) | def __eq__(self, other) -> bool:
  class ControlNetSubset (line 612) | class ControlNetSubset(BaseSubset):
    method __init__ (line 613) | def __init__(
    method __eq__ (line 677) | def __eq__(self, other) -> bool:
  class BaseDataset (line 683) | class BaseDataset(torch.utils.data.Dataset):
    method __init__ (line 684) | def __init__(
    method set_current_strategies (line 742) | def set_current_strategies(self):
    method adjust_min_max_bucket_reso_by_steps (line 747) | def adjust_min_max_bucket_reso_by_steps(
    method set_seed (line 775) | def set_seed(self, seed):
    method set_caching_mode (line 778) | def set_caching_mode(self, mode):
    method set_current_epoch (line 781) | def set_current_epoch(self, epoch):
    method set_current_step (line 794) | def set_current_step(self, step):
    method set_max_train_steps (line 797) | def set_max_train_steps(self, max_train_steps):
    method set_tag_frequency (line 800) | def set_tag_frequency(self, dir_name, captions):
    method disable_token_padding (line 811) | def disable_token_padding(self):
    method enable_XTI (line 814) | def enable_XTI(self, layers=None, token_strings=None):
    method add_replacement (line 818) | def add_replacement(self, str_from, str_to):
    method process_caption (line 821) | def process_caption(self, subset: BaseSubset, caption):
    method get_input_ids (line 934) | def get_input_ids(self, caption, tokenizer=None):
    method register_image (line 983) | def register_image(self, info: ImageInfo, subset: BaseSubset):
    method make_buckets (line 987) | def make_buckets(self):
    method shuffle_buckets (line 1086) | def shuffle_buckets(self):
    method verify_bucket_reso_steps (line 1093) | def verify_bucket_reso_steps(self, min_steps: int):
    method is_latent_cacheable (line 1099) | def is_latent_cacheable(self):
    method is_text_encoder_output_cacheable (line 1102) | def is_text_encoder_output_cacheable(self, cache_supports_dropout: boo...
    method new_cache_latents (line 1115) | def new_cache_latents(self, model: Any, accelerator: Accelerator):
    method cache_latents (line 1222) | def cache_latents(self, vae, vae_batch_size=1, cache_to_disk=False, is...
    method new_cache_text_encoder_outputs (line 1297) | def new_cache_text_encoder_outputs(self, models: List[Any], accelerato...
    method cache_text_encoder_outputs (line 1356) | def cache_text_encoder_outputs(
    method cache_text_encoder_outputs_sd3 (line 1365) | def cache_text_encoder_outputs_sd3(
    method cache_text_encoder_outputs_common (line 1380) | def cache_text_encoder_outputs_common(
    method get_image_size (line 1478) | def get_image_size(self, image_path):
    method load_image_with_face_info (line 1493) | def load_image_with_face_info(self, subset: BaseSubset, image_path: st...
    method crop_target (line 1508) | def crop_target(self, subset: BaseSubset, image, face_cx, face_cy, fac...
    method __len__ (line 1555) | def __len__(self):
    method __getitem__ (line 1558) | def __getitem__(self, index):
    method get_item_for_caching (line 1828) | def get_item_for_caching(self, bucket, bucket_batch_size, image_index):
  class DreamBoothDataset (line 1895) | class DreamBoothDataset(BaseDataset):
    method __init__ (line 1901) | def __init__(
  class FineTuningDataset (line 2187) | class FineTuningDataset(BaseDataset):
    method __init__ (line 2188) | def __init__(
  class ControlNetDataset (line 2374) | class ControlNetDataset(BaseDataset):
    method __init__ (line 2375) | def __init__(
    method set_current_strategies (line 2496) | def set_current_strategies(self):
    method make_buckets (line 2499) | def make_buckets(self):
    method cache_latents (line 2504) | def cache_latents(self, vae, vae_batch_size=1, cache_to_disk=False, is...
    method new_cache_latents (line 2507) | def new_cache_latents(self, model: Any, accelerator: Accelerator):
    method new_cache_text_encoder_outputs (line 2510) | def new_cache_text_encoder_outputs(self, models: List[Any], is_main_pr...
    method __len__ (line 2513) | def __len__(self):
    method __getitem__ (line 2516) | def __getitem__(self, index):
  class DatasetGroup (line 2583) | class DatasetGroup(torch.utils.data.ConcatDataset):
    method __init__ (line 2584) | def __init__(self, datasets: Sequence[Union[DreamBoothDataset, FineTun...
    method add_replacement (line 2601) | def add_replacement(self, str_from, str_to):
    method set_text_encoder_output_caching_strategy (line 2609) | def set_text_encoder_output_caching_strategy(self, strategy: TextEncod...
    method enable_XTI (line 2616) | def enable_XTI(self, *args, **kwargs):
    method cache_latents (line 2620) | def cache_latents(self, vae, vae_batch_size=1, cache_to_disk=False, is...
    method new_cache_latents (line 2625) | def new_cache_latents(self, model: Any, accelerator: Accelerator):
    method cache_text_encoder_outputs (line 2631) | def cache_text_encoder_outputs(
    method cache_text_encoder_outputs_sd3 (line 2638) | def cache_text_encoder_outputs_sd3(
    method new_cache_text_encoder_outputs (line 2647) | def new_cache_text_encoder_outputs(self, models: List[Any], accelerato...
    method set_caching_mode (line 2653) | def set_caching_mode(self, caching_mode):
    method verify_bucket_reso_steps (line 2657) | def verify_bucket_reso_steps(self, min_steps: int):
    method get_resolutions (line 2661) | def get_resolutions(self) -> List[Tuple[int, int]]:
    method is_latent_cacheable (line 2664) | def is_latent_cacheable(self) -> bool:
    method is_text_encoder_output_cacheable (line 2667) | def is_text_encoder_output_cacheable(self, cache_supports_dropout: boo...
    method set_current_strategies (line 2670) | def set_current_strategies(self):
    method set_current_epoch (line 2674) | def set_current_epoch(self, epoch):
    method set_current_step (line 2678) | def set_current_step(self, step):
    method set_max_train_steps (line 2682) | def set_max_train_steps(self, max_train_steps):
    method disable_token_padding (line 2686) | def disable_token_padding(self):
  function is_disk_cached_latents_is_expected (line 2691) | def is_disk_cached_latents_is_expected(reso, npz_path: str, flip_aug: bo...
  function debug_dataset (line 2757) | def debug_dataset(train_dataset, show_input_ids=False):
  function glob_images (line 2847) | def glob_images(directory, base="*"):
  function glob_images_pathlib (line 2859) | def glob_images_pathlib(dir_path, recursive):
  class MinimalDataset (line 2872) | class MinimalDataset(BaseDataset):
    method __init__ (line 2873) | def __init__(self, resolution, network_multiplier, debug_dataset=False):
    method verify_bucket_reso_steps (line 2888) | def verify_bucket_reso_steps(self, min_steps: int):
    method is_latent_cacheable (line 2891) | def is_latent_cacheable(self) -> bool:
    method __len__ (line 2894) | def __len__(self):
    method set_current_epoch (line 2898) | def set_current_epoch(self, epoch):
    method __getitem__ (line 2901) | def __getitem__(self, idx):
    method get_resolutions (line 2935) | def get_resolutions(self) -> List[Tuple[int, int]]:
  function load_arbitrary_dataset (line 2939) | def load_arbitrary_dataset(args, tokenizer=None) -> MinimalDataset:
  function load_image (line 2948) | def load_image(image_path, alpha=False):
  function trim_and_resize_if_required (line 2965) | def trim_and_resize_if_required(
  function load_images_and_masks_for_caching (line 2997) | def load_images_and_masks_for_caching(
  function cache_batch_latents (line 3043) | def cache_batch_latents(
  function cache_batch_text_encoder_outputs (line 3120) | def cache_batch_text_encoder_outputs(
  function cache_batch_text_encoder_outputs_sd3 (line 3152) | def cache_batch_text_encoder_outputs_sd3(
  function save_text_encoder_outputs_to_disk (line 3180) | def save_text_encoder_outputs_to_disk(npz_path, hidden_state1, hidden_st...
  function load_text_encoder_outputs_from_disk (line 3189) | def load_text_encoder_outputs_from_disk(npz_path):
  function exists (line 3215) | def exists(val):
  function default (line 3219) | def default(val, d):
  function model_hash (line 3223) | def model_hash(filename):
  function calculate_sha256 (line 3240) | def calculate_sha256(filename):
  function precalculate_safetensors_hashes (line 3259) | def precalculate_safetensors_hashes(tensors, metadata):
  function addnet_hash_legacy (line 3276) | def addnet_hash_legacy(b):
  function addnet_hash_safetensors (line 3285) | def addnet_hash_safetensors(b):
  function get_git_revision_hash (line 3302) | def get_git_revision_hash() -> str:
  function replace_unet_modules (line 3362) | def replace_unet_modules(unet: UNet2DConditionModel, mem_eff_attn, xform...
  function load_metadata_from_safetensors (line 3439) | def load_metadata_from_safetensors(safetensors_file: str) -> dict:
  function build_minimum_network_metadata (line 3472) | def build_minimum_network_metadata(
  function get_sai_model_spec (line 3495) | def get_sai_model_spec(
  function get_sai_model_spec_dataclass (line 3573) | def get_sai_model_spec_dataclass(
  function add_sd_models_arguments (line 3641) | def add_sd_models_arguments(parser: argparse.ArgumentParser):
  function add_optimizer_arguments (line 3663) | def add_optimizer_arguments(parser: argparse.ArgumentParser):
  function add_training_arguments (line 3794) | def add_training_arguments(parser: argparse.ArgumentParser, support_drea...
  function add_masked_loss_arguments (line 4237) | def add_masked_loss_arguments(parser: argparse.ArgumentParser):
  function add_dit_training_arguments (line 4251) | def add_dit_training_arguments(parser: argparse.ArgumentParser):
  function get_sanitized_config_or_none (line 4317) | def get_sanitized_config_or_none(args: argparse.Namespace):
  function verify_command_line_training_args (line 4354) | def verify_command_line_training_args(args: argparse.Namespace):
  function enable_high_vram (line 4407) | def enable_high_vram(args: argparse.Namespace):
  function verify_training_args (line 4414) | def verify_training_args(args: argparse.Namespace):
  function add_dataset_arguments (line 4475) | def add_dataset_arguments(
  function add_sd_saving_arguments (line 4685) | def add_sd_saving_arguments(parser: argparse.ArgumentParser):
  function read_config_from_file (line 4700) | def read_config_from_file(args: argparse.Namespace, parser: argparse.Arg...
  function resume_from_local_or_hf_if_specified (line 4772) | def resume_from_local_or_hf_if_specified(accelerator, args):
  function get_optimizer (line 4825) | def get_optimizer(args, trainable_params) -> tuple[str, str, object]:
  function get_optimizer_train_eval_fn (line 5228) | def get_optimizer_train_eval_fn(optimizer: Optimizer, args: argparse.Nam...
  function is_schedulefree_optimizer (line 5240) | def is_schedulefree_optimizer(optimizer: Optimizer, args: argparse.Names...
  function get_dummy_scheduler (line 5244) | def get_dummy_scheduler(optimizer: Optimizer) -> Any:
  function get_scheduler_fix (line 5265) | def get_scheduler_fix(args, optimizer: Optimizer, num_processes: int):
  function prepare_dataset_args (line 5402) | def prepare_dataset_args(args: argparse.Namespace, support_metadata: bool):
  function prepare_accelerator (line 5432) | def prepare_accelerator(args: argparse.Namespace):
  function prepare_dtype (line 5507) | def prepare_dtype(args: argparse.Namespace):
  function _load_target_model (line 5525) | def _load_target_model(args: argparse.Namespace, weight_dtype, device="c...
  function load_target_model (line 5571) | def load_target_model(args, weight_dtype, accelerator, unet_use_linear_p...
  function patch_accelerator_for_fp16_training (line 5593) | def patch_accelerator_for_fp16_training(accelerator):
  function get_hidden_states (line 5608) | def get_hidden_states(args: argparse.Namespace, input_ids, tokenizer, te...
  function pool_workaround (line 5657) | def pool_workaround(
  function get_hidden_states_sdxl (line 5700) | def get_hidden_states_sdxl(
  function default_if_none (line 5767) | def default_if_none(value, default):
  function get_epoch_ckpt_name (line 5771) | def get_epoch_ckpt_name(args: argparse.Namespace, ext: str, epoch_no: int):
  function get_step_ckpt_name (line 5776) | def get_step_ckpt_name(args: argparse.Namespace, ext: str, step_no: int):
  function get_last_ckpt_name (line 5781) | def get_last_ckpt_name(args: argparse.Namespace, ext: str):
  function get_remove_epoch_no (line 5786) | def get_remove_epoch_no(args: argparse.Namespace, epoch_no: int):
  function get_remove_step_no (line 5796) | def get_remove_step_no(args: argparse.Namespace, step_no: int):
  function save_sd_model_on_epoch_end_or_stepwise (line 5811) | def save_sd_model_on_epoch_end_or_stepwise(
  function save_sd_model_on_epoch_end_or_stepwise_common (line 5851) | def save_sd_model_on_epoch_end_or_stepwise_common(
  function save_and_remove_state_on_epoch_end (line 5938) | def save_and_remove_state_on_epoch_end(args: argparse.Namespace, acceler...
  function save_and_remove_state_stepwise (line 5960) | def save_and_remove_state_stepwise(args: argparse.Namespace, accelerator...
  function save_state_on_train_end (line 5986) | def save_state_on_train_end(args: argparse.Namespace, accelerator):
  function save_sd_model_on_train_end (line 6001) | def save_sd_model_on_train_end(
  function save_sd_model_on_train_end_common (line 6029) | def save_sd_model_on_train_end_common(
  function get_timesteps (line 6062) | def get_timesteps(min_timestep: int, max_timestep: int, b_size: int, dev...
  function get_noise_noisy_latents_and_timesteps (line 6071) | def get_noise_noisy_latents_and_timesteps(
  function get_huber_threshold_if_needed (line 6110) | def get_huber_threshold_if_needed(args, timesteps: torch.Tensor, noise_s...
  function conditional_loss (line 6133) | def conditional_loss(
  function append_lr_to_logs (line 6168) | def append_lr_to_logs(logs, lr_scheduler, optimizer_type, including_unet...
  function append_lr_to_logs_with_names (line 6179) | def append_lr_to_logs_with_names(logs, lr_scheduler, optimizer_type, nam...
  function get_my_scheduler (line 6199) | def get_my_scheduler(
  function sample_images (line 6250) | def sample_images(*args, **kwargs):
  function line_to_prompt_dict (line 6254) | def line_to_prompt_dict(line: str) -> dict:
  function load_prompts (line 6329) | def load_prompts(prompt_file: str) -> List[Dict]:
  function sample_images_common (line 6360) | def sample_images_common(
  function sample_image_inference (line 6493) | def sample_image_inference(
  function init_trackers (line 6589) | def init_trackers(accelerator: Accelerator, args: argparse.Namespace, de...
  class ImageLoadingDataset (line 6623) | class ImageLoadingDataset(torch.utils.data.Dataset):
    method __init__ (line 6624) | def __init__(self, image_paths):
    method __len__ (line 6627) | def __len__(self):
    method __getitem__ (line 6630) | def __getitem__(self, idx):
  class collator_class (line 6648) | class collator_class:
    method __init__ (line 6649) | def __init__(self, epoch, step, dataset):
    method __call__ (line 6654) | def __call__(self, examples):
  class LossRecorder (line 6668) | class LossRecorder:
    method __init__ (line 6669) | def __init__(self):
    method add (line 6673) | def add(self, *, epoch: int, step: int, loss: float) -> None:
    method moving_average (line 6684) | def moving_average(self) -> float:

FILE: library/utils.py
  function fire_in_thread (line 17) | def fire_in_thread(f, *args, **kwargs):
  function add_logging_arguments (line 24) | def add_logging_arguments(parser):
  function setup_logging (line 41) | def setup_logging(args=None, log_level=None, reset=False):
  function swap_weight_devices (line 98) | def swap_weight_devices(layer_to_cpu: nn.Module, layer_to_cuda: nn.Module):
  function weighs_to_device (line 126) | def weighs_to_device(layer: nn.Module, device: torch.device):
  function str_to_dtype (line 132) | def str_to_dtype(s: Optional[str], default_dtype: Optional[torch.dtype] ...
  function pil_resize (line 197) | def pil_resize(image, size, interpolation):
  function resize_image (line 216) | def resize_image(
  function get_cv2_interpolation (line 267) | def get_cv2_interpolation(interpolation: Optional[str]) -> Optional[int]:
  function get_pil_interpolation (line 298) | def get_pil_interpolation(interpolation: Optional[str]) -> Optional[Imag...
  function validate_interpolation_fn (line 330) | def validate_interpolation_fn(interpolation_str: str) -> bool:
  class GradualLatent (line 343) | class GradualLatent:
    method __init__ (line 344) | def __init__(
    method __str__ (line 366) | def __str__(self) -> str:
    method apply_unshark_mask (line 374) | def apply_unshark_mask(self, x: torch.Tensor):
    method interpolate (line 383) | def interpolate(self, x: torch.Tensor, resized_size, unsharp=True):
  class EulerAncestralDiscreteSchedulerGL (line 397) | class EulerAncestralDiscreteSchedulerGL(EulerAncestralDiscreteScheduler):
    method __init__ (line 398) | def __init__(self, *args, **kwargs):
    method set_gradual_latent_params (line 403) | def set_gradual_latent_params(self, size, gradual_latent: GradualLatent):
    method step (line 407) | def step(

FILE: lumina_minimal_inference.py
  function generate_image (line 39) | def generate_image(
  function setup_parser (line 183) | def setup_parser() -> argparse.ArgumentParser:

FILE: lumina_train.py
  function train (line 57) | def train(args):
  function setup_parser (line 909) | def setup_parser() -> argparse.ArgumentParser:

FILE: lumina_train_network.py
  class LuminaNetworkTrainer (line 33) | class LuminaNetworkTrainer(train_network.NetworkTrainer):
    method __init__ (line 34) | def __init__(self):
    method assert_extra_args (line 39) | def assert_extra_args(self, args, train_dataset_group, val_dataset_gro...
    method load_target_model (line 52) | def load_target_model(self, args, weight_dtype, accelerator):
    method get_tokenize_strategy (line 88) | def get_tokenize_strategy(self, args):
    method get_tokenizers (line 91) | def get_tokenizers(self, tokenize_strategy: strategy_lumina.LuminaToke...
    method get_latents_caching_strategy (line 94) | def get_latents_caching_strategy(self, args):
    method get_text_encoding_strategy (line 97) | def get_text_encoding_strategy(self, args):
    method get_text_encoders_train_flags (line 100) | def get_text_encoders_train_flags(self, args, text_encoders):
    method get_text_encoder_outputs_caching_strategy (line 103) | def get_text_encoder_outputs_caching_strategy(self, args):
    method cache_text_encoder_outputs_if_needed (line 115) | def cache_text_encoder_outputs_if_needed(
    method sample_images (line 200) | def sample_images(
    method get_noise_scheduler (line 226) | def get_noise_scheduler(self, args: argparse.Namespace, device: torch....
    method encode_images_to_latents (line 231) | def encode_images_to_latents(self, args, vae, images):
    method shift_scale_latents (line 235) | def shift_scale_latents(self, args, latents):
    method get_noise_pred_and_target (line 238) | def get_noise_pred_and_target(
    method post_process_loss (line 324) | def post_process_loss(self, loss, args, timesteps, noise_scheduler):
    method get_sai_model_spec (line 327) | def get_sai_model_spec(self, args):
    method update_metadata (line 330) | def update_metadata(self, metadata, args):
    method is_text_encoder_not_needed_for_training (line 340) | def is_text_encoder_not_needed_for_training(self, args):
    method prepare_text_encoder_grad_ckpt_workaround (line 343) | def prepare_text_encoder_grad_ckpt_workaround(self, index, text_encoder):
    method prepare_text_encoder_fp8 (line 346) | def prepare_text_encoder_fp8(self, index, text_encoder, te_weight_dtyp...
    method prepare_unet_with_accelerator (line 351) | def prepare_unet_with_accelerator(
    method on_validation_step_end (line 366) | def on_validation_step_end(self, args, accelerator, network, text_enco...
  function setup_parser (line 372) | def setup_parser() -> argparse.ArgumentParser:

FILE: networks/check_lora_weights.py
  function main (line 10) | def main(file):
  function setup_parser (line 35) | def setup_parser() -> argparse.ArgumentParser:

FILE: networks/control_net_lllite.py
  class LLLiteModule (line 38) | class LLLiteModule(torch.nn.Module):
    method __init__ (line 39) | def __init__(self, depth, cond_emb_dim, name, org_module, mlp_dim, dro...
    method set_cond_image (line 121) | def set_cond_image(self, cond_image):
    method set_batch_cond_only (line 139) | def set_batch_cond_only(self, cond_only, zeros):
    method apply_to (line 143) | def apply_to(self):
    method forward (line 147) | def forward(self, x):
  class ControlNetLLLite (line 186) | class ControlNetLLLite(torch.nn.Module):
    method __init__ (line 190) | def __init__(
    method forward (line 294) | def forward(self, x):
    method set_cond_image (line 297) | def set_cond_image(self, cond_image):
    method set_batch_cond_only (line 305) | def set_batch_cond_only(self, cond_only, zeros):
    method set_multiplier (line 309) | def set_multiplier(self, multiplier):
    method load_weights (line 313) | def load_weights(self, file):
    method apply_to (line 324) | def apply_to(self):
    method is_mergeable (line 331) | def is_mergeable(self):
    method merge_to (line 334) | def merge_to(self, text_encoder, unet, weights_sd, dtype, device):
    method enable_gradient_checkpointing (line 337) | def enable_gradient_checkpointing(self):
    method prepare_optimizer_params (line 341) | def prepare_optimizer_params(self):
    method prepare_grad_etc (line 345) | def prepare_grad_etc(self):
    method on_epoch_start (line 348) | def on_epoch_start(self):
    method get_trainable_params (line 351) | def get_trainable_params(self):
    method save_weights (line 354) | def save_weights(self, file, dtype, metadata):

FILE: networks/control_net_lllite_for_train.py
  function add_lllite_modules (line 47) | def add_lllite_modules(module: torch.nn.Module, in_dim: int, depth, cond...
  class LLLiteLinear (line 92) | class LLLiteLinear(ORIGINAL_LINEAR):
    method __init__ (line 93) | def __init__(self, in_features: int, out_features: int, **kwargs):
    method set_lllite (line 97) | def set_lllite(self, depth, cond_emb_dim, name, mlp_dim, dropout=None,...
    method set_cond_image (line 109) | def set_cond_image(self, cond_image):
    method forward (line 112) | def forward(self, x):
  class LLLiteConv2d (line 134) | class LLLiteConv2d(ORIGINAL_CONV2D):
    method __init__ (line 135) | def __init__(self, in_channels: int, out_channels: int, kernel_size, *...
    method set_lllite (line 139) | def set_lllite(self, depth, cond_emb_dim, name, mlp_dim, dropout=None,...
    method set_cond_image (line 152) | def set_cond_image(self, cond_image):
    method forward (line 156) | def forward(self, x):  # , cond_image=None):
  class SdxlUNet2DConditionModelControlNetLLLite (line 174) | class SdxlUNet2DConditionModelControlNetLLLite(sdxl_original_unet.SdxlUN...
    method __init__ (line 179) | def __init__(self, **kwargs):
    method apply_lllite (line 182) | def apply_lllite(
    method prepare_params (line 275) | def prepare_params(self):
    method get_trainable_params (line 304) | def get_trainable_params(self):
    method save_lllite_weights (line 307) | def save_lllite_weights(self, file, dtype, metadata):
    method load_lllite_weights (line 338) | def load_lllite_weights(self, file, non_lllite_unet_sd=None):
    method forward (line 402) | def forward(self, x, timesteps=None, context=None, y=None, cond_image=...
  function replace_unet_linear_and_conv2d (line 408) | def replace_unet_linear_and_conv2d():

FILE: networks/convert_anima_lora_to_comfy.py
  function main (line 18) | def main(args):

FILE: networks/convert_flux_lora.py
  function convert_to_sd_scripts (line 125) | def convert_to_sd_scripts(sds_sd, ait_sd, sds_key, ait_key):
  function convert_to_sd_scripts_cat (line 138) | def convert_to_sd_scripts_cat(sds_sd, ait_sd, sds_key, ait_keys):
  function convert_ai_toolkit_to_sd_scripts (line 170) | def convert_ai_toolkit_to_sd_scripts(ait_sd):
  function convert_to_ai_toolkit (line 242) | def convert_to_ai_toolkit(sds_sd, ait_sd, sds_key, ait_key):
  function convert_to_ai_toolkit_cat (line 265) | def convert_to_ai_toolkit_cat(sds_sd, ait_sd, sds_key, ait_keys, dims=No...
  function convert_sd_scripts_to_ai_toolkit (line 328) | def convert_sd_scripts_to_ai_toolkit(sds_sd):
  function main (line 401) | def main(args):

FILE: networks/convert_hunyuan_image_lora_to_comfy.py
  function main (line 16) | def main(args):

FILE: networks/dylora.py
  class DyLoRAModule (line 28) | class DyLoRAModule(torch.nn.Module):
    method __init__ (line 34) | def __init__(self, lora_name, org_module: torch.nn.Module, multiplier=...
    method apply_to (line 76) | def apply_to(self):
    method forward (line 81) | def forward(self, x):
    method state_dict (line 123) | def state_dict(self, destination=None, prefix="", keep_vars=False):
    method _load_from_state_dict (line 151) | def _load_from_state_dict(self, state_dict, prefix, local_metadata, st...
  function create_network (line 176) | def create_network(
  function create_network_from_weights (line 231) | def create_network_from_weights(multiplier, file, vae, text_encoder, une...
  class DyLoRANetwork (line 268) | class DyLoRANetwork(torch.nn.Module):
    method __init__ (line 275) | def __init__(
    method set_loraplus_lr_ratio (line 366) | def set_loraplus_lr_ratio(self, loraplus_lr_ratio, loraplus_unet_lr_ra...
    method set_multiplier (line 374) | def set_multiplier(self, multiplier):
    method load_weights (line 379) | def load_weights(self, file):
    method apply_to (line 390) | def apply_to(self, text_encoder, unet, apply_text_encoder=True, apply_...
    method prepare_optimizer_params (line 435) | def prepare_optimizer_params(self, text_encoder_lr, unet_lr, default_lr):
    method enable_gradient_checkpointing (line 484) | def enable_gradient_checkpointing(self):
    method prepare_grad_etc (line 488) | def prepare_grad_etc(self, text_encoder, unet):
    method on_epoch_start (line 491) | def on_epoch_start(self, text_encoder, unet):
    method get_trainable_params (line 494) | def get_trainable_params(self):
    method save_weights (line 497) | def save_weights(self, file, dtype, metadata):
    method set_region (line 525) | def set_region(self, sub_prompt_index, is_last_network, mask):
    method set_current_generation (line 528) | def set_current_generation(self, batch_size, num_sub_prompts, width, h...

FILE: networks/extract_lora_from_dylora.py
  function load_state_dict (line 18) | def load_state_dict(file_name):
  function save_to_file (line 30) | def save_to_file(file_name, model, metadata):
  function split_lora_model (line 37) | def split_lora_model(lora_sd, unit):
  function split (line 74) | def split(args):
  function setup_parser (line 104) | def setup_parser() -> argparse.ArgumentParser:

FILE: networks/extract_lora_from_models.py
  function save_to_file (line 23) | def save_to_file(file_name, model, state_dict, dtype):
  function svd (line 35) | def svd(
  function setup_parser (line 266) | def setup_parser() -> argparse.ArgumentParser:

FILE: networks/flux_extract_lora.py
  function save_to_file (line 27) | def save_to_file(file_name, state_dict, metadata, dtype):
  function svd (line 36) | def svd(
  function setup_parser (line 152) | def setup_parser() -> argparse.ArgumentParser:

FILE: networks/flux_merge_lora.py
  function load_state_dict (line 24) | def load_state_dict(file_name, dtype):
  function save_to_file (line 39) | def save_to_file(file_name, state_dict: Dict[str, Union[Any, torch.Tenso...
  function merge_to_flux_model (line 53) | def merge_to_flux_model(
  function merge_to_flux_model_diffusers (line 195) | def merge_to_flux_model_diffusers(
  function merge_lora_models (line 447) | def merge_lora_models(models, ratios, merge_dtype, concat=False, shuffle...
  function merge (line 556) | def merge(args):
  function setup_parser (line 676) | def setup_parser() -> argparse.ArgumentParser:

FILE: networks/lora.py
  class LoRAModule (line 25) | class LoRAModule(torch.nn.Module):
    method __init__ (line 30) | def __init__(
    method apply_to (line 85) | def apply_to(self):
    method forward (line 90) | def forward(self, x):
  class LoRAInfModule (line 124) | class LoRAInfModule(LoRAModule):
    method __init__ (line 125) | def __init__(
    method set_network (line 158) | def set_network(self, network):
    method merge_to (line 162) | def merge_to(self, sd, dtype, device):
    method get_weight (line 194) | def get_weight(self, multiplier=None):
    method set_region (line 220) | def set_region(self, region):
    method default_forward (line 224) | def default_forward(self, x):
    method forward (line 228) | def forward(self, x):
    method get_mask_for_x (line 242) | def get_mask_for_x(self, x):
    method regional_forward (line 261) | def regional_forward(self, x):
    method postp_to_q (line 284) | def postp_to_q(self, x):
    method sub_prompt_forward (line 305) | def sub_prompt_forward(self, x):
    method to_out_forward (line 324) | def to_out_forward(self, x):
  function parse_block_lr_kwargs (line 389) | def parse_block_lr_kwargs(is_sdxl: bool, nw_kwargs: Dict) -> Optional[Li...
  function create_network (line 416) | def create_network(
  function get_block_dims_and_alphas (line 515) | def get_block_dims_and_alphas(
  function get_block_lr_weight (line 589) | def get_block_lr_weight(
  function remove_block_dims_and_alphas (line 706) | def remove_block_dims_and_alphas(
  function get_block_index (line 719) | def get_block_index(lora_name: str, is_sdxl: bool = False) -> int:
  function convert_diffusers_to_sai_if_needed (line 758) | def convert_diffusers_to_sai_if_needed(weights_sd):
  function create_network_from_weights (line 805) | def create_network_from_weights(multiplier, file, vae, text_encoder, une...
  class LoRANetwork (line 861) | class LoRANetwork(torch.nn.Module):
    method __init__ (line 877) | def __init__(
    method set_multiplier (line 1062) | def set_multiplier(self, multiplier):
    method set_enabled (line 1067) | def set_enabled(self, is_enabled):
    method load_weights (line 1071) | def load_weights(self, file):
    method apply_to (line 1082) | def apply_to(self, text_encoder, unet, apply_text_encoder=True, apply_...
    method is_mergeable (line 1098) | def is_mergeable(self):
    method merge_to (line 1102) | def merge_to(self, text_encoder, unet, weights_sd, dtype, device):
    method set_block_lr_weight (line 1130) | def set_block_lr_weight(self, block_lr_weight: Optional[List[float]]):
    method get_lr_weight (line 1134) | def get_lr_weight(self, block_idx: int) -> float:
    method set_loraplus_lr_ratio (line 1139) | def set_loraplus_lr_ratio(self, loraplus_lr_ratio, loraplus_unet_lr_ra...
    method prepare_optimizer_params (line 1148) | def prepare_optimizer_params(self, text_encoder_lr, unet_lr, default_lr):
    method enable_gradient_checkpointing (line 1242) | def enable_gradient_checkpointing(self):
    method prepare_grad_etc (line 1246) | def prepare_grad_etc(self, text_encoder, unet):
    method on_epoch_start (line 1249) | def on_epoch_start(self, text_encoder, unet):
    method get_trainable_params (line 1252) | def get_trainable_params(self):
    method save_weights (line 1255) | def save_weights(self, file, dtype, metadata):
    method set_region (line 1283) | def set_region(self, sub_prompt_index, is_last_network, mask):
    method set_current_generation (line 1294) | def set_current_generation(self, batch_size, num_sub_prompts, width, h...
    method backup_weights (line 1332) | def backup_weights(self):
    method restore_weights (line 1342) | def restore_weights(self):
    method pre_calculation (line 1353) | def pre_calculation(self):
    method apply_max_norm_regularization (line 1369) | def apply_max_norm_regularization(self, max_norm_value, device):

FILE: networks/lora_anima.py
  function create_network (line 16) | def create_network(
  function create_network_from_weights (line 130) | def create_network_from_weights(multiplier, file, ae, text_encoders, une...
  class LoRANetwork (line 170) | class LoRANetwork(torch.nn.Module):
    method __init__ (line 181) | def __init__(
    method set_multiplier (line 355) | def set_multiplier(self, multiplier):
    method set_enabled (line 360) | def set_enabled(self, is_enabled):
    method load_weights (line 364) | def load_weights(self, file):
    method apply_to (line 375) | def apply_to(self, text_encoders, unet, apply_text_encoder=True, apply...
    method is_mergeable (line 390) | def is_mergeable(self):
    method merge_to (line 393) | def merge_to(self, text_encoders, unet, weights_sd, dtype=None, device...
    method set_loraplus_lr_ratio (line 420) | def set_loraplus_lr_ratio(self, loraplus_lr_ratio, loraplus_unet_lr_ra...
    method prepare_optimizer_params_with_multiple_te_lrs (line 428) | def prepare_optimizer_params_with_multiple_te_lrs(self, text_encoder_l...
    method enable_gradient_checkpointing (line 526) | def enable_gradient_checkpointing(self):
    method prepare_grad_etc (line 529) | def prepare_grad_etc(self, text_encoder, unet):
    method on_epoch_start (line 532) | def on_epoch_start(self, text_encoder, unet):
    method get_trainable_params (line 535) | def get_trainable_params(self):
    method save_weights (line 538) | def save_weights(self, file, dtype, metadata):
    method backup_weights (line 564) | def backup_weights(self):
    method restore_weights (line 573) | def restore_weights(self):
    method pre_calculation (line 583) | def pre_calculation(self):
    method apply_max_norm_regularization (line 598) | def apply_max_norm_regularization(self, max_norm_value, device):

FILE: networks/lora_diffusers.py
  function make_unet_conversion_map (line 22) | def make_unet_conversion_map() -> Dict[str, str]:
  class LoRAModule (line 110) | class LoRAModule(torch.nn.Module):
    method __init__ (line 115) | def __init__(
    method apply_to (line 163) | def apply_to(self, multiplier=None):
    method unapply_to (line 171) | def unapply_to(self):
    method forward (line 177) | def forward(self, x, scale=1.0):
    method set_network (line 182) | def set_network(self, network):
    method merge_to (line 186) | def merge_to(self, multiplier=1.0):
    method restore_from (line 200) | def restore_from(self, multiplier=1.0):
    method get_weight (line 214) | def get_weight(self, multiplier=None):
  function create_network_from_weights (line 242) | def create_network_from_weights(
  function merge_lora_weights (line 268) | def merge_lora_weights(pipe, weights_sd: Dict, multiplier: float = 1.0):
  class LoRANetwork (line 278) | class LoRANetwork(torch.nn.Module):
    method __init__ (line 289) | def __init__(
    method convert_unet_modules (line 397) | def convert_unet_modules(self, modules_dim, modules_alpha):
    method set_multiplier (line 423) | def set_multiplier(self, multiplier):
    method apply_to (line 428) | def apply_to(self, multiplier=1.0, apply_text_encoder=True, apply_unet...
    method unapply_to (line 438) | def unapply_to(self):
    method merge_to (line 442) | def merge_to(self, multiplier=1.0):
    method restore_from (line 448) | def restore_from(self, multiplier=1.0):
    method load_state_dict (line 454) | def load_state_dict(self, state_dict: Mapping[str, Any], strict: bool ...
  function detach_and_move_to_cpu (line 532) | def detach_and_move_to_cpu(state_dict):
  function seed_everything (line 547) | def seed_everything(seed):

FILE: networks/lora_fa.py
  class LoRAModule (line 25) | class LoRAModule(torch.nn.Module):
    method __init__ (line 30) | def __init__(
    method get_trainable_params (line 89) | def get_trainable_params(self):
    method requires_grad_ (line 97) | def requires_grad_(self, requires_grad: bool = True):
    method apply_to (line 102) | def apply_to(self):
    method forward (line 107) | def forward(self, x):
  class LoRAInfModule (line 141) | class LoRAInfModule(LoRAModule):
    method __init__ (line 142) | def __init__(
    method set_network (line 175) | def set_network(self, network):
    method merge_to (line 179) | def merge_to(self, sd, dtype, device):
    method get_weight (line 211) | def get_weight(self, multiplier=None):
    method set_region (line 237) | def set_region(self, region):
    method default_forward (line 241) | def default_forward(self, x):
    method forward (line 245) | def forward(self, x):
    method get_mask_for_x (line 259) | def get_mask_for_x(self, x):
    method regional_forward (line 274) | def regional_forward(self, x):
    method postp_to_q (line 295) | def postp_to_q(self, x):
    method sub_prompt_forward (line 316) | def sub_prompt_forward(self, x):
    method to_out_forward (line 335) | def to_out_forward(self, x):
  function parse_block_lr_kwargs (line 399) | def parse_block_lr_kwargs(nw_kwargs):
  function create_network (line 428) | def create_network(
  function get_block_dims_and_alphas (line 514) | def get_block_dims_and_alphas(
  function get_block_lr_weight (line 580) | def get_block_lr_weight(
  function remove_block_dims_and_alphas (line 657) | def remove_block_dims_and_alphas(
  function get_block_index (line 683) | def get_block_index(lora_name: str) -> int:
  function create_network_from_weights (line 710) | def create_network_from_weights(multiplier, file, vae, text_encoder, une...
  class LoRANetwork (line 753) | class LoRANetwork(torch.nn.Module):
    method __init__ (line 766) | def __init__(
    method set_multiplier (line 942) | def set_multiplier(self, multiplier):
    method load_weights (line 947) | def load_weights(self, file):
    method apply_to (line 958) | def apply_to(self, text_encoder, unet, apply_text_encoder=True, apply_...
    method is_mergeable (line 974) | def is_mergeable(self):
    method merge_to (line 978) | def merge_to(self, text_encoder, unet, weights_sd, dtype, device):
    method set_block_lr_weight (line 1006) | def set_block_lr_weight(
    method get_lr_weight (line 1017) | def get_lr_weight(self, lora: LoRAModule) -> float:
    method prepare_optimizer_params (line 1036) | def prepare_optimizer_params(self, text_encoder_lr, unet_lr, default_lr):
    method enable_gradient_checkpointing (line 1083) | def enable_gradient_checkpointing(self):
    method prepare_grad_etc (line 1087) | def prepare_grad_etc(self, text_encoder, unet):
    method on_epoch_start (line 1090) | def on_epoch_start(self, text_encoder, unet):
    method get_trainable_params (line 1093) | def get_trainable_params(self):
    method save_weights (line 1096) | def save_weights(self, file, dtype, metadata):
    method set_region (line 1124) | def set_region(self, sub_prompt_index, is_last_network, mask):
    method set_current_generation (line 1135) | def set_current_generation(self, batch_size, num_sub_prompts, width, h...
    method backup_weights (line 1166) | def backup_weights(self):
    method restore_weights (line 1176) | def restore_weights(self):
    method pre_calculation (line 1187) | def pre_calculation(self):
    method apply_max_norm_regularization (line 1203) | def apply_max_norm_regularization(self, max_norm_value, device):

FILE: networks/lora_flux.py
  class LoRAModule (line 33) | class LoRAModule(torch.nn.Module):
    method __init__ (line 38) | def __init__(
    method apply_to (line 120) | def apply_to(self):
    method forward (line 126) | def forward(self, x):
    method initialize_norm_cache (line 204) | def initialize_norm_cache(self, org_module_weight: Tensor):
    method validate_norm_approximation (line 230) | def validate_norm_approximation(self, org_module_weight: Tensor, verbo...
    method update_norms (line 266) | def update_norms(self):
    method update_grad_norms (line 284) | def update_grad_norms(self):
    method device (line 305) | def device(self):
    method dtype (line 309) | def dtype(self):
  class LoRAInfModule (line 313) | class LoRAInfModule(LoRAModule):
    method __init__ (line 314) | def __init__(
    method set_network (line 330) | def set_network(self, network):
    method merge_to (line 334) | def merge_to(self, sd, dtype, device):
    method get_weight (line 393) | def get_weight(self, multiplier=None):
    method set_region (line 419) | def set_region(self, region):
    method default_forward (line 423) | def default_forward(self, x):
    method forward (line 434) | def forward(self, x):
  function create_network (line 440) | def create_network(
  function create_network_from_weights (line 659) | def create_network_from_weights(multiplier, file, ae, text_encoders, flu...
  class LoRANetwork (line 707) | class LoRANetwork(torch.nn.Module):
    method get_qkv_mlp_split_dims (line 717) | def get_qkv_mlp_split_dims(cls) -> List[int]:
    method __init__ (line 720) | def __init__(
    method set_multiplier (line 986) | def set_multiplier(self, multiplier):
    method set_enabled (line 991) | def set_enabled(self, is_enabled):
    method update_norms (line 995) | def update_norms(self):
    method update_grad_norms (line 999) | def update_grad_norms(self):
    method grad_norms (line 1003) | def grad_norms(self) -> Tensor | None:
    method weight_norms (line 1010) | def weight_norms(self) -> Tensor | None:
    method combined_weight_norms (line 1017) | def combined_weight_norms(self) -> Tensor | None:
    method load_weights (line 1024) | def load_weights(self, file):
    method load_state_dict (line 1035) | def load_state_dict(self, state_dict, strict=True):
    method state_dict (line 1090) | def state_dict(self, destination=None, prefix="", keep_vars=False):
    method apply_to (line 1140) | def apply_to(self, text_encoders, flux, apply_text_encoder=True, apply...
    method is_mergeable (line 1156) | def is_mergeable(self):
    method merge_to (line 1160) | def merge_to(self, text_encoders, flux, weights_sd, dtype=None, device...
    method set_loraplus_lr_ratio (line 1187) | def set_loraplus_lr_ratio(self, loraplus_lr_ratio, loraplus_unet_lr_ra...
    method prepare_optimizer_params_with_multiple_te_lrs (line 1195) | def prepare_optimizer_params_with_multiple_te_lrs(self, text_encoder_l...
    method enable_gradient_checkpointing (line 1330) | def enable_gradient_checkpointing(self):
    method prepare_grad_etc (line 1334) | def prepare_grad_etc(self, text_encoder, unet):
    method on_epoch_start (line 1337) | def on_epoch_start(self, text_encoder, unet):
    method get_trainable_params (line 1340) | def get_trainable_params(self):
    method save_weights (line 1343) | def save_weights(self, file, dtype, metadata):
    method backup_weights (line 1370) | def backup_weights(self):
    method restore_weights (line 1380) | def restore_weights(self):
    method pre_calculation (line 1391) | def pre_calculation(self):
    method apply_max_norm_regularization (line 1407) | def apply_max_norm_regularization(self, max_norm_value, device):

FILE: networks/lora_hunyuan_image.py
  function create_network (line 32) | def create_network(
  function create_network_from_weights (line 153) | def create_network_from_weights(multiplier, file, ae, text_encoders, flu...
  class HunyuanImageLoRANetwork (line 193) | class HunyuanImageLoRANetwork(lora_flux.LoRANetwork):
    method get_qkv_mlp_split_dims (line 199) | def get_qkv_mlp_split_dims(cls) -> List[int]:
    method __init__ (line 202) | def __init__(

FILE: networks/lora_interrogator.py
  function interrogate (line 26) | def interrogate(args):
  function setup_parser (line 125) | def setup_parser() -> argparse.ArgumentParser:

FILE: networks/lora_lumina.py
  class LoRAModule (line 25) | class LoRAModule(torch.nn.Module):
    method __init__ (line 30) | def __init__(
    method apply_to (line 104) | def apply_to(self):
    method forward (line 109) | def forward(self, x):
  class LoRAInfModule (line 169) | class LoRAInfModule(LoRAModule):
    method __init__ (line 170) | def __init__(
    method set_network (line 186) | def set_network(self, network):
    method merge_to (line 190) | def merge_to(self, sd, dtype, device):
    method get_weight (line 246) | def get_weight(self, multiplier=None):
    method set_region (line 283) | def set_region(self, region):
    method default_forward (line 287) | def default_forward(self, x):
    method forward (line 298) | def forward(self, x):
  function create_network (line 304) | def create_network(
  function create_network_from_weights (line 412) | def create_network_from_weights(multiplier, file, ae, text_encoders, lum...
  class LoRANetwork (line 469) | class LoRANetwork(torch.nn.Module):
    method __init__ (line 475) | def __init__(
    method set_multiplier (line 695) | def set_multiplier(self, multiplier):
    method set_enabled (line 700) | def set_enabled(self, is_enabled):
    method load_weights (line 704) | def load_weights(self, file):
    method load_state_dict (line 715) | def load_state_dict(self, state_dict, strict=True):
    method state_dict (line 764) | def state_dict(self, destination=None, prefix="", keep_vars=False):
    method apply_to (line 814) | def apply_to(self, text_encoders, flux, apply_text_encoder=True, apply...
    method is_mergeable (line 830) | def is_mergeable(self):
    method merge_to (line 834) | def merge_to(self, text_encoders, flux, weights_sd, dtype=None, device...
    method set_loraplus_lr_ratio (line 861) | def set_loraplus_lr_ratio(self, loraplus_lr_ratio, loraplus_unet_lr_ra...
    method prepare_optimizer_params_with_multiple_te_lrs (line 869) | def prepare_optimizer_params_with_multiple_te_lrs(self, text_encoder_l...
    method enable_gradient_checkpointing (line 938) | def enable_gradient_checkpointing(self):
    method prepare_grad_etc (line 942) | def prepare_grad_etc(self, text_encoder, unet):
    method on_epoch_start (line 945) | def on_epoch_start(self, text_encoder, unet):
    method get_trainable_params (line 948) | def get_trainable_params(self):
    method save_weights (line 951) | def save_weights(self, file, dtype, metadata):
    method backup_weights (line 978) | def backup_weights(self):
    method restore_weights (line 988) | def restore_weights(self):
    method pre_calculation (line 999) | def pre_calculation(self):
    method apply_max_norm_regularization (line 1015) | def apply_max_norm_regularization(self, max_norm_value, device):

FILE: networks/lora_sd3.py
  function create_network (line 27) | def create_network(
  function create_network_from_weights (line 181) | def create_network_from_weights(multiplier, file, ae, text_encoders, mmd...
  class LoRANetwork (line 230) | class LoRANetwork(torch.nn.Module):
    method __init__ (line 238) | def __init__(
    method set_multiplier (line 474) | def set_multiplier(self, multiplier):
    method set_enabled (line 479) | def set_enabled(self, is_enabled):
    method load_weights (line 483) | def load_weights(self, file):
    method load_state_dict (line 494) | def load_state_dict(self, state_dict, strict=True):
    method state_dict (line 528) | def state_dict(self, destination=None, prefix="", keep_vars=False):
    method apply_to (line 575) | def apply_to(self, text_encoders, mmdit, apply_text_encoder=True, appl...
    method is_mergeable (line 591) | def is_mergeable(self):
    method merge_to (line 595) | def merge_to(self, text_encoders, mmdit, weights_sd, dtype=None, devic...
    method set_loraplus_lr_ratio (line 626) | def set_loraplus_lr_ratio(self, loraplus_lr_ratio, loraplus_unet_lr_ra...
    method prepare_optimizer_params_with_multiple_te_lrs (line 634) | def prepare_optimizer_params_with_multiple_te_lrs(self, text_encoder_l...
    method enable_gradient_checkpointing (line 721) | def e
Copy disabled (too large) Download .json
Condensed preview — 223 files, each showing path, character count, and a content snippet. Download the .json file for the full structured content (17,241K chars).
[
  {
    "path": ".ai/claude.prompt.md",
    "chars": 283,
    "preview": "## About This File\n\nThis file provides guidance to Claude Code (claude.ai/code) when working with code in this repositor"
  },
  {
    "path": ".ai/context/01-overview.md",
    "chars": 4320,
    "preview": "This file provides the overview and guidance for developers working with the codebase, including setup instructions, arc"
  },
  {
    "path": ".ai/gemini.prompt.md",
    "chars": 311,
    "preview": "## About This File\n\nThis file provides guidance to Gemini CLI (https://github.com/google-gemini/gemini-cli) when working"
  },
  {
    "path": ".github/FUNDING.yml",
    "chars": 64,
    "preview": "# These are supported funding model platforms\n\ngithub: kohya-ss\n"
  },
  {
    "path": ".github/dependabot.yml",
    "chars": 123,
    "preview": "---\nversion: 2\nupdates:\n  - package-ecosystem: \"github-actions\"\n    directory: \"/\"\n    schedule:\n      interval: \"monthl"
  },
  {
    "path": ".github/workflows/tests.yml",
    "chars": 1373,
    "preview": "name: Test with pytest\n\non: \n  push:\n    branches:\n      - main\n      - dev\n      - sd3\n  pull_request:\n    branches:\n  "
  },
  {
    "path": ".github/workflows/typos.yml",
    "chars": 512,
    "preview": "---\nname: Typos\n\non: \n  push:\n    branches:\n      - main\n      - dev\n  pull_request:\n    types:\n      - opened\n      - s"
  },
  {
    "path": ".gitignore",
    "chars": 117,
    "preview": "logs\n__pycache__\nwd14_tagger_model\nvenv\n*.egg-info\nbuild\n.vscode\nwandb\nCLAUDE.md\nGEMINI.md\n.claude\n.gemini\nMagicMock\n"
  },
  {
    "path": "LICENSE.md",
    "chars": 11342,
    "preview": "                                 Apache License\n                           Version 2.0, January 2004\n                   "
  },
  {
    "path": "README-ja.md",
    "chars": 8079,
    "preview": "# sd-scripts\n\n[English](./README.md) / [日本語](./README-ja.md)\n\n## 目次\n\n<details>\n<summary>クリックすると展開します</summary>\n\n- [はじめに]"
  },
  {
    "path": "README.md",
    "chars": 9597,
    "preview": "# sd-scripts\n\n[English](./README.md) / [日本語](./README-ja.md)\n\n## Table of Contents\n<details>\n<summary>Click to expand</s"
  },
  {
    "path": "XTI_hijack.py",
    "chars": 7668,
    "preview": "import torch\nfrom library.device_utils import init_ipex\ninit_ipex()\n\nfrom typing import Union, List, Optional, Dict, Any"
  },
  {
    "path": "_typos.toml",
    "chars": 556,
    "preview": "# Files for typos\n# Instruction:  https://github.com/marketplace/actions/typos-action#getting-started\n\n[default.extend-i"
  },
  {
    "path": "anima_minimal_inference.py",
    "chars": 41247,
    "preview": "import argparse\nimport datetime\nimport gc\nfrom importlib.util import find_spec\nimport random\nimport os\nimport time\nimpor"
  },
  {
    "path": "anima_train.py",
    "chars": 31464,
    "preview": "# Anima full finetune training script\n\nimport argparse\nfrom concurrent.futures import ThreadPoolExecutor\nimport copy\nimp"
  },
  {
    "path": "anima_train_network.py",
    "chars": 18703,
    "preview": "# Anima LoRA training script\n\nimport argparse\nfrom typing import Any, Optional, Union\n\nimport torch\nimport torch.nn as n"
  },
  {
    "path": "bitsandbytes_windows/cextension.py",
    "chars": 2122,
    "preview": "import ctypes as ct\nfrom pathlib import Path\nfrom warnings import warn\n\nfrom .cuda_setup.main import evaluate_cuda_setup"
  },
  {
    "path": "bitsandbytes_windows/main.py",
    "chars": 6178,
    "preview": "\"\"\"\r\nextract factors the build is dependent on:\r\n[X] compute capability\r\n    [ ] TODO: Q - What if we have multiple GPUs"
  },
  {
    "path": "configs/qwen3_06b/config.json",
    "chars": 727,
    "preview": "{\n  \"architectures\": [\n    \"Qwen3ForCausalLM\"\n  ],\n  \"attention_bias\": false,\n  \"attention_dropout\": 0.0,\n  \"bos_token_i"
  },
  {
    "path": "configs/qwen3_06b/merges.txt",
    "chars": 1278501,
    "preview": "#version: 0.2\nĠ Ġ\nĠĠ ĠĠ\ni n\nĠ t\nĠĠĠĠ ĠĠĠĠ\ne r\nĠĠ Ġ\no n\nĠ a\nr e\na t\ns t\ne n\no r\nĠt h\nĊ Ċ\nĠ c\nl e\nĠ s\ni t\na n\na r\na l\nĠth "
  },
  {
    "path": "configs/qwen3_06b/tokenizer.json",
    "chars": 6244779,
    "preview": "{\n  \"version\": \"1.0\",\n  \"truncation\": null,\n  \"padding\": null,\n  \"added_tokens\": [\n    {\n      \"id\": 151643,\n      \"cont"
  },
  {
    "path": "configs/qwen3_06b/tokenizer_config.json",
    "chars": 9678,
    "preview": "{\n  \"add_bos_token\": false,\n  \"add_prefix_space\": false,\n  \"added_tokens_decoder\": {\n    \"151643\": {\n      \"content\": \"<"
  },
  {
    "path": "configs/qwen3_06b/vocab.json",
    "chars": 2383319,
    "preview": "{\"!\":0,\"\\\"\":1,\"#\":2,\"$\":3,\"%\":4,\"&\":5,\"'\":6,\"(\":7,\")\":8,\"*\":9,\"+\":10,\",\":11,\"-\":12,\".\":13,\"/\":14,\"0\":15,\"1\":16,\"2\":17,\"3"
  },
  {
    "path": "configs/t5_old/config.json",
    "chars": 1203,
    "preview": "{\n  \"architectures\": [\n    \"T5WithLMHeadModel\"\n  ],\n  \"d_ff\": 65536,\n  \"d_kv\": 128,\n  \"d_model\": 1024,\n  \"decoder_start_"
  },
  {
    "path": "configs/t5_old/tokenizer.json",
    "chars": 1342582,
    "preview": "{\"version\":\"1.0\",\"truncation\":null,\"padding\":null,\"added_tokens\":[{\"id\":0,\"special\":true,\"content\":\"<pad>\",\"single_word\""
  },
  {
    "path": "docs/anima_train_network.md",
    "chars": 31715,
    "preview": "# LoRA Training Guide for Anima using `anima_train_network.py` / `anima_train_network.py` を用いたAnima モデルのLoRA学習ガイド\n\nThis "
  },
  {
    "path": "docs/config_README-en.md",
    "chars": 21515,
    "preview": "First version: A.I Translation by Model: NousResearch/Nous-Hermes-2-Mixtral-8x7B-DPO, editing by Darkstorm2150\n\nDocument"
  },
  {
    "path": "docs/config_README-ja.md",
    "chars": 14966,
    "preview": "`--dataset_config` で渡すことができる設定ファイルに関する説明です。\n\n## 概要\n\n設定ファイルを渡すことにより、ユーザが細かい設定を行えるようにします。\n\n* 複数のデータセットが設定可能になります\n    * 例えば"
  },
  {
    "path": "docs/fine_tune.md",
    "chars": 12934,
    "preview": "# Fine-tuning Guide\n\nThis document explains how to perform fine-tuning on various model architectures using the `*_train"
  },
  {
    "path": "docs/fine_tune_README_ja.md",
    "chars": 5235,
    "preview": "NovelAIの提案した学習手法、自動キャプションニング、タグ付け、Windows+VRAM 12GB(SD v1.xの場合)環境等に対応したfine tuningです。ここでfine tuningとは、モデルを画像とキャプションで学習する"
  },
  {
    "path": "docs/flux_train_network.md",
    "chars": 31805,
    "preview": "Status: reviewed\n\n# LoRA Training Guide for FLUX.1 using `flux_train_network.py` / `flux_train_network.py` を用いたFLUX.1モデル"
  },
  {
    "path": "docs/gen_img_README-ja.md",
    "chars": 20276,
    "preview": "SD 1.x、2.x、およびSDXLのモデル、当リポジトリで学習したLoRA、ControlNet、ControlNet-LLLiteなどに対応した、独自の推論(画像生成)スクリプトです。コマンドラインから用います。\n\n# 概要\n\n* 独自"
  },
  {
    "path": "docs/gen_img_README.md",
    "chars": 32705,
    "preview": "<!-- filepath: d:\\\\Work\\\\SD\\\\dev\\\\sd-scripts\\\\docs\\\\gen_img_README-en.md -->\nThis is an inference (image generation) scr"
  },
  {
    "path": "docs/hunyuan_image_train_network.md",
    "chars": 24545,
    "preview": "Status: reviewed\n\n# LoRA Training Guide for HunyuanImage-2.1 using `hunyuan_image_train_network.py` / `hunyuan_image_tra"
  },
  {
    "path": "docs/lumina_train_network.md",
    "chars": 16718,
    "preview": "# LoRA Training Guide for Lumina Image 2.0 using `lumina_train_network.py` / `lumina_train_network.py` を用いたLumina Image "
  },
  {
    "path": "docs/masked_loss_README-ja.md",
    "chars": 1832,
    "preview": "## マスクロスについて\n\nマスクロスは、入力画像のマスクで指定された部分だけ損失計算することで、画像の一部分だけを学習することができる機能です。\nたとえばキャラクタを学習したい場合、キャラクタ部分だけをマスクして学習することで、背景を無視"
  },
  {
    "path": "docs/masked_loss_README.md",
    "chars": 3022,
    "preview": "## Masked Loss\n\nMasked loss is a feature that allows you to train only part of an image by calculating the loss only for"
  },
  {
    "path": "docs/sd3_train_network.md",
    "chars": 17320,
    "preview": "# LoRA Training Guide for Stable Diffusion 3/3.5 using `sd3_train_network.py` / `sd3_train_network.py` を用いたStable Diffus"
  },
  {
    "path": "docs/sdxl_train_network.md",
    "chars": 15572,
    "preview": "# How to Use the SDXL LoRA Training Script `sdxl_train_network.py` / SDXL LoRA学習スクリプト `sdxl_train_network.py` の使い方\n\nThis"
  },
  {
    "path": "docs/train_README-ja.md",
    "chars": 34408,
    "preview": "__ドキュメント更新中のため記述に誤りがあるかもしれません。__\n\n# 学習について、共通編\n\n当リポジトリではモデルのfine tuning、DreamBooth、およびLoRAとTextual Inversion([XTI:P+](ht"
  },
  {
    "path": "docs/train_README-zh.md",
    "chars": 26566,
    "preview": "__由于文档正在更新中,描述可能有错误。__\n\n# 关于训练,通用描述\n本库支持模型微调(fine tuning)、DreamBooth、训练LoRA和文本反转(Textual Inversion)(包括[XTI:P+](https://g"
  },
  {
    "path": "docs/train_SDXL-en.md",
    "chars": 5171,
    "preview": "## SDXL training\n\nThe documentation will be moved to the training documentation in the future. The following is a brief "
  },
  {
    "path": "docs/train_db_README-ja.md",
    "chars": 5670,
    "preview": "DreamBoothのガイドです。\n\n[学習についての共通ドキュメント](./train_README-ja.md) もあわせてご覧ください。\n\n# 概要\n\nDreamBoothとは、画像生成モデルに特定の主題を追加学習し、それを特定の識別"
  },
  {
    "path": "docs/train_db_README-zh.md",
    "chars": 4613,
    "preview": "这是DreamBooth的指南。\n\n请同时查看[关于学习的通用文档](./train_README-zh.md)。\n\n# 概要\n\nDreamBooth是一种将特定主题添加到图像生成模型中进行学习,并使用特定识别子生成它的技术。论文链接。\n\n"
  },
  {
    "path": "docs/train_lllite_README-ja.md",
    "chars": 7432,
    "preview": "# ControlNet-LLLite について\n\n__きわめて実験的な実装のため、将来的に大きく変更される可能性があります。__\n\n## 概要\nControlNet-LLLite は、[ControlNet](https://github"
  },
  {
    "path": "docs/train_lllite_README.md",
    "chars": 9851,
    "preview": "# About ControlNet-LLLite\n\n__This is an extremely experimental implementation and may change significantly in the future"
  },
  {
    "path": "docs/train_network.md",
    "chars": 17584,
    "preview": "# How to use the LoRA training script `train_network.py` / LoRA学習スクリプト `train_network.py` の使い方\n\nThis document explains t"
  },
  {
    "path": "docs/train_network_README-ja.md",
    "chars": 17390,
    "preview": "# LoRAの学習について\n\n[LoRA: Low-Rank Adaptation of Large Language Models](https://arxiv.org/abs/2106.09685)(arxiv)、[LoRA](http"
  },
  {
    "path": "docs/train_network_README-zh.md",
    "chars": 14616,
    "preview": "# 关于LoRA的学习。\n\n[LoRA: Low-Rank Adaptation of Large Language Models](https://arxiv.org/abs/2106.09685)(arxiv)、[LoRA](https"
  },
  {
    "path": "docs/train_network_advanced.md",
    "chars": 40902,
    "preview": "# Advanced Settings: Detailed Guide for SDXL LoRA Training Script `sdxl_train_network.py` / 高度な設定: SDXL LoRA学習スクリプト `sdx"
  },
  {
    "path": "docs/train_textual_inversion.md",
    "chars": 11570,
    "preview": "# How to use Textual Inversion training scripts / Textual Inversion学習スクリプトの使い方\n\nThis document explains how to train Text"
  },
  {
    "path": "docs/train_ti_README-ja.md",
    "chars": 4174,
    "preview": "[Textual Inversion](https://textual-inversion.github.io/) の学習についての説明です。\n\n[学習についての共通ドキュメント](./train_README-ja.md) もあわせてご覧"
  },
  {
    "path": "docs/validation.md",
    "chars": 10139,
    "preview": "# Validation Loss\n\nValidation loss is a crucial metric for monitoring the training process of a model. It helps you asse"
  },
  {
    "path": "docs/wd14_tagger_README-en.md",
    "chars": 5208,
    "preview": "# Image Tagging using WD14Tagger\n\nThis document is based on the information from this github page (https://github.com/to"
  },
  {
    "path": "docs/wd14_tagger_README-ja.md",
    "chars": 3763,
    "preview": "# WD14Taggerによるタグ付け\n\nこちらのgithubページ(https://github.com/toriato/stable-diffusion-webui-wd14-tagger#mrsmilingwolfs-model-ak"
  },
  {
    "path": "fine_tune.py",
    "chars": 23726,
    "preview": "# training with captions\n# XXX dropped option: hypernetwork training\n\nimport argparse\nimport math\nimport os\nfrom multipr"
  },
  {
    "path": "finetune/blip/blip.py",
    "chars": 11275,
    "preview": "'''\n * Copyright (c) 2022, salesforce.com, inc.\n * All rights reserved.\n * SPDX-License-Identifier: BSD-3-Clause\n * For "
  },
  {
    "path": "finetune/blip/med.py",
    "chars": 41786,
    "preview": "'''\n * Copyright (c) 2022, salesforce.com, inc.\n * All rights reserved.\n * SPDX-License-Identifier: BSD-3-Clause\n * For "
  },
  {
    "path": "finetune/blip/med_config.json",
    "chars": 527,
    "preview": "{\n    \"architectures\": [\n      \"BertModel\"\n    ],\n    \"attention_probs_dropout_prob\": 0.1,\n    \"hidden_act\": \"gelu\",\n   "
  },
  {
    "path": "finetune/blip/vit.py",
    "chars": 14240,
    "preview": "'''\n * Copyright (c) 2022, salesforce.com, inc.\n * All rights reserved.\n * SPDX-License-Identifier: BSD-3-Clause\n * For "
  },
  {
    "path": "finetune/clean_captions_and_tags.py",
    "chars": 6073,
    "preview": "# このスクリプトのライセンスは、Apache License 2.0とします\n# (c) 2022 Kohya S. @kohya_ss\n\nimport argparse\nimport glob\nimport os\nimport json"
  },
  {
    "path": "finetune/hypernetwork_nai.py",
    "chars": 3551,
    "preview": "# NAI compatible\n\nimport torch\n\n\nclass HypernetworkModule(torch.nn.Module):\n  def __init__(self, dim, multiplier=1.0):\n "
  },
  {
    "path": "finetune/make_captions.py",
    "chars": 7740,
    "preview": "import argparse\nimport glob\nimport os\nimport json\nimport random\nimport sys\n\nfrom pathlib import Path\nfrom PIL import Ima"
  },
  {
    "path": "finetune/make_captions_by_git.py",
    "chars": 6754,
    "preview": "import argparse\nimport os\nimport re\n\nfrom pathlib import Path\nfrom PIL import Image\nfrom tqdm import tqdm\n\nimport torch\n"
  },
  {
    "path": "finetune/merge_captions_to_metadata.py",
    "chars": 3541,
    "preview": "import argparse\nimport json\nfrom pathlib import Path\nfrom typing import List\nfrom tqdm import tqdm\nimport library.train_"
  },
  {
    "path": "finetune/merge_dd_tags_to_metadata.py",
    "chars": 3208,
    "preview": "import argparse\nimport json\nfrom pathlib import Path\nfrom typing import List\nfrom tqdm import tqdm\nimport library.train_"
  },
  {
    "path": "finetune/prepare_buckets_latents.py",
    "chars": 10706,
    "preview": "import argparse\nimport os\nimport json\n\nfrom pathlib import Path\nfrom typing import List\nfrom tqdm import tqdm\nimport num"
  },
  {
    "path": "finetune/tag_images_by_wd14_tagger.py",
    "chars": 32501,
    "preview": "import argparse\nimport csv\nimport json\nimport math\nimport os\nfrom pathlib import Path\nfrom typing import Optional\n\nimpor"
  },
  {
    "path": "flux_minimal_inference.py",
    "chars": 20945,
    "preview": "# Minimum Inference Code for FLUX\n\nimport argparse\nimport datetime\nimport math\nimport os\nimport random\nfrom typing impor"
  },
  {
    "path": "flux_train.py",
    "chars": 37794,
    "preview": "# training with captions\n\n# Swap blocks between CPU and GPU:\n# This implementation is inspired by and based on the work "
  },
  {
    "path": "flux_train_control_net.py",
    "chars": 39070,
    "preview": "# training with captions\n\n# Swap blocks between CPU and GPU:\n# This implementation is inspired by and based on the work "
  },
  {
    "path": "flux_train_network.py",
    "chars": 25845,
    "preview": "import argparse\nimport copy\nimport math\nimport random\nfrom typing import Any, Optional, Union\n\nimport torch\nfrom acceler"
  },
  {
    "path": "gen_img.py",
    "chars": 150453,
    "preview": "import itertools\nimport json\nfrom types import SimpleNamespace\nfrom typing import Any, List, NamedTuple, Optional, Tuple"
  },
  {
    "path": "gen_img_diffusers.py",
    "chars": 170133,
    "preview": "\"\"\"\nVGG(\n  (features): Sequential(\n    (0): Conv2d(3, 64, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))\n    (1): Re"
  },
  {
    "path": "hunyuan_image_minimal_inference.py",
    "chars": 50496,
    "preview": "import argparse\nimport datetime\nimport gc\nfrom importlib.util import find_spec\nimport random\nimport os\nimport re\nimport "
  },
  {
    "path": "hunyuan_image_train_network.py",
    "chars": 30696,
    "preview": "import argparse\nimport copy\nimport gc\nfrom typing import Any, Optional, Union, cast\nimport os\nimport time\nfrom types imp"
  },
  {
    "path": "library/__init__.py",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "library/adafactor_fused.py",
    "chars": 4376,
    "preview": "import math\nimport torch\nfrom transformers import Adafactor\n\n# stochastic rounding for bfloat16\n# The implementation was"
  },
  {
    "path": "library/anima_models.py",
    "chars": 64801,
    "preview": "# Anima Model Architecture\n# Original code: NVIDIA CORPORATION & AFFILIATES, licensed under Apache-2.0\n\nimport math\nfrom"
  },
  {
    "path": "library/anima_train_utils.py",
    "chars": 21114,
    "preview": "# Anima Training Utilities\n\nimport argparse\nimport gc\nimport math\nimport os\nimport time\nfrom typing import Optional\n\nimp"
  },
  {
    "path": "library/anima_utils.py",
    "chars": 12492,
    "preview": "# Anima model loading/saving utilities\n\nimport os\nfrom typing import Dict, List, Optional, Union\nimport torch\nfrom safet"
  },
  {
    "path": "library/attention.py",
    "chars": 11409,
    "preview": "# Unified attention function supporting various implementations\n\nfrom dataclasses import dataclass\nimport torch\nfrom typ"
  },
  {
    "path": "library/attention_processors.py",
    "chars": 7697,
    "preview": "import math\nfrom typing import Any\nfrom einops import rearrange\nimport torch\nfrom diffusers.models.attention_processor i"
  },
  {
    "path": "library/chroma_models.py",
    "chars": 28117,
    "preview": "# copy from the official repo: https://github.com/lodestone-rock/flow/blob/master/src/models/chroma/model.py\n# and modif"
  },
  {
    "path": "library/config_util.py",
    "chars": 27464,
    "preview": "import argparse\nfrom dataclasses import (\n    asdict,\n    dataclass,\n)\nimport functools\nimport random\nfrom textwrap impo"
  },
  {
    "path": "library/custom_offloading_utils.py",
    "chars": 13300,
    "preview": "from concurrent.futures import ThreadPoolExecutor\nimport gc\nimport time\nfrom typing import Any, Optional, Union, Callabl"
  },
  {
    "path": "library/custom_train_functions.py",
    "chars": 22286,
    "preview": "from diffusers.schedulers.scheduling_ddpm import DDPMScheduler\r\nimport torch\r\nimport argparse\r\nimport random\r\nimport re\r"
  },
  {
    "path": "library/deepspeed_utils.py",
    "chars": 6928,
    "preview": "import os\nimport argparse\nimport torch\nfrom accelerate import DeepSpeedPlugin, Accelerator\n\nfrom .utils import setup_log"
  },
  {
    "path": "library/device_utils.py",
    "chars": 2680,
    "preview": "import functools\nimport gc\nfrom typing import Optional, Union\n\nimport torch\n\n\ntry:\n    # intel gpu support for pytorch o"
  },
  {
    "path": "library/flux_models.py",
    "chars": 49345,
    "preview": "# copy from FLUX repo: https://github.com/black-forest-labs/flux\n# license: Apache-2.0 License\n\n\nimport math\nimport os\ni"
  },
  {
    "path": "library/flux_train_utils.py",
    "chars": 26779,
    "preview": "import argparse\nimport math\nimport os\nimport numpy as np\nimport toml\nimport json\nimport time\nfrom typing import Callable"
  },
  {
    "path": "library/flux_utils.py",
    "chars": 22722,
    "preview": "import json\nimport os\nfrom dataclasses import replace\nfrom typing import List, Optional, Tuple, Union\n\nimport einops\nimp"
  },
  {
    "path": "library/fp8_optimization_utils.py",
    "chars": 19999,
    "preview": "import os\nfrom typing import List, Optional, Union\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\ni"
  },
  {
    "path": "library/huggingface_util.py",
    "chars": 2964,
    "preview": "from typing import Union, BinaryIO\nfrom huggingface_hub import HfApi\nfrom pathlib import Path\nimport argparse\nimport os\n"
  },
  {
    "path": "library/hunyuan_image_models.py",
    "chars": 19309,
    "preview": "# Original work: https://github.com/Tencent-Hunyuan/HunyuanImage-2.1\n# Re-implemented for license compliance for sd-scri"
  },
  {
    "path": "library/hunyuan_image_modules.py",
    "chars": 31477,
    "preview": "# Original work: https://github.com/Tencent-Hunyuan/HunyuanImage-2.1\n# Re-implemented for license compliance for sd-scri"
  },
  {
    "path": "library/hunyuan_image_text_encoder.py",
    "chars": 50513,
    "preview": "import json\nimport re\nfrom typing import Tuple, Optional, Union\nimport torch\nfrom transformers import (\n    AutoTokenize"
  },
  {
    "path": "library/hunyuan_image_utils.py",
    "chars": 17275,
    "preview": "# Original work: https://github.com/Tencent-Hunyuan/HunyuanImage-2.1\n# Re-implemented for license compliance for sd-scri"
  },
  {
    "path": "library/hunyuan_image_vae.py",
    "chars": 28774,
    "preview": "from typing import Optional, Tuple\n\nfrom einops import rearrange\nimport numpy as np\nimport torch\nfrom torch import Tenso"
  },
  {
    "path": "library/hypernetwork.py",
    "chars": 6742,
    "preview": "import torch\nimport torch.nn.functional as F\nfrom diffusers.models.attention_processor import (\n    Attention,\n    AttnP"
  },
  {
    "path": "library/ipex/__init__.py",
    "chars": 11398,
    "preview": "import os\nimport sys\nimport torch\ntry:\n    import intel_extension_for_pytorch as ipex # pylint: disable=import-error, un"
  },
  {
    "path": "library/ipex/attention.py",
    "chars": 6364,
    "preview": "import os\nimport torch\nfrom functools import cache, wraps\n\n# pylint: disable=protected-access, missing-function-docstrin"
  },
  {
    "path": "library/ipex/diffusers.py",
    "chars": 5400,
    "preview": "from functools import wraps\nimport torch\nimport diffusers # pylint: disable=import-error\nfrom diffusers.utils import tor"
  },
  {
    "path": "library/ipex/hijacks.py",
    "chars": 20585,
    "preview": "import os\nfrom functools import wraps\nfrom contextlib import nullcontext\nimport torch\nimport numpy as np\n\ntorch_version "
  },
  {
    "path": "library/jpeg_xl_util.py",
    "chars": 6595,
    "preview": "# Modified from https://github.com/Fraetor/jxl_decode Original license: MIT\n# Added partial read support for up to 200x "
  },
  {
    "path": "library/lora_utils.py",
    "chars": 12309,
    "preview": "import os\nimport re\nfrom typing import Dict, List, Optional, Union\nimport torch\nfrom tqdm import tqdm\nfrom library.devic"
  },
  {
    "path": "library/lpw_stable_diffusion.py",
    "chars": 60858,
    "preview": "# copy from https://github.com/huggingface/diffusers/blob/main/examples/community/lpw_stable_diffusion.py\n# and modify t"
  },
  {
    "path": "library/lumina_models.py",
    "chars": 48161,
    "preview": "# Copyright Alpha VLLM/Lumina Image 2.0 and contributors\n# Copyright (c) Meta Platforms, Inc. and affiliates.\n# All righ"
  },
  {
    "path": "library/lumina_train_util.py",
    "chars": 40794,
    "preview": "import inspect\nimport argparse\nimport math\nimport os\nimport numpy as np\nimport time\nfrom typing import Callable, Dict, L"
  },
  {
    "path": "library/lumina_util.py",
    "chars": 9707,
    "preview": "import json\nimport os\nfrom dataclasses import replace\nfrom typing import List, Optional, Tuple, Union\n\nimport einops\nimp"
  },
  {
    "path": "library/model_util.py",
    "chars": 54883,
    "preview": "# v1: split from train_db_fixed.py.\n# v2: support safetensors\n\nimport math\nimport os\n\nimport torch\nfrom library.device_u"
  },
  {
    "path": "library/original_unet.py",
    "chars": 69011,
    "preview": "# Diffusers 0.10.2からStable Diffusionに必要な部分だけを持ってくる\n# 条件分岐等で不要な部分は削除している\n# コードの多くはDiffusersからコピーしている\n# 制約として、モデルのstate_di"
  },
  {
    "path": "library/qwen_image_autoencoder_kl.py",
    "chars": 70967,
    "preview": "# Copied and modified from Diffusers (via Musubi-Tuner). Original copyright notice follows.\n\n# Copyright 2025 The Qwen-I"
  },
  {
    "path": "library/safetensors_utils.py",
    "chars": 20088,
    "preview": "from dataclasses import dataclass\nimport os\nimport re\nimport numpy as np\nimport torch\nimport json\nimport struct\nfrom typ"
  },
  {
    "path": "library/sai_model_spec.py",
    "chars": 23063,
    "preview": "# based on https://github.com/Stability-AI/ModelSpec\nimport datetime\nimport hashlib\nimport argparse\nimport base64\nimport"
  },
  {
    "path": "library/sd3_models.py",
    "chars": 54643,
    "preview": "# some modules/classes are copied and modified from https://github.com/mcmonkey4eva/sd3-ref\n# the original code is licen"
  },
  {
    "path": "library/sd3_train_utils.py",
    "chars": 35897,
    "preview": "import argparse\nimport math\nimport os\nimport toml\nimport json\nimport time\nfrom typing import Dict, List, Optional, Tuple"
  },
  {
    "path": "library/sd3_utils.py",
    "chars": 10631,
    "preview": "from dataclasses import dataclass\nimport math\nimport re\nfrom typing import Dict, List, Optional, Union\nimport torch\nimpo"
  },
  {
    "path": "library/sdxl_lpw_stable_diffusion.py",
    "chars": 62685,
    "preview": "# copy from https://github.com/huggingface/diffusers/blob/main/examples/community/lpw_stable_diffusion.py\n# and modify t"
  },
  {
    "path": "library/sdxl_model_util.py",
    "chars": 22428,
    "preview": "import torch\nimport safetensors\nfrom accelerate import init_empty_weights\nfrom accelerate.utils.modeling import set_modu"
  },
  {
    "path": "library/sdxl_original_control_net.py",
    "chars": 9971,
    "preview": "# some parts are modified from Diffusers library (Apache License 2.0)\n\nimport math\nfrom types import SimpleNamespace\nfro"
  },
  {
    "path": "library/sdxl_original_unet.py",
    "chars": 45635,
    "preview": "# Diffusersのコードをベースとした sd_xl_baseのU-Net\n# state dictの形式をSDXLに合わせてある\n\n\"\"\"\n      target: sgm.modules.diffusionmodules.open"
  },
  {
    "path": "library/sdxl_train_util.py",
    "chars": 13806,
    "preview": "import argparse\nimport math\nimport os\nfrom typing import Optional\n\nimport torch\nfrom library.device_utils import init_ip"
  },
  {
    "path": "library/slicing_vae.py",
    "chars": 23655,
    "preview": "# Modified from Diffusers to reduce VRAM usage\n\n# Copyright 2022 The HuggingFace Team. All rights reserved.\n#\n# Licensed"
  },
  {
    "path": "library/strategy_anima.py",
    "chars": 12078,
    "preview": "# Anima Strategy Classes\n\nimport os\nimport random\nfrom typing import Any, List, Optional, Tuple, Union\n\nimport numpy as "
  },
  {
    "path": "library/strategy_base.py",
    "chars": 24538,
    "preview": "# base class for platform strategies. this file defines the interface for strategies\n\nimport os\nimport re\nfrom typing im"
  },
  {
    "path": "library/strategy_flux.py",
    "chars": 11188,
    "preview": "import os\nimport glob\nfrom typing import Any, List, Optional, Tuple, Union\nimport torch\nimport numpy as np\nfrom transfor"
  },
  {
    "path": "library/strategy_hunyuan_image.py",
    "chars": 9244,
    "preview": "import os\nfrom typing import Any, List, Optional, Tuple, Union\nimport torch\nimport numpy as np\nfrom transformers import "
  },
  {
    "path": "library/strategy_lumina.py",
    "chars": 12390,
    "preview": "import glob\nimport os\nfrom typing import Any, List, Optional, Tuple, Union\n\nimport torch\nfrom transformers import AutoTo"
  },
  {
    "path": "library/strategy_sd.py",
    "chars": 8057,
    "preview": "import glob\nimport os\nfrom typing import Any, List, Optional, Tuple, Union\n\nimport torch\nfrom transformers import CLIPTo"
  },
  {
    "path": "library/strategy_sd3.py",
    "chars": 19032,
    "preview": "import os\nimport glob\nimport random\nfrom typing import Any, List, Optional, Tuple, Union\nimport torch\nimport numpy as np"
  },
  {
    "path": "library/strategy_sdxl.py",
    "chars": 14142,
    "preview": "import os\nfrom typing import Any, List, Optional, Tuple, Union\n\nimport numpy as np\nimport torch\nfrom transformers import"
  },
  {
    "path": "library/train_util.py",
    "chars": 274832,
    "preview": "# common functions for training\n\nimport argparse\nimport ast\nimport asyncio\nfrom concurrent.futures import Future, Thread"
  },
  {
    "path": "library/utils.py",
    "chars": 19937,
    "preview": "import logging\nimport sys\nimport threading\nfrom typing import *\n\nimport torch\nimport torch.nn as nn\nfrom torchvision imp"
  },
  {
    "path": "lumina_minimal_inference.py",
    "chars": 14028,
    "preview": "# Minimum Inference Code for Lumina\n# Based on flux_minimal_inference.py\n\nimport logging\nimport argparse\nimport math\nimp"
  },
  {
    "path": "lumina_train.py",
    "chars": 38794,
    "preview": "# training with captions\n\n# Swap blocks between CPU and GPU:\n# This implementation is inspired by and based on the work "
  },
  {
    "path": "lumina_train_network.py",
    "chars": 15860,
    "preview": "import argparse\nimport copy\nfrom typing import Any, Tuple\n\nimport torch\n\nfrom library.device_utils import clean_memory_o"
  },
  {
    "path": "networks/check_lora_weights.py",
    "chars": 1440,
    "preview": "import argparse\nimport os\nimport torch\nfrom safetensors.torch import load_file\nfrom library.utils import setup_logging\ns"
  },
  {
    "path": "networks/control_net_lllite.py",
    "chars": 18078,
    "preview": "import os\nfrom typing import Optional, List, Type\nimport torch\nfrom library import sdxl_original_unet\nfrom library.utils"
  },
  {
    "path": "networks/control_net_lllite_for_train.py",
    "chars": 20100,
    "preview": "# cond_imageをU-Netのforwardで渡すバージョンのControlNet-LLLite検証用実装\n# ControlNet-LLLite implementation for verification with cond_"
  },
  {
    "path": "networks/convert_anima_lora_to_comfy.py",
    "chars": 7635,
    "preview": "import argparse\nfrom safetensors.torch import save_file\nfrom safetensors import safe_open\n\n\nfrom library import train_ut"
  },
  {
    "path": "networks/convert_flux_lora.py",
    "chars": 20089,
    "preview": "# convert key mapping and data format from some LoRA format to another\n\"\"\"\nOriginal LoRA format: Based on Black Forest L"
  },
  {
    "path": "networks/convert_hunyuan_image_lora_to_comfy.py",
    "chars": 2743,
    "preview": "import argparse\nfrom safetensors.torch import save_file\nfrom safetensors import safe_open\nimport torch\n\n\nfrom library im"
  },
  {
    "path": "networks/dylora.py",
    "chars": 20971,
    "preview": "# some codes are copied from:\n# https://github.com/huawei-noah/KD-NLP/blob/main/DyLoRA/\n\n# Copyright (C) 2022. Huawei Te"
  },
  {
    "path": "networks/extract_lora_from_dylora.py",
    "chars": 4194,
    "preview": "# Convert LoRA to different rank approximation (should only be used to go to lower rank)\n# This code is based off the ex"
  },
  {
    "path": "networks/extract_lora_from_models.py",
    "chars": 13309,
    "preview": "# extract approximating LoRA by svd from two SD models\n# The code is based on https://github.com/cloneofsimo/lora/blob/d"
  },
  {
    "path": "networks/flux_extract_lora.py",
    "chars": 7131,
    "preview": "# extract approximating LoRA by svd from two FLUX models\n# The code is based on https://github.com/cloneofsimo/lora/blob"
  },
  {
    "path": "networks/flux_merge_lora.py",
    "chars": 32617,
    "preview": "import argparse\nimport math\nimport os\nimport time\nfrom typing import Any, Dict, Union\n\nimport torch\nfrom safetensors imp"
  },
  {
    "path": "networks/lora.py",
    "chars": 56915,
    "preview": "# LoRA network module\n# reference:\n# https://github.com/microsoft/LoRA/blob/main/loralib/layers.py\n# https://github.com/"
  },
  {
    "path": "networks/lora_anima.py",
    "chars": 26594,
    "preview": "# LoRA network module for Anima\nimport ast\nimport os\nimport re\nfrom typing import Dict, List, Optional, Tuple, Type, Uni"
  },
  {
    "path": "networks/lora_diffusers.py",
    "chars": 25600,
    "preview": "# Diffusersで動くLoRA。このファイル単独で完結する。\n# LoRA module for Diffusers. This file works independently.\n\nimport bisect\nimport math"
  },
  {
    "path": "networks/lora_fa.py",
    "chars": 48925,
    "preview": "# LoRA network module\n# reference:\n# https://github.com/microsoft/LoRA/blob/main/loralib/layers.py\n# https://github.com/"
  },
  {
    "path": "networks/lora_flux.py",
    "chars": 60769,
    "preview": "# temporary minimum implementation of LoRA\n# FLUX doesn't have Conv2d, so we ignore it\n# TODO commonize with the origina"
  },
  {
    "path": "networks/lora_hunyuan_image.py",
    "chars": 14673,
    "preview": "# temporary minimum implementation of LoRA\n# FLUX doesn't have Conv2d, so we ignore it\n# TODO commonize with the origina"
  },
  {
    "path": "networks/lora_interrogator.py",
    "chars": 5568,
    "preview": "\n\nfrom tqdm import tqdm\nfrom library import model_util\nimport library.train_util as train_util\nimport argparse\nfrom tran"
  },
  {
    "path": "networks/lora_lumina.py",
    "chars": 43548,
    "preview": "# temporary minimum implementation of LoRA\n# Lumina 2 does not have Conv2d, so ignore\n# TODO commonize with the original"
  },
  {
    "path": "networks/lora_sd3.py",
    "chars": 35485,
    "preview": "# temporary minimum implementation of LoRA\n# SD3 doesn't have Conv2d, so we ignore it\n# TODO commonize with the original"
  },
  {
    "path": "networks/merge_lora.py",
    "chars": 14231,
    "preview": "import math\nimport argparse\nimport os\nimport time\nimport torch\nfrom safetensors.torch import load_file, save_file\nfrom l"
  },
  {
    "path": "networks/merge_lora_old.py",
    "chars": 6980,
    "preview": "\n\nimport argparse\nimport os\nimport torch\nfrom safetensors.torch import load_file, save_file\nimport library.model_util as"
  },
  {
    "path": "networks/oft.py",
    "chars": 15980,
    "preview": "# OFT network module\n\nimport math\nimport os\nfrom typing import Dict, List, Optional, Tuple, Type, Union\nfrom diffusers i"
  },
  {
    "path": "networks/oft_flux.py",
    "chars": 16410,
    "preview": "# OFT network module\n\nimport math\nimport os\nfrom typing import Dict, List, Optional, Tuple, Type, Union\nfrom diffusers i"
  },
  {
    "path": "networks/resize_lora.py",
    "chars": 15016,
    "preview": "# Convert LoRA to different rank approximation (should only be used to go to lower rank)\n# This code is based off the ex"
  },
  {
    "path": "networks/sdxl_merge_lora.py",
    "chars": 20143,
    "preview": "import itertools\nimport math\nimport argparse\nimport os\nimport time\nimport concurrent.futures\nimport torch\nfrom safetenso"
  },
  {
    "path": "networks/svd_merge_lora.py",
    "chars": 16942,
    "preview": "import argparse\nimport itertools\nimport json\nimport os\nimport re\nimport time\nimport torch\nfrom safetensors.torch import "
  },
  {
    "path": "pytest.ini",
    "chars": 159,
    "preview": "[pytest]\nminversion = 6.0\ntestpaths =\n    tests\nfilterwarnings =\n    ignore::DeprecationWarning\n    ignore::UserWarning\n"
  },
  {
    "path": "pytorch_lightning/__init__.py",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "pytorch_lightning/callbacks/__init__.py",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "pytorch_lightning/callbacks/model_checkpoint.py",
    "chars": 70,
    "preview": "# dummy module for pytorch_lightning\n\nclass ModelCheckpoint:\n    pass\n"
  },
  {
    "path": "requirements.txt",
    "chars": 1066,
    "preview": "accelerate==1.6.0\ntransformers==4.54.1\ndiffusers[torch]==0.32.1\nftfy==6.3.1\n# albumentations==1.3.0\nopencv-python==4.10."
  },
  {
    "path": "sd3_minimal_inference.py",
    "chars": 14614,
    "preview": "# Minimum Inference Code for SD3\n\nimport argparse\nimport datetime\nimport math\nimport os\nimport random\nfrom typing import"
  },
  {
    "path": "sd3_train.py",
    "chars": 48111,
    "preview": "# training with captions\n\nimport argparse\nfrom concurrent.futures import ThreadPoolExecutor\nimport copy\nimport math\nimpo"
  },
  {
    "path": "sd3_train_network.py",
    "chars": 24105,
    "preview": "import argparse\nimport copy\nimport math\nimport random\nfrom typing import Any, Optional, Union\n\nimport torch\nfrom acceler"
  },
  {
    "path": "sdxl_gen_img.py",
    "chars": 135512,
    "preview": "import itertools\nimport json\nfrom typing import Any, List, NamedTuple, Optional, Tuple, Union, Callable\nimport glob\nimpo"
  },
  {
    "path": "sdxl_minimal_inference.py",
    "chars": 13116,
    "preview": "# 手元で推論を行うための最低限のコード。HuggingFace/DiffusersのCLIP、schedulerとVAEを使う\n# Minimal code for performing inference at local. Use H"
  },
  {
    "path": "sdxl_train.py",
    "chars": 41931,
    "preview": "# training with captions\n\nimport argparse\nimport math\nimport os\nfrom multiprocessing import Value\nfrom typing import Lis"
  },
  {
    "path": "sdxl_train_control_net.py",
    "chars": 29995,
    "preview": "import argparse\nimport math\nimport os\nimport random\nfrom multiprocessing import Value\nimport toml\n\nfrom tqdm import tqdm"
  },
  {
    "path": "sdxl_train_control_net_lllite.py",
    "chars": 27992,
    "preview": "# cond_imageをU-Netのforwardで渡すバージョンのControlNet-LLLite検証用学習コード\n# training code for ControlNet-LLLite with passing cond_ima"
  },
  {
    "path": "sdxl_train_control_net_lllite_old.py",
    "chars": 25512,
    "preview": "import argparse\nimport json\nimport math\nimport os\nimport random\nimport time\nfrom multiprocessing import Value\nfrom types"
  },
  {
    "path": "sdxl_train_network.py",
    "chars": 10359,
    "preview": "import argparse\nfrom typing import List, Optional, Union\n\nimport torch\nfrom accelerate import Accelerator\nfrom library.d"
  },
  {
    "path": "sdxl_train_textual_inversion.py",
    "chars": 5247,
    "preview": "import argparse\nimport os\nfrom typing import Optional, Union\n\nimport regex\n\nimport torch\nfrom library.device_utils impor"
  },
  {
    "path": "setup.py",
    "chars": 97,
    "preview": "from setuptools import setup, find_packages\n \nsetup(name = \"library\", packages = find_packages())"
  },
  {
    "path": "tests/README.md",
    "chars": 881,
    "preview": "# Tests\n\n## Install\n\n```\npip install pytest\n```\n\n## Usage\n\n```\npytest\n```\n\n## Contribution\n\nPytest is configured to run "
  },
  {
    "path": "tests/library/test_flux_train_utils.py",
    "chars": 7547,
    "preview": "import pytest\nimport torch\nfrom unittest.mock import MagicMock, patch\nfrom library.flux_train_utils import (\n    get_noi"
  },
  {
    "path": "tests/library/test_lumina_models.py",
    "chars": 10313,
    "preview": "import pytest\nimport torch\n\nfrom library.lumina_models import (\n    LuminaParams,\n    to_cuda,\n    to_cpu,\n    RopeEmbed"
  },
  {
    "path": "tests/library/test_lumina_train_util.py",
    "chars": 8002,
    "preview": "import pytest\nimport torch\nimport math\n\nfrom library.lumina_train_util import (\n    batchify,\n    time_shift,\n    get_li"
  },
  {
    "path": "tests/library/test_lumina_util.py",
    "chars": 4297,
    "preview": "import torch\nfrom torch.nn.modules import conv\n\nfrom library import lumina_util\n\n\ndef test_unpack_latents():\n    # Creat"
  },
  {
    "path": "tests/library/test_sai_model_spec.py",
    "chars": 13596,
    "preview": "\"\"\"Tests for sai_model_spec module.\"\"\"\n\nimport pytest\nimport time\n\nfrom library import sai_model_spec\n\n\nclass MockArgs:\n"
  },
  {
    "path": "tests/library/test_strategy_lumina.py",
    "chars": 9661,
    "preview": "import os\nimport tempfile\nimport torch\nimport numpy as np\nfrom unittest.mock import patch\nfrom transformers import Gemma"
  },
  {
    "path": "tests/manual_test_anima_cache.py",
    "chars": 24289,
    "preview": "\"\"\"\nDiagnostic script to test Anima latent & text encoder caching independently.\n\nUsage:\n    python manual_test_anima_ca"
  },
  {
    "path": "tests/manual_test_anima_real_training.py",
    "chars": 8664,
    "preview": "\"\"\"\nTest script that actually runs anima_train.py and anima_train_network.py\nfor a few steps to verify --cache_text_enco"
  },
  {
    "path": "tests/test_custom_offloading_utils.py",
    "chars": 13039,
    "preview": "import pytest\nimport torch\nimport torch.nn as nn\nfrom unittest.mock import patch, MagicMock\n\nfrom library.custom_offload"
  },
  {
    "path": "tests/test_fine_tune.py",
    "chars": 133,
    "preview": "import fine_tune\n\n\ndef test_syntax():\n    # Very simply testing that the train_network imports without syntax errors\n   "
  },
  {
    "path": "tests/test_flux_train.py",
    "chars": 134,
    "preview": "import flux_train\n\n\ndef test_syntax():\n    # Very simply testing that the train_network imports without syntax errors\n  "
  },
  {
    "path": "tests/test_flux_train_network.py",
    "chars": 146,
    "preview": "import flux_train_network\n\ndef test_syntax():\n    # Very simply testing that the flux_train_network imports without synt"
  },
  {
    "path": "tests/test_lumina_train_network.py",
    "chars": 6874,
    "preview": "import pytest\nimport torch\nfrom unittest.mock import MagicMock, patch\nimport argparse\n\nfrom library import lumina_models"
  },
  {
    "path": "tests/test_optimizer.py",
    "chars": 5111,
    "preview": "from unittest.mock import patch\nfrom library.train_util import get_optimizer\nfrom train_network import setup_parser\nimpo"
  },
  {
    "path": "tests/test_sd3_train.py",
    "chars": 133,
    "preview": "import sd3_train\n\n\ndef test_syntax():\n    # Very simply testing that the train_network imports without syntax errors\n   "
  },
  {
    "path": "tests/test_sd3_train_network.py",
    "chars": 145,
    "preview": "import sd3_train_network\n\ndef test_syntax():\n    # Very simply testing that the flux_train_network imports without synta"
  },
  {
    "path": "tests/test_sdxl_train.py",
    "chars": 134,
    "preview": "import sdxl_train\n\n\ndef test_syntax():\n    # Very simply testing that the train_network imports without syntax errors\n  "
  },
  {
    "path": "tests/test_sdxl_train_network.py",
    "chars": 142,
    "preview": "import sdxl_train_network\n\n\ndef test_syntax():\n    # Very simply testing that the train_network imports without syntax e"
  }
]

// ... and 23 more files (download for full content)

About this extraction

This page contains the full source code of the kohya-ss/sd-scripts GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 223 files (14.9 MB), approximately 3.9M tokens, and a symbol index with 2802 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!