Add CIELAB+Sobel physical-consistency losses for inpainting - #32
Open
remyx-ai[bot] wants to merge 1 commit into
Open
Add CIELAB+Sobel physical-consistency losses for inpainting#32remyx-ai[bot] wants to merge 1 commit into
remyx-ai[bot] wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Adds a pair of physical-consistency losses (CIELAB color + Sobel edge) for structured-object inpainting, packaged as a new research project training script under
examples/research_projects/physical_consistency_inpaint/. The losses layer onto components diffusers already ships — SD1.5-inpaint + ControlNet + IP-Adapter — reusing those existing call sites and addingsrc/loss.py-style CIELAB+Sobel terms. This injects semantic (text/JSON), appearance (IP-Adapter), and geometric (ControlNet) priors together with the two consistency losses to improve fidelity for data-augmentation and precise-editing use cases.New files include
examples/research_projects/physical_consistency_inpaint/requirements.txt(a dependency manifest — please confirm the pins on review).Test results
Tests could not run in CI — the runner lacks this repo's example dependencies (a collection/import error, not a code failure). Please run the suite locally to validate.
Before submitting
Who can review?
@yiyixuxu@sayakpaul
Drafted by Outrider — paper: arXiv:2609.02348.
Discovery context
Research interest: [crossrepo-eval] huggingface/diffusers
Implements Structured-Prior-Guided Diffusion Inpainting with Physical Consistency for Traffic Sign Augmentation.
Reference: https://github.com/52hz-whale/TrafficSignInpaint
License: Apache-2.0 (class: permissive, compat: 1.00, source: github) — safe to adopt.
Why this paper for this team: The paper is a blueprint for specialized controllable generation and inpainting using
diffuserscomponents. It addresses maintaining physical consistency in generated images — important for data augmentation where fidelity matters — by injecting semantic (JSON), appearance (IP-Adapter), and geometric (ControlNet) priors combined with physical-consistency losses (CIELAB, Sobel), showing how to combine popular control mechanisms with custom losses for domain-specific generation.Why this candidate: The contribution is a pair of self-contained, code-backed physical-consistency losses layered onto components diffusers already ships (SD1.5-inpaint + ControlNet + IP-Adapter), so it drops in as a new research_project training script that reuses existing call sites and adds
src/loss.py-style CIELAB+Sobel terms — a clean addition with a permissive (Apache-2.0) source. It was the only pool candidate combining real portable code with a verified existing call site; higher-relevance peers lacked real method code ([6],[7]) or a usable license ([10]), and the best-anchored alternative [4] fails the no-code override (training recipe, not a self-contained signal).Suggested experiment: Use a Stable Diffusion 1.5 model and ControlNet/IP-Adapter in
diffusers. Inpaint a structured object (e.g., a license plate on a car) by providing semantic guidance (text prompt), an appearance prior (IP-Adapter embedding of the desired number style), and a geometric prior (ControlNet from a simple template).Co-Authored-By: remyx-ai[bot] <289541483+remyx-ai[bot]@users.noreply.github.com>