Text-to-Image
Diffusers
English
image-to-image
image-editing
instruction-editing
reference-only
lora
anime
comfyui
Instructions to use bladealternate/anima-reference-edit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use bladealternate/anima-reference-edit with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("anima", dtype=torch.bfloat16, device_map="cuda") pipe.load_lora_weights("bladealternate/anima-reference-edit") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Draw Things
- DiffusionBee
|
Download README.md from bladealternate/anima-reference-edit: direct link, hf CLI and curl.
- Browser
- Download file 5.58 kB
-
https://huggingface.co/bladealternate/anima-reference-edit/resolve/main/README.md
- Command line
-
hf download hf://bladealternate/anima-reference-edit/README.md
-
curl -L -H "Authorization: Bearer $HF_TOKEN" -o README.md https://huggingface.co/bladealternate/anima-reference-edit/resolve/main/README.md
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 | |
| ``` | |