Upload 19 files
Browse files- .gitattributes +11 -0
- CHANGELOG.md +120 -0
- README.md +63 -3
- docs/architecture.md +9 -0
- docs/imgs/detailer_process.gif +3 -0
- docs/imgs/inference.png +0 -0
- docs/imgs/inpaintbf.png +3 -0
- docs/imgs/inpainting.png +3 -0
- docs/imgs/new_ui.png +3 -0
- docs/imgs/new_ui_3.png +3 -0
- docs/imgs/new_ui_4.png +3 -0
- docs/imgs/patch_size_1.png +3 -0
- docs/imgs/patch_size_2.png +3 -0
- docs/imgs/sample.png +3 -0
- docs/imgs/sampling.png +3 -0
- docs/imgs/train_img.png +3 -0
- docs/imgs/train_loop.png +0 -0
- docs/training.md +49 -0
- docs/tree.md +51 -0
- docs/ui.md +69 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,14 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
docs/imgs/detailer_process.gif filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
docs/imgs/inpaintbf.png filter=lfs diff=lfs merge=lfs -text
|
| 38 |
+
docs/imgs/inpainting.png filter=lfs diff=lfs merge=lfs -text
|
| 39 |
+
docs/imgs/new_ui_3.png filter=lfs diff=lfs merge=lfs -text
|
| 40 |
+
docs/imgs/new_ui_4.png filter=lfs diff=lfs merge=lfs -text
|
| 41 |
+
docs/imgs/new_ui.png filter=lfs diff=lfs merge=lfs -text
|
| 42 |
+
docs/imgs/patch_size_1.png filter=lfs diff=lfs merge=lfs -text
|
| 43 |
+
docs/imgs/patch_size_2.png filter=lfs diff=lfs merge=lfs -text
|
| 44 |
+
docs/imgs/sample.png filter=lfs diff=lfs merge=lfs -text
|
| 45 |
+
docs/imgs/sampling.png filter=lfs diff=lfs merge=lfs -text
|
| 46 |
+
docs/imgs/train_img.png filter=lfs diff=lfs merge=lfs -text
|
CHANGELOG.md
ADDED
|
@@ -0,0 +1,120 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
## Update β 2026.11.20 Sampling: ETA injection equation selection & per-step latent β frame save
|
| 2 |
+
|
| 3 |
+
<img src="assets/eta_frame.png" alt="update" width="50%">
|
| 4 |
+
|
| 5 |
+
### ETA mode
|
| 6 |
+
|
| 7 |
+
`eta_mode = cos | ln | sin`
|
| 8 |
+
|
| 9 |
+
`ln`: `eta * ln(2 / (1 + x)) / ln 2`
|
| 10 |
+
|
| 11 |
+
<img src="assets/graph.png" alt="graph" width="30%">
|
| 12 |
+
|
| 13 |
+
Code: `src.utilities.predict`
|
| 14 |
+
|
| 15 |
+
- `Eta`: 0 is deterministic. The larger it is, the more fresh noise is injected at each step.
|
| 16 |
+
- `Eta mode`: schedule of the injected noise over the steps. Selectable in all three tabs.
|
| 17 |
+
|
| 18 |
+
### Frame save
|
| 19 |
+
|
| 20 |
+
Collect the latent at every step, decode all of them into images, and save them as an MP4.
|
| 21 |
+
|
| 22 |
+
<img src="assets/detailer_process.gif" controls width="600">
|
| 23 |
+
|
| 24 |
+
Toggle with **Frame save** in the Sampling panel.
|
| 25 |
+
|
| 26 |
+
### Batch
|
| 27 |
+
|
| 28 |
+
Generate 1β8 images at once. When Batch is greater than 1, numbered buttons under the result switch between images. Hover over an image to see its seed.
|
| 29 |
+
|
| 30 |
+
---
|
| 31 |
+
|
| 32 |
+
## Update β 2026.11.19 Sampling
|
| 33 |
+
|
| 34 |
+
- **Quantization**: optional quantized model loading, chosen at startup (`use quantization? y/n`). Lower VRAM usage; works with the block-offload mode.
|
| 35 |
+
- **Batch generation**: generate up to 8 images per run (Text2img / Inpainting). Results appear with numbered buttons to switch between images.
|
| 36 |
+
- **Detailer batch**: each generated patch is merged into a copy of the original image and saved separately. The original is never modified.
|
| 37 |
+
- **API**: `/api/generate` now accepts `batch` and returns `images` (array) and `path` (list) instead of a single `image`.
|
| 38 |
+
|
| 39 |
+
## Update β 2026.11.17 Sampling
|
| 40 |
+
|
| 41 |
+
### Sampling Improvements
|
| 42 |
+
|
| 43 |
+
- **DDIM sampler removed**
|
| 44 |
+
- Removed the standalone DDIM sampler due to unsatisfactory generation quality in the current implementation.
|
| 45 |
+
|
| 46 |
+
- **Noise Injection added to Euler and Heun**
|
| 47 |
+
- Introduced additional noise injection during the sampling process.
|
| 48 |
+
- Prevents the sampling trajectory from becoming overly constrained by the initial latent structure.
|
| 49 |
+
- Allows the model to reconstruct local features while better utilizing surrounding image context.
|
| 50 |
+
- Improves structural consistency across neighboring regions.
|
| 51 |
+
|
| 52 |
+
- **`eta` parameter (noise injection strength)**
|
| 53 |
+
- Each step integrates only down to `Ο_lo = Ο_next Γ (1 β eta)`, then re-noises back up to `Ο_next` with fresh noise.
|
| 54 |
+
- `eta = 0`: no noise injection. Identical to the original Euler / Heun / DDIM behavior.
|
| 55 |
+
- Higher `eta`: a larger back-and-forth interval per step, so more of the previous structure is re-noised and re-decided.
|
| 56 |
+
- Too high: details and composition can drift between steps, and Heun's second-order correction covers a shorter interval, so its benefit shrinks.
|
| 57 |
+
- Suggested starting range: `0.1 ~ 0.3` (default `0.3` for DDPM_PLUS). Tune per step count and CFG scale.
|
| 58 |
+
- The final step never injects noise, regardless of `eta`.
|
| 59 |
+
|
| 60 |
+
### Quality Improvements
|
| 61 |
+
|
| 62 |
+
- Improved eye and facial detail reconstruction.
|
| 63 |
+
- Better consistency between left and right facial features.
|
| 64 |
+
- Improved transitions between modified and preserved regions.
|
| 65 |
+
- Reduced local structural artifacts.
|
| 66 |
+
- Significant quality improvements in realistic image generation and inpainting.
|
| 67 |
+
|
| 68 |
+
### Available Samplers
|
| 69 |
+
|
| 70 |
+
| Sampler | Status | Uses `eta` |
|
| 71 |
+
|---|---|---|
|
| 72 |
+
| Euler + Noise Injection | Supported | Yes |
|
| 73 |
+
| Heun + Noise Injection | Supported | Yes |
|
| 74 |
+
| DDPM_PLUS | Supported | Yes |
|
| 75 |
+
| DDIM | Removed | - |
|
| 76 |
+
|
| 77 |
+
### Notes
|
| 78 |
+
|
| 79 |
+
Noise injection improves the model's ability to reconstruct local structures instead of relying too heavily on the initial latent representation.
|
| 80 |
+
|
| 81 |
+
This is particularly beneficial for realistic image generation, where fine details and spatial consistency are important.
|
| 82 |
+
|
| 83 |
+
## Inference Requirements
|
| 84 |
+
- **Inference:** Min VRAM 15GB
|
| 85 |
+
- **Storage:** Min 30GB free disk space (excluding `requirements.txt` packages)
|
| 86 |
+
- **Environment:** Local & Google Colab supported
|
| 87 |
+
|
| 88 |
+
## Update 2026 11 16 Sampling GPU Optimize
|
| 89 |
+
### CPU Offloading Mode
|
| 90 |
+
|
| 91 |
+
If your GPU has less than 15GB VRAM, run inference in CPU offloading mode.
|
| 92 |
+
The model stays on CPU; transformer blocks are streamed to the GPU in chunks.
|
| 93 |
+
|
| 94 |
+
On startup, choose `n`:
|
| 95 |
+
|
| 96 |
+
```
|
| 97 |
+
model upload on gpu (y or n): n
|
| 98 |
+
```
|
| 99 |
+
|
| 100 |
+
Then set the chunk size (layers loaded onto the GPU at once):
|
| 101 |
+
|
| 102 |
+
```
|
| 103 |
+
block chunk size (1~8, recommended 4):
|
| 104 |
+
```
|
| 105 |
+
|
| 106 |
+
| CHUNK | Layers on GPU | With prefetch | Approx. VRAM |
|
| 107 |
+
|-------|---------------|---------------|--------------|
|
| 108 |
+
| 1 | 1 | 2 | ~0.5GB |
|
| 109 |
+
| 2 | 2 | 4 | ~1.1GB |
|
| 110 |
+
| 4 | 4 | 8 | ~2.2GB |
|
| 111 |
+
| 8 | 8 | 16 | ~4.3GB |
|
| 112 |
+
|
| 113 |
+
- Larger chunk = faster, more VRAM.
|
| 114 |
+
- Smaller chunk = safer on low VRAM.
|
| 115 |
+
- Up to `2 Γ CHUNK` layers are resident with prefetch.
|
| 116 |
+
|
| 117 |
+
Trade-off: VRAM drops from ~15GB to ~3GB, but inference is slower due to
|
| 118 |
+
CPU-GPU PCIe transfers. Output quality may also be slightly lower than full
|
| 119 |
+
GPU mode (differences in floating-point precision and kernel accumulation
|
| 120 |
+
order across CPUβGPU transfers).
|
README.md
CHANGED
|
@@ -1,3 +1,63 @@
|
|
| 1 |
-
--
|
| 2 |
-
|
| 3 |
-
--
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Diffusion Text-to-Image
|
| 2 |
+
|
| 3 |
+
## UPDATE 2027-11-27
|
| 4 |
+
## UI Update
|
| 5 |
+
UI -> CLICK
|
| 6 |
+
|
| 7 |
+
## Backend
|
| 8 |
+
|
| 9 |
+
- Migrated the backend to **FastAPI**
|
| 10 |
+
- Sampling / inpainting run as background jobs (progress polling, live preview, cancel)
|
| 11 |
+
- Run: `uvicorn main:app --reload`
|
| 12 |
+
|
| 13 |
+
## Checkpoint
|
| 14 |
+
|
| 15 |
+
- Switched checkpoint format to **safetensors** (previously `.pt`)
|
| 16 |
+
|
| 17 |
+
---
|
| 18 |
+
|
| 19 |
+
## [Update](CHANGELOG.md) Β· [Train State](docs/training.md) Β· [Architecture](docs/architecture.md) Β· [UI](docs/ui.md) Β· [TREE](docs/tree.md)
|
| 20 |
+
|
| 21 |
+
---
|
| 22 |
+
|
| 23 |
+

|
| 24 |
+
|
| 25 |
+

|
| 26 |
+
|
| 27 |
+
## Installation
|
| 28 |
+
```bash
|
| 29 |
+
git clone https://github.com/FREEANIMA/diffusion-inference.git
|
| 30 |
+
cd diffusion-inference
|
| 31 |
+
python3 -m venv .venv
|
| 32 |
+
source .venv/bin/activate
|
| 33 |
+
python -m pip install -r requirements.txt
|
| 34 |
+
python main.py
|
| 35 |
+
```
|
| 36 |
+
|
| 37 |
+
## External Models
|
| 38 |
+
|
| 39 |
+
- **Autoencoder:** DC-AE f32c32 (32Γ compression, 32 latent channels)
|
| 40 |
+
- **Text Encoder:** T5-Large
|
| 41 |
+
|
| 42 |
+
## Model
|
| 43 |
+
|
| 44 |
+
- **Architecture:** MMDiT
|
| 45 |
+
- **Parameters:** 4B
|
| 46 |
+
- **Task:** Text-to-Image
|
| 47 |
+
- **Weights:** [Hugging Face](https://huggingface.co/honghong3/VER9) (currently being updated to VER10)
|
| 48 |
+
|
| 49 |
+
Please check the version in [version.py](version.py).
|
| 50 |
+
|
| 51 |
+
---
|
| 52 |
+
|
| 53 |
+
### Training Stages
|
| 54 |
+
|
| 55 |
+
| Stage | Description | Steps | Patch Size | max H x W |
|
| 56 |
+
|:---:|---|---:|:---:|:---:|
|
| 57 |
+
| Stage 1 | Pre-training | 600K | 2 | 1024 x 1024 |
|
| 58 |
+
| Stage 2 | Fine-tuning | 100k | 1 | 1024 x 1024 |
|
| 59 |
+
| Stage 3 | Fine-tuning | 300K | 1 | 2048 x 2048 |
|
| 60 |
+
|
| 61 |
+
---
|
| 62 |
+
|
| 63 |
+
- **GITHUB link** https://github.com/FREEANIMA/diffusion-inference.git
|
docs/architecture.md
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
### Train Architecture
|
| 2 |
+
- **Use Cache**
|
| 3 |
+
- **Cpu Multi Threading**
|
| 4 |
+
|
| 5 |
+

|
| 6 |
+
|
| 7 |
+
### Inference Architecture
|
| 8 |
+
|
| 9 |
+

|
docs/imgs/detailer_process.gif
ADDED
|
Git LFS Details
|
docs/imgs/inference.png
ADDED
|
docs/imgs/inpaintbf.png
ADDED
|
Git LFS Details
|
docs/imgs/inpainting.png
ADDED
|
Git LFS Details
|
docs/imgs/new_ui.png
ADDED
|
Git LFS Details
|
docs/imgs/new_ui_3.png
ADDED
|
Git LFS Details
|
docs/imgs/new_ui_4.png
ADDED
|
Git LFS Details
|
docs/imgs/patch_size_1.png
ADDED
|
Git LFS Details
|
docs/imgs/patch_size_2.png
ADDED
|
Git LFS Details
|
docs/imgs/sample.png
ADDED
|
Git LFS Details
|
docs/imgs/sampling.png
ADDED
|
Git LFS Details
|
docs/imgs/train_img.png
ADDED
|
Git LFS Details
|
docs/imgs/train_loop.png
ADDED
|
docs/training.md
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
## Train Environment
|
| 2 |
+
|
| 3 |
+
- **Framework:** PyTorch (no custom CUDA kernels)
|
| 4 |
+
- **GPU:** NVIDIA RTX PRO 6000 (96GB VRAM) x 1
|
| 5 |
+
- **Platform:** Google Colab
|
| 6 |
+
- **Batch Size:** Micro-batch 4 Γ Gradient Accumulation 8 = Effective Batch 32
|
| 7 |
+
|
| 8 |
+
- **Training Speed:** ~2.3 s / optimizer step
|
| 9 |
+
- **Max Resolution:** 1024 Γ 1024
|
| 10 |
+
- **Dataset:** 2M images
|
| 11 |
+
- **Objective:** Flow Matching
|
| 12 |
+
- **Precision:** BF16
|
| 13 |
+
- **Optimizer:** AdamW
|
| 14 |
+
- **Learning Rate:** 1e-4 ~ 5e~5
|
| 15 |
+
- **EMA:** Enabled
|
| 16 |
+
|
| 17 |
+
## Train UI
|
| 18 |
+
|
| 19 |
+

|
| 20 |
+
|
| 21 |
+
### Loss by Noise Level
|
| 22 |
+
|
| 23 |
+
| Noise Level | Average Loss |
|
| 24 |
+
|:---:|---:|
|
| 25 |
+
| 1.0 β 0.9 | 4.0 ~ 4.3 |
|
| 26 |
+
| 0.9 β 0.8 | 2.9 ~ 3.1 |
|
| 27 |
+
| 0.8 β 0.7 | 2.4 ~ 2.6 |
|
| 28 |
+
| 0.7 β 0.6 | 2.0 ~ 2.1 |
|
| 29 |
+
| 0.6 β 0.5 | 1.8 ~ 1.9 |
|
| 30 |
+
| 0.5 β 0.4 | 1.6 ~ 1.7 |
|
| 31 |
+
| 0.4 β 0.3 | 1.3 ~ 1.6 |
|
| 32 |
+
| 0.3 β 0.2 | 1.2 ~ 1.4 |
|
| 33 |
+
| 0.2 β 0.1 | 1.0 ~ 1.1 |
|
| 34 |
+
|
| 35 |
+
## Generation Results
|
| 36 |
+
|
| 37 |
+
### Patch Size 2 + DC-AE f32c32
|
| 38 |
+
|
| 39 |
+

|
| 40 |
+
|
| 41 |
+
- **Issue:** Facial features, particularly the eyes, tend to collapse or become distorted.
|
| 42 |
+
- **Observation:** Limited spatial detail makes accurate reconstruction of fine facial features challenging.
|
| 43 |
+
|
| 44 |
+
### Patch Size 1 + DC-AE f32c32
|
| 45 |
+
|
| 46 |
+

|
| 47 |
+
|
| 48 |
+
- **Fine-tuning Result:** Fine-tuning with patch size 1 improved facial feature reconstruction.
|
| 49 |
+
- **Improvement:** Eye and facial distortions were partially resolved, with better preservation of fine details.
|
docs/tree.md
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
## Project Structure
|
| 2 |
+
|
| 3 |
+
```text
|
| 4 |
+
src/
|
| 5 |
+
βββ core/
|
| 6 |
+
β βββ __init__.py
|
| 7 |
+
β βββ config.py
|
| 8 |
+
β βββ runtime.py
|
| 9 |
+
β βββ shared.py
|
| 10 |
+
β βββ state.py
|
| 11 |
+
β βββ utils.py
|
| 12 |
+
βββ external/
|
| 13 |
+
β βββ __init__.py
|
| 14 |
+
β βββ load.py
|
| 15 |
+
β βββ te.py
|
| 16 |
+
β βββ vae.py
|
| 17 |
+
βββ network/
|
| 18 |
+
β βββ mmdit_dcae/
|
| 19 |
+
β β βββ __init__.py
|
| 20 |
+
β β βββ Block.py
|
| 21 |
+
β β βββ Model.py
|
| 22 |
+
β β βββ patch_embedding.py
|
| 23 |
+
β β βββ Rope2D.py
|
| 24 |
+
β β βββ sinusoidal_pos_emb.py
|
| 25 |
+
β βββ tags_llm/
|
| 26 |
+
β β βββ __init__.py
|
| 27 |
+
β β βββ Block.py
|
| 28 |
+
β β βββ Model.py
|
| 29 |
+
β β βββ Rope1D.py
|
| 30 |
+
β βββ __init__.py
|
| 31 |
+
βββ sampling/
|
| 32 |
+
β βββ engine_internal/
|
| 33 |
+
β β βββ __init__.py
|
| 34 |
+
β β βββ setup.py
|
| 35 |
+
β β βββ solvers.py
|
| 36 |
+
β β βββ steps.py
|
| 37 |
+
β β βββ trajectory.py
|
| 38 |
+
β β βββ types.py
|
| 39 |
+
β β βββ utils.py
|
| 40 |
+
β βββ __init__.py
|
| 41 |
+
β βββ engine.py
|
| 42 |
+
βββ storage/
|
| 43 |
+
β βββ __init__.py
|
| 44 |
+
β βββ hub.py
|
| 45 |
+
β βββ load_checkpoint.py
|
| 46 |
+
βββ tag/
|
| 47 |
+
β βββ __init__.py
|
| 48 |
+
β βββ tags.py
|
| 49 |
+
β βββ utils.py
|
| 50 |
+
βββ __init__.py
|
| 51 |
+
```
|
docs/ui.md
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
## UI
|
| 2 |
+
|
| 3 |
+
## UI Update
|
| 4 |
+
|
| 5 |
+
- **Multi-prompt** support
|
| 6 |
+
- **Custom schedulers**
|
| 7 |
+
- Sigma scheduler (CDF-based)
|
| 8 |
+
- CFG scheduler
|
| 9 |
+
- Eta scheduler
|
| 10 |
+
- **Click-button revision**
|
| 11 |
+
|
| 12 |
+
## Screenshots
|
| 13 |
+
|
| 14 |
+
### Sampling
|
| 15 |
+
|
| 16 |
+

|
| 17 |
+
|
| 18 |
+
### Inpainting
|
| 19 |
+
|
| 20 |
+

|
| 21 |
+
|
| 22 |
+
- Compare
|
| 23 |
+
|
| 24 |
+

|
| 25 |
+
|
| 26 |
+
---
|
| 27 |
+
|
| 28 |
+
- Three tabs: **Text2img**, **Inpainting**, **Detailer**. The last tab is remembered, and `#txt2img`, `#inpainting`, `#detailer` in the URL open that tab directly.
|
| 29 |
+
- **Tag Browser**: browse and search tags by type, and click to add them to the prompt.
|
| 30 |
+
- **Tags autocomplete** and **History**: click a history entry to restore the input plus the expanded tags.
|
| 31 |
+
- **Fixed** switch: when on, only the entered tags are used and no LLM tag expansion happens.
|
| 32 |
+
- Only one job runs at a time. Generation runs in a background thread and the browser polls for the result, so long jobs do not hit proxy timeouts.
|
| 33 |
+
|
| 34 |
+
### UI
|
| 35 |
+
## Detailing & Inpainting
|
| 36 |
+
|
| 37 |
+
Both tabs share the same mask painter with two layers.
|
| 38 |
+
|
| 39 |
+
| Color | Mode | Meaning |
|
| 40 |
+
|-------|------|---------|
|
| 41 |
+
| Red | μ¬μμ± (Regen) | Area to redraw |
|
| 42 |
+
| Blue | 보쑴 (Keep) | Area that never changes |
|
| 43 |
+
| β | μ§μ°κ° (Erase) | Remove paint from both layers |
|
| 44 |
+
|
| 45 |
+
- Painting one color erases the other under the brush. The later stroke wins, so the layers never overlap.
|
| 46 |
+
- If nothing is painted, the whole image (inpainting) or the whole crop (detailer) is redrawn.
|
| 47 |
+
- Keep overrides Regen. The final redraw area is `regen Γ (1 β keep)`.
|
| 48 |
+
- Masks are resized to the sampling resolution with nearest-neighbor, so they stay binary.
|
| 49 |
+
- **Start T** (0β1): the point in the schedule where redrawing starts. Higher values change more, lower values stay closer to the original. For a full redraw without a mask, around 0.6 is recommended.
|
| 50 |
+
- **Brush**: brush size in px.
|
| 51 |
+
|
| 52 |
+
---
|
| 53 |
+
|
| 54 |
+
### Inpainting
|
| 55 |
+
|
| 56 |
+
1. Enter the image path and press **Load**.
|
| 57 |
+
2. Paint the Regen / Keep areas on the Original panel.
|
| 58 |
+
3. Press **Generate**. The result appears on the right and is saved to `inpainting/`.
|
| 59 |
+
|
| 60 |
+
The image is fitted so that the long side is 1024 and the short side is snapped to a multiple of `patch_size Γ compression_ratio`.
|
| 61 |
+
|
| 62 |
+
### Detailer
|
| 63 |
+
|
| 64 |
+
1. Enter the image path and press **Load**.
|
| 65 |
+
2. Drag a rectangle on the Original panel. The rectangle snaps to multiples of `patch_size Γ compression_ratio`, and only sizes that scale cleanly to `allowable_size` on the long side are allowed.
|
| 66 |
+
3. The selected area appears enlarged in **Crop Β· Mask**. Paint the Regen / Keep areas there. The label under the crop shows the original size β the enlarged size.
|
| 67 |
+
4. Press **Generate**. The crop is redrawn at the enlarged size, scaled back down, and pasted into the original image. The result is saved to `detailer/`.
|
| 68 |
+
|
| 69 |
+
---
|