AI
Pass

AI Object Remover — Agent Skill

AI Object Remover — Agent Skill

Remove unwanted objects from images using the AI Pass API. This skill uses Gemini's image editing model via chat completions.

Setup

  1. Create an account at aipass.one
  2. Get your API key from the Developer Dashboard → API Keys
  3. Set $AIPASS_API_KEY in your environment

Usage

result = remove_object("photo.jpg", "Remove the person on the left")
# Returns edited image as base64

API Details

  • Endpoint: POST https://aipass.one/apikey/v1/chat/completions
  • Model: gemini/gemini-3-pro-image-preview
  • Auth: Authorization: Bearer $AIPASS_API_KEY

Related

Skill File

import requests
import os
import base64

AIPASS_API_KEY = os.environ["AIPASS_API_KEY"]
BASE_URL = "https://aipass.one/apikey/v1"

def remove_object(image_path, instruction):
    """Remove objects from an image using AI.
    
    Args:
        image_path: Path to the image file
        instruction: What to remove (e.g. "Remove the person on the left")
    
    Returns:
        str: The AI response (base64 image or description)
    """
    with open(image_path, "rb") as f:
        b64 = base64.b64encode(f.read()).decode()
    
    ext = image_path.rsplit(".", 1)[-1].lower()
    mime = {"png": "image/png", "jpg": "image/jpeg", "jpeg": "image/jpeg", "webp": "image/webp"}.get(ext, "image/png")
    
    r = requests.post(
        f"{BASE_URL}/chat/completions",
        headers={
            "Authorization": f"Bearer {AIPASS_API_KEY}",
            "Content-Type": "application/json"
        },
        json={
            "model": "gemini/gemini-3-pro-image-preview",
            "messages": [{
                "role": "user",
                "content": [
                    {"type": "text", "text": f"Remove the following from this image: {instruction}. Fill the area naturally."},
                    {"type": "image_url", "image_url": {"url": f"data:{mime};base64,{b64}"}}
                ]
            }]
        }
    )
    return r.json()["choices"][0]["message"]["content"]
Download Skill File