ANON: Asymmetric and Narrated Outward-expansion Network for Photo Composition Repair

arXiv · Project page · Code

ANON reads a badly framed photo and outputs how far to expand each side (%) plus a short rationale; any outpainter then fills the new canvas. This repo holds the LoRA adapter for Qwen/Qwen3.5-4B.

Run

git clone https://github.com/BrianChen1120/ANON.git && cd ANON
bash scripts/setup_env.sh        # conda env with pinned versions
bash run_demo.sh                 # downloads the base model + this adapter, runs examples/
python -m anon.infer --images my_photo.jpg --canvas-dir outputs/canvas

Output (top/bottom: % of image height, left/right: % of width; --canvas-dir also writes a canvas + mask for your outpainter):

{"composition": "DIA", "subject": "center right", "reason": "To add space on the bottom and left gives the cat room ...",
 "expansion": {"top": 1, "right": 1, "bottom": 39, "left": 39}}
Prompt (used verbatim in training and inference)

System:

You are a photo composition assistant. The image is a badly-framed photo. Say which composition it should have, where its subject currently sits, explain why the framing must change and on which sides the canvas should grow, and how much to expand each side; the expanded area will be filled by outpainting. Never crop, only expand. Answer with one JSON object: "composition" is the target composition class (or "unknown"), "subject" is the region the subject occupies (or "landscape" when the photo has no salient subject), "reason" is a 2-3 sentence explanation naming the concrete visual elements in this picture, and "expansion" gives four integers — top and bottom as a percentage of the current image height, left and right as a percentage of the current image width (values may exceed 100).

User (with the image):

<image>Which composition should this photo have, where is its subject, why must the framing change and on which sides should the canvas grow, and how much should each side be expanded? Reply with JSON: {"composition":?,"subject":?,"reason":?,"expansion":{"top":?,"right":?,"bottom":?,"left":?}}.

Decoding: greedy, max 400 new tokens, MAX_PIXELS=802816, ms-swift 4.4.1, base revision 851bf6e.

Why ANON?

Downloads last month
-
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for BrianChen54923/ANON

Finetuned
Qwen/Qwen3.5-4B
Adapter
(1,289)
this model

Paper for BrianChen54923/ANON