{"id":50315114,"url":"https://github.com/charlypoly/gpt-image-2-stagehand","last_synced_at":"2026-05-28T23:30:43.711Z","repository":{"id":354478892,"uuid":"1223834726","full_name":"charlypoly/gpt-image-2-stagehand","owner":"charlypoly","description":null,"archived":false,"fork":false,"pushed_at":"2026-04-28T17:48:12.000Z","size":65,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-28T19:34:33.589Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/charlypoly.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-28T17:44:42.000Z","updated_at":"2026-04-28T17:48:16.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/charlypoly/gpt-image-2-stagehand","commit_stats":null,"previous_names":["charlypoly/gpt-image-2-stagehand"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/charlypoly/gpt-image-2-stagehand","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charlypoly%2Fgpt-image-2-stagehand","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charlypoly%2Fgpt-image-2-stagehand/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charlypoly%2Fgpt-image-2-stagehand/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charlypoly%2Fgpt-image-2-stagehand/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/charlypoly","download_url":"https://codeload.github.com/charlypoly/gpt-image-2-stagehand/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charlypoly%2Fgpt-image-2-stagehand/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33630999,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-28T02:00:06.440Z","response_time":99,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-05-28T23:30:43.488Z","updated_at":"2026-05-28T23:30:43.703Z","avatar_url":"https://github.com/charlypoly.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Virtual Try-On\n\nUpload a selfie and paste any e-commerce product URL. The app uses Browserbase Stagehand to extract the product image, then GPT-Image-2 to composite the product onto the person.\n\n\u003cimg width=\"1333\" height=\"1247\" alt=\"Screenshot 2026-04-28 at 19 41 16\" src=\"https://github.com/user-attachments/assets/8d2c08e3-7252-4287-a19d-3d8a85c1cc0f\" /\u003e\n\n\n## How it works\n\n1. The user uploads a selfie and pastes a product page URL.\n2. A Stagehand agent navigates the page on Browserbase and extracts the product name and main product image URL.\n3. Both images are sent to OpenAI via the Responses API with the `image_generation` tool targeting `gpt-image-2`.\n4. The result is displayed alongside the original selfie and product image for comparison.\n\n## Stack\n\n- Next.js 15 (App Router)\n- Tailwind CSS\n- Browserbase Stagehand v3 for browser automation\n- OpenAI `gpt-image-2` via the Responses API\n\n## Setup\n\n**1. Install dependencies**\n\n```bash\nnpm install\n```\n\n**2. Configure environment variables**\n\nCopy `.env.local.example` to `.env.local` and fill in your keys:\n\n```\nBROWSERBASE_API_KEY=\nBROWSERBASE_PROJECT_ID=\nOPENAI_API_KEY=\n```\n\n- Browserbase: https://browserbase.com\n- OpenAI: https://platform.openai.com\n\n**3. Run the dev server**\n\n```bash\nnpm run dev\n```\n\nOpen http://localhost:3000.\n\n## API routes\n\n| Route | Method | Description |\n|---|---|---|\n| `/api/extract-product` | POST | Navigates a product URL with Stagehand and returns `{ productName, imageUrl }` |\n| `/api/tryon` | POST | Accepts a selfie file, product image URL, and product name; returns a base64 PNG |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcharlypoly%2Fgpt-image-2-stagehand","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcharlypoly%2Fgpt-image-2-stagehand","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcharlypoly%2Fgpt-image-2-stagehand/lists"}