ovi054 commited on
Commit
e43b19f
Β·
verified Β·
1 Parent(s): b4d3000

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +100 -0
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
+ [![Build Small Hackathon](https://img.shields.io/badge/Build%20Small%20Hackathon-blue)](https://huggingface.co/build-small-hackathon)
19
+ [![Track 1: Backyard AI](https://img.shields.io/badge/Track%201-Backyard%20AI-blueviolet)](https://huggingface.co/build-small-hackathon)
20
+ [![Track 2: An Adventure in Thousand Token Wood](https://img.shields.io/badge/Track%202-An%20Adventure%20in%20Thousand%20Token%20Wood-blueviolet)](https://huggingface.co/build-small-hackathon)
21
+
22
+ [![Demo Video](https://img.shields.io/badge/β–Ά_Watch_Demo-FF0000?style=for-the-badge&logo=youtube&logoColor=white)](https://youtu.be/DqlLDDgV3kQ)
23
+ [![Social Media Post](https://img.shields.io/badge/X_Post-000000?style=for-the-badge&logo=x&logoColor=white)](https://x.com/ovi054/status/2064060651706925403)
24
+ [![Try It Live](https://img.shields.io/badge/πŸš€_Try_It_Live-7C3AED?style=for-the-badge)](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:** [![Social Media Post - X](https://img.shields.io/badge/X_Post-000000?style=for-the-badge&logo=x&logoColor=white)](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