bladealternate's picture
Rename to Anima Reference Edit
2788969 verified
|
Raw History Blame Contribute Delete
5.58 kB
---
language:
- en
license: apache-2.0
tags:
- text-to-image
- image-to-image
- image-editing
- instruction-editing
- reference-only
- lora
- anime
- comfyui
- diffusers
base_model:
- anima
extra_gated_prompt: "Access to Anima Reference Edit weights requires manual confirmation for evaluation and research purposes."
extra_gated_fields:
Organization or Affiliation: text
Intended Use Case: text
---
# Anima Reference Edit: Reference & Instruction Image Editing LoRA (v3.0)
**Anima Reference Edit** is an instruction-guided image-to-image editing adapter engineered for high-fidelity anime image manipulation, style-consistent clothing swaps, character pose alteration, expression changes, and contextual background transformations while strictly preserving character identity.
This repository hosts the flagship **v3.0 Strong (Distractor-Suppressed)** release, trained on over 85,000 paired steps with decoupled asymmetric Key-Value (KV) cache conditioning.
---
## What Makes Anima Reference Edit Different?
Unlike standard image-to-image adapters or frame-concatenation methods, Anima Reference Edit v3.0 uses an **Asymmetric Cross-Attention KV-Caching** architecture:
* **Distractor Suppression:** Reference background clutter is decoupled and suppressed during cross-attention, preventing unwanted elements from bleeding into your target composition.
* **Resolution & Aspect Ratio Independence:** The reference image and generation canvas do not need to share dimensions. You can feed a 512Γ—512 square headshot to direct an edit on a 1024Γ—1536 full-body canvas without dimensional distortion or unnatural stretching.
* **Decoupled Positional Embeddings (RoPE):** Reference latents are processed with independent positional indices, preventing spatial coordinate collision between the reference character and the edited output.
---
## Provided Model Weights
| File Name | Format | Target Pipeline |
| :--- | :--- | :--- |
| **`anima_edit_v3_anima_ref_adapter_native.safetensors`** | Native Ref Adapter | Pre-converted with `diffusion_model.blocks` keys and embedded `arch: asym` metadata for instant plug-and-play in the official `ComfyUI-Anima-Ref-Adapter` custom node. |
| **`anima_edit_v3_standard_kohya_lora.safetensors`** | Standard Kohya LoRA | Retains standard Kohya training keys for use with standard ComfyUI LoRA Loaders, WebUI wrappers, and custom PyTorch diffusion scripts. |
---
## Critical Sampling Parameters
When running Anima Reference Edit on distilled / Turbo base models, strictly observe the following sampling rules:
| Parameter | Recommended Value | Critical Note |
| :--- | :--- | :--- |
| **CFG (Guidance Scale)** | **1.0 (Strict)** | On distilled/Turbo checkpoints, setting CFG > 1.0 causes immediate latent math divergence, resulting in washed out or blank white images. |
| **Sampling Steps** | **6 – 8 Steps** | Optimal convergence for Turbo backbones. |
| **Sampler** | **Euler / Euler Ancestral** | Standard deterministic or ancestral Euler trajectories. |
| **Scheduler** | **Normal / SGM Uniform** | Matches training timestep distribution. |
| **Adapter Strength** | **0.8 – 1.0** | Set to 1.0 for aggressive instruction adherence; 0.8 for subtle adjustments. |
---
## Prompting Rules & Best Practices
Anima Reference Edit operates on an **(Image + Instruction)** paradigm. Follow these guidelines for clean, artifact-free edits:
### 1. Use Direct Imperative Actions
State the desired modification as a clear, decisive action verb rather than an abstract description:
* **Clothing Swap:** `change outfit to white medical lab coat with stethoscope`
* **Pose / Action:** `sitting on a vintage leather sofa, reading an open hardcover book`
* **Facial Expression:** `gentle closed-mouth smile, looking directly at viewer`
* **Scene / Background:** `cyberpunk city alleyway with rain puddles and neon reflections`
* **Item Addition:** `holding an ornate brass lantern in her right hand`
* **Lighting / Atmosphere:** `dramatic sunset lighting, golden hour rim light`
### 2. Include 1–2 Anchor Tokens
Anchor the subject's primary identity features in the prompt so the text encoder aligns with the reference:
* *Example:* `1girl, emerald green eyes, dark brown bob cut, change clothes to formal black tuxedo`
* Anchoring reinforces facial features while leaving the rest of the canvas completely open to the instruction.
### 3. Maintain Concise Negative Prompts
Do not overload negative prompts. Turbo distillation benefits from lean negative strings:
* `worst quality, low quality, bad anatomy, deformed limbs, blurry, distorted eyes`
---
## ComfyUI Drag-and-Drop Workflow
Included directly in this repository is:
* **`AnimaEdit_Reference_Instruction_Workflow.json`**
### Quick Setup:
1. Drag and drop `AnimaEdit_Reference_Instruction_Workflow.json` into the ComfyUI window.
2. Ensure you have the `ComfyUI-Anima-Ref-Adapter` custom node installed (available via ComfyUI Manager).
3. Place `anima_edit_v3_anima_ref_adapter_native.safetensors` into your `ComfyUI/models/loras/` directory.
4. Load your reference character into the image input node, type your edit instruction into the positive prompt, set **CFG = 1.0**, **Steps = 6**, and generate.
---
## File Verification & Integrity
All files are provided as standard float/bfloat tensors in non-executable `.safetensors` format:
```text
anima-reference-edit/
β”œβ”€β”€ AnimaEdit_Reference_Instruction_Workflow.json
β”œβ”€β”€ anima_edit_v3_anima_ref_adapter_native.safetensors
β”œβ”€β”€ anima_edit_v3_standard_kohya_lora.safetensors
└── README.md
```