Update README.md
Browse files
README.md
CHANGED
|
@@ -11,4 +11,104 @@ pinned: true
|
|
| 11 |
short_description: Apply the color grade from one image to another image
|
| 12 |
---
|
| 13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
| 11 |
short_description: Apply the color grade from one image to another image
|
| 12 |
---
|
| 13 |
|
| 14 |
+
# π Color Grade Transfer
|
| 15 |
+
|
| 16 |
+
**Transfer color grade directly from reference image to source image without manual color grading.**
|
| 17 |
+
|
| 18 |
+
[](https://huggingface.co/build-small-hackathon)
|
| 19 |
+
[](https://huggingface.co/build-small-hackathon)
|
| 20 |
+
[](https://huggingface.co/build-small-hackathon)
|
| 21 |
+
|
| 22 |
+
[](https://youtu.be/DqlLDDgV3kQ)
|
| 23 |
+
[](https://x.com/ovi054/status/2064060651706925403)
|
| 24 |
+
[](https://huggingface.co/spaces/build-small-hackathon/Color-Grade-Transfer)
|
| 25 |
+
|
| 26 |
+
## π Overview
|
| 27 |
+
|
| 28 |
+
It transfers the color grading from a reference image directly onto a source image.
|
| 29 |
+
|
| 30 |
+
### Key Features
|
| 31 |
+
* **Direct Color Transfer:** Copies styling from a reference image to a source image without manual grading.
|
| 32 |
+
* **4-Step Inference:** Uses a lightning adapter for fast, low-step generation.
|
| 33 |
+
* **Aspect Ratio Alignment:** Uses an internal VAE dimension calculation ($1\text{MP}$ equivalent) to ensure the 2-D RoPE coordinate systems match, eliminating structural pixel shifts during inference.
|
| 34 |
+
* **Interactive UI:** Features a side-by-side image comparison slider.
|
| 35 |
+
* **MCP Compliant:** Work as a backend tool for Model Context Protocol clients.
|
| 36 |
+
|
| 37 |
+
---
|
| 38 |
+
|
| 39 |
+
|
| 40 |
+
### π οΈ Core Constraints
|
| 41 |
+
* **Small Models Only:** Powered by the `Qwen-Image-Edit-2511` architecture family running at 20B parameters safely satisfying the $\le$ 32 Billion parameter limit.
|
| 42 |
+
* π **Off the Grid (Local-First):** **No cloud APIs are used.** The pipeline loads the model weights and runs entirely on the host GPU hardware.
|
| 43 |
+
* π― **Well-Tuned:** Utilizes a custom fine-tuned LoRA adapter published directly on my Hugging Face Hub (`ovi054/QIE-2511-Color-Grade-Transfer-LoRA`).
|
| 44 |
+
|
| 45 |
+
---
|
| 46 |
+
|
| 47 |
+
|
| 48 |
+
## π§ LoRA Fine-Tuning Process
|
| 49 |
+
|
| 50 |
+
Curating a clean dataset for custom style mapping is often the bottleneck of training. To overcome this, a systematic data-generation technique was engineered to produce high-fidelity, bidirectional training pairs.
|
| 51 |
+
|
| 52 |
+
### The Dataset Recipe
|
| 53 |
+
1. **Palette Extraction:** Two entirely different content images were chosen.
|
| 54 |
+
2. **Homogeneous Grading:** The exact same color palette was applied to both images so they shared an identical color profile.
|
| 55 |
+
3. **Cross-Pair Mapping:** * The newly graded version of *Image B* was assigned as the color-style reference for *Image A*.
|
| 56 |
+
* The inputs were then flipped, mapping the graded version of *Image A* as the reference for *Image B*.
|
| 57 |
+
4. This instantly generated **two highly consistent training pairs** per asset set, allowing the dataset to scale efficiently without content bleeding or style loss.
|
| 58 |
+
|
| 59 |
+
### Versatility & Flexibility
|
| 60 |
+
Because the dataset decoupling separated semantic structure from global grading parameters, the fine-tuned LoRA natively generalizes across all input configurations:
|
| 61 |
+
* π€ βοΈ π€ **Character to Character**
|
| 62 |
+
* ποΈ βοΈ ποΈ **Scene to Scene**
|
| 63 |
+
* π€ βοΈ ποΈ **Character to Scene** / **Scene to Character**
|
| 64 |
+
|
| 65 |
+
### βοΈ Training Hyperparameters
|
| 66 |
+
The model was fine-tuned using the following precise configuration settings:
|
| 67 |
+
|
| 68 |
+
| Configuration Category | Parameter | Value / Setting |
|
| 69 |
+
| :--- | :--- | :--- |
|
| 70 |
+
| **Saving Settings** | Save Precision | `bf16` |
|
| 71 |
+
| **Learning Rate** | Learning Rate | `0.0001` |
|
| 72 |
+
| | Optimizer | `AdamW` |
|
| 73 |
+
| **Dataset Settings** | Base Resolution | $1024 \times 1024$ |
|
| 74 |
+
| | Enable Bucket | True (`open`) |
|
| 75 |
+
| | Min Bucket Reso | `128` |
|
| 76 |
+
| | Max Bucket Reso | `8192` |
|
| 77 |
+
| | Bucket Reso Steps | `64` |
|
| 78 |
+
| **Network Settings** | Network Rank Dim (Rank) | `16` |
|
| 79 |
+
| | Network Alpha | `16` |
|
| 80 |
+
| **Advanced Settings** | Seed | `-1` (Randomized) |
|
| 81 |
+
|
| 82 |
+
---
|
| 83 |
+
|
| 84 |
+
|
| 85 |
+
## π Quick Start
|
| 86 |
+
|
| 87 |
+
### 1. Using the Web UI
|
| 88 |
+
1. Upload your content image to **Image 1 (Source)**.
|
| 89 |
+
2. Upload your target style image to **Image 2 (Color Grade Reference)**.
|
| 90 |
+
3. Click **π¨ Transfer Color Grade**.
|
| 91 |
+
|
| 92 |
+
---
|
| 93 |
+
|
| 94 |
+
## βοΈ Tech Stack
|
| 95 |
+
|
| 96 |
+
* **Base Model:** `Qwen/Qwen-Image-Edit-2511`
|
| 97 |
+
* **LoRA Adapters:**
|
| 98 |
+
* `ovi054/QIE-2511-Color-Grade-Transfer-LoRA` (Color grade transfer fine-tune)
|
| 99 |
+
* `lightx2v/Qwen-Image-Edit-2511-Lightning` (4-step inference)
|
| 100 |
+
* **Frontend:** Gradio (`Citrus` theme)
|
| 101 |
+
|
| 102 |
+
---
|
| 103 |
+
|
| 104 |
+
## π Project Links
|
| 105 |
+
|
| 106 |
+
### Live Demo
|
| 107 |
+
* **Hugging Face Space:** [Color Grade Transfer](https://huggingface.co/spaces/build-small-hackathon/Color-Grade-Transfer)
|
| 108 |
+
|
| 109 |
+
### Social Media & Demo
|
| 110 |
+
* **Twitter/X:** [](https://x.com/ovi054/status/2064060651706925403)
|
| 111 |
+
* **Hugging Face Post:** [Introducing Color Grade Transfer - HF](https://huggingface.co/posts/ovi054/229194823175599)
|
| 112 |
+
* **Youtube Video:** [Video](https://youtu.be/DqlLDDgV3kQ)
|
| 113 |
+
|
| 114 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|