Visual Asset Automation Studio Visual Asset Automation Studio
단일 VLM과 OpenCV 후처리를 결합해 누끼 추출, 배경 정리, 이미지 확장을 한 흐름으로 묶은 visual asset automation prototype입니다. A visual asset automation prototype that combines a single VLM with OpenCV post-processing for background extraction, cleanup, and image expansion in one flow.
이 프로젝트는 무거운 비전 서버군을 하나의 경량 API 흐름으로 대체하는 데 초점을 둡니다. 객체 추출, 텍스트 제거, 여백 확장을 한 파이프라인으로 통합하면서도 상시 GPU 비용을 줄이는 방향으로 설계했습니다. This project focuses on replacing a stack of heavy vision servers with a lightweight API flow. It integrates object extraction, text removal, and canvas expansion into one pipeline while reducing always-on GPU cost.
Solution Solution
여러 전용 모델을 따로 운영하는 대신, 단일 VLM이 object detection, inpainting, outpainting을 맡고 FastAPI 백엔드가 crop과 후처리를 담당하도록 설계했습니다. 이로써 한 번의 요청 안에서 주요 디자인 보정 작업을 끝낼 수 있게 했습니다. Instead of operating multiple specialized models, we let a single VLM handle object detection, inpainting, and outpainting while a FastAPI backend manages crop and post-processing. This allows major design cleanup tasks to finish within one request flow.
가장 까다로운 문제였던 투명 배경 처리는 모델이 alpha channel을 안정적으로 만들지 못하는 한계를 우회해야 했습니다. 그래서 배경을 네온 그린으로 생성하게 한 뒤 OpenCV 크로마키로 제거하는 Nano Banana 방식을 채택했습니다. Transparent background generation was the hardest part because the model could not reliably produce alpha channels. We worked around that by generating a neon-green background and removing it with OpenCV chroma keying, the Nano Banana method.
Architecture Architecture
이미지가 들어오면 detection step이 정규화된 bounding box JSON을 반환하고, 백엔드는 이를 원본 해상도에 맞춰 crop합니다. 이후 cutout, text erase, background expansion이 각각 필요한 방식으로 분기되지만 모두 같은 API 서버 안에서 orchestration 됩니다. When an image arrives, the detection step returns normalized bounding box JSON, and the backend rescales it to the source resolution for cropping. Cutout, text erase, and background expansion branch as needed, but all are orchestrated inside the same API server.
핵심은 모델 출력 형식을 backend-friendly 하게 강제한 점입니다. 절대 픽셀 대신 0부터 1000까지의 상대 좌표 JSON을 받아 다양한 해상도에서도 안정적인 crop을 유지하도록 만들었습니다. A key architectural choice was forcing the model into a backend-friendly output format. By using JSON with relative coordinates from 0 to 1000 instead of absolute pixels, crop stability holds across different resolutions.
Technical Decisions Technical Decisions
Nano Banana Nano Banana
SAM 같은 전용 인프라를 늘리는 대신, prompt engineering과 OpenCV를 결합한 우회 전략으로 누끼 품질을 확보했습니다. 비용 대비 효과가 가장 큰 선택이었습니다. Instead of adding dedicated infrastructure such as SAM, we secured cutout quality through a workaround that combines prompt engineering with OpenCV. It delivered the best cost-to-outcome tradeoff.
Normalized JSON Output Normalized JSON Output
절대 픽셀 박스 예측은 해상도 변화에 취약합니다. 상대 좌표 JSON만 허용하고 backend에서 scale-up 하는 방식으로 안정적인 crop을 확보했습니다. Absolute pixel box prediction is fragile across resolutions. We enforced normalized JSON output and scaled it up in the backend for stable cropping.