[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-astriaai--headshots-starter":3,"tool-astriaai--headshots-starter":64},[4,18,26,35,44,56],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":17},4358,"openclaw","openclaw\u002Fopenclaw","OpenClaw 是一款专为个人打造的本地化 AI 助手，旨在让你在自己的设备上拥有完全可控的智能伙伴。它打破了传统 AI 助手局限于特定网页或应用的束缚，能够直接接入你日常使用的各类通讯渠道，包括微信、WhatsApp、Telegram、Discord、iMessage 等数十种平台。无论你在哪个聊天软件中发送消息，OpenClaw 都能即时响应，甚至支持在 macOS、iOS 和 Android 设备上进行语音交互，并提供实时的画布渲染功能供你操控。\n\n这款工具主要解决了用户对数据隐私、响应速度以及“始终在线”体验的需求。通过将 AI 部署在本地，用户无需依赖云端服务即可享受快速、私密的智能辅助，真正实现了“你的数据，你做主”。其独特的技术亮点在于强大的网关架构，将控制平面与核心助手分离，确保跨平台通信的流畅性与扩展性。\n\nOpenClaw 非常适合希望构建个性化工作流的技术爱好者、开发者，以及注重隐私保护且不愿被单一生态绑定的普通用户。只要具备基础的终端操作能力（支持 macOS、Linux 及 Windows WSL2），即可通过简单的命令行引导完成部署。如果你渴望拥有一个懂你",349277,3,"2026-04-06T06:32:30",[13,14,15,16],"Agent","开发框架","图像","数据工具","ready",{"id":19,"name":20,"github_repo":21,"description_zh":22,"stars":23,"difficulty_score":10,"last_commit_at":24,"category_tags":25,"status":17},3808,"stable-diffusion-webui","AUTOMATIC1111\u002Fstable-diffusion-webui","stable-diffusion-webui 是一个基于 Gradio 构建的网页版操作界面，旨在让用户能够轻松地在本地运行和使用强大的 Stable Diffusion 图像生成模型。它解决了原始模型依赖命令行、操作门槛高且功能分散的痛点，将复杂的 AI 绘图流程整合进一个直观易用的图形化平台。\n\n无论是希望快速上手的普通创作者、需要精细控制画面细节的设计师，还是想要深入探索模型潜力的开发者与研究人员，都能从中获益。其核心亮点在于极高的功能丰富度：不仅支持文生图、图生图、局部重绘（Inpainting）和外绘（Outpainting）等基础模式，还独创了注意力机制调整、提示词矩阵、负向提示词以及“高清修复”等高级功能。此外，它内置了 GFPGAN 和 CodeFormer 等人脸修复工具，支持多种神经网络放大算法，并允许用户通过插件系统无限扩展能力。即使是显存有限的设备，stable-diffusion-webui 也提供了相应的优化选项，让高质量的 AI 艺术创作变得触手可及。",162132,"2026-04-05T11:01:52",[14,15,13],{"id":27,"name":28,"github_repo":29,"description_zh":30,"stars":31,"difficulty_score":32,"last_commit_at":33,"category_tags":34,"status":17},2271,"ComfyUI","Comfy-Org\u002FComfyUI","ComfyUI 是一款功能强大且高度模块化的视觉 AI 引擎，专为设计和执行复杂的 Stable Diffusion 图像生成流程而打造。它摒弃了传统的代码编写模式，采用直观的节点式流程图界面，让用户通过连接不同的功能模块即可构建个性化的生成管线。\n\n这一设计巧妙解决了高级 AI 绘图工作流配置复杂、灵活性不足的痛点。用户无需具备编程背景，也能自由组合模型、调整参数并实时预览效果，轻松实现从基础文生图到多步骤高清修复等各类复杂任务。ComfyUI 拥有极佳的兼容性，不仅支持 Windows、macOS 和 Linux 全平台，还广泛适配 NVIDIA、AMD、Intel 及苹果 Silicon 等多种硬件架构，并率先支持 SDXL、Flux、SD3 等前沿模型。\n\n无论是希望深入探索算法潜力的研究人员和开发者，还是追求极致创作自由度的设计师与资深 AI 绘画爱好者，ComfyUI 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",107662,2,"2026-04-03T11:11:01",[14,15,13],{"id":36,"name":37,"github_repo":38,"description_zh":39,"stars":40,"difficulty_score":10,"last_commit_at":41,"category_tags":42,"status":17},4292,"Deep-Live-Cam","hacksider\u002FDeep-Live-Cam","Deep-Live-Cam 是一款专注于实时换脸与视频生成的开源工具，用户仅需一张静态照片，即可通过“一键操作”实现摄像头画面的即时变脸或制作深度伪造视频。它有效解决了传统换脸技术流程繁琐、对硬件配置要求极高以及难以实时预览的痛点，让高质量的数字内容创作变得触手可及。\n\n这款工具不仅适合开发者和技术研究人员探索算法边界，更因其极简的操作逻辑（仅需三步：选脸、选摄像头、启动），广泛适用于普通用户、内容创作者、设计师及直播主播。无论是为了动画角色定制、服装展示模特替换，还是制作趣味短视频和直播互动，Deep-Live-Cam 都能提供流畅的支持。\n\n其核心技术亮点在于强大的实时处理能力，支持口型遮罩（Mouth Mask）以保留使用者原始的嘴部动作，确保表情自然精准；同时具备“人脸映射”功能，可同时对画面中的多个主体应用不同面孔。此外，项目内置了严格的内容安全过滤机制，自动拦截涉及裸露、暴力等不当素材，并倡导用户在获得授权及明确标注的前提下合规使用，体现了技术发展与伦理责任的平衡。",88924,"2026-04-06T03:28:53",[14,15,13,43],"视频",{"id":45,"name":46,"github_repo":47,"description_zh":48,"stars":49,"difficulty_score":32,"last_commit_at":50,"category_tags":51,"status":17},2268,"ML-For-Beginners","microsoft\u002FML-For-Beginners","ML-For-Beginners 是由微软推出的一套系统化机器学习入门课程，旨在帮助零基础用户轻松掌握经典机器学习知识。这套课程将学习路径规划为 12 周，包含 26 节精炼课程和 52 道配套测验，内容涵盖从基础概念到实际应用的完整流程，有效解决了初学者面对庞大知识体系时无从下手、缺乏结构化指导的痛点。\n\n无论是希望转型的开发者、需要补充算法背景的研究人员，还是对人工智能充满好奇的普通爱好者，都能从中受益。课程不仅提供了清晰的理论讲解，还强调动手实践，让用户在循序渐进中建立扎实的技能基础。其独特的亮点在于强大的多语言支持，通过自动化机制提供了包括简体中文在内的 50 多种语言版本，极大地降低了全球不同背景用户的学习门槛。此外，项目采用开源协作模式，社区活跃且内容持续更新，确保学习者能获取前沿且准确的技术资讯。如果你正寻找一条清晰、友好且专业的机器学习入门之路，ML-For-Beginners 将是理想的起点。",84991,"2026-04-05T10:45:23",[15,16,43,52,13,53,54,14,55],"插件","其他","语言模型","音频",{"id":57,"name":58,"github_repo":59,"description_zh":60,"stars":61,"difficulty_score":10,"last_commit_at":62,"category_tags":63,"status":17},3128,"ragflow","infiniflow\u002Fragflow","RAGFlow 是一款领先的开源检索增强生成（RAG）引擎，旨在为大语言模型构建更精准、可靠的上下文层。它巧妙地将前沿的 RAG 技术与智能体（Agent）能力相结合，不仅支持从各类文档中高效提取知识，还能让模型基于这些知识进行逻辑推理和任务执行。\n\n在大模型应用中，幻觉问题和知识滞后是常见痛点。RAGFlow 通过深度解析复杂文档结构（如表格、图表及混合排版），显著提升了信息检索的准确度，从而有效减少模型“胡编乱造”的现象，确保回答既有据可依又具备时效性。其内置的智能体机制更进一步，使系统不仅能回答问题，还能自主规划步骤解决复杂问题。\n\n这款工具特别适合开发者、企业技术团队以及 AI 研究人员使用。无论是希望快速搭建私有知识库问答系统，还是致力于探索大模型在垂直领域落地的创新者，都能从中受益。RAGFlow 提供了可视化的工作流编排界面和灵活的 API 接口，既降低了非算法背景用户的上手门槛，也满足了专业开发者对系统深度定制的需求。作为基于 Apache 2.0 协议开源的项目，它正成为连接通用大模型与行业专有知识之间的重要桥梁。",77062,"2026-04-04T04:44:48",[13,15,14,54,53],{"id":65,"github_repo":66,"name":67,"description_en":68,"description_zh":69,"ai_summary_zh":69,"readme_en":70,"readme_zh":71,"quickstart_zh":72,"use_case_zh":73,"hero_image_url":74,"owner_login":75,"owner_name":76,"owner_avatar_url":77,"owner_bio":78,"owner_company":68,"owner_location":68,"owner_email":79,"owner_twitter":80,"owner_website":81,"owner_url":82,"languages":83,"stars":96,"forks":97,"last_commit_at":98,"license":99,"difficulty_score":100,"env_os":101,"env_gpu":102,"env_ram":103,"env_deps":104,"category_tags":117,"github_topics":68,"view_count":32,"oss_zip_url":68,"oss_zip_packed_at":68,"status":17,"created_at":118,"updated_at":119,"faqs":120,"releases":160},4291,"astriaai\u002Fheadshots-starter","headshots-starter",null,"headshots-starter 是由 Astria 推出的开源项目，旨在帮助开发者快速构建能够生成专业 AI 职业照的 Web 应用。只需几分钟，用户即可上传照片并获得高质量的头像作品，有效解决了传统摄影成本高、耗时久以及普通开发者难以从零搭建复杂 AI 应用的痛点。\n\n该项目主要面向希望进军 AI 领域的开发者和技术创作者。它不仅仅是一个成品应用，更是一个功能完备的“启动模板”。开发者可以直接复用其代码架构，轻松定制并部署属于自己的 AI SaaS 产品。在技术实现上，headshots-starter 集成了多项现代开发栈：利用 Astria 进行高效的模型训练与推理，支持最新的 Flux 模型微调及灵活的提示词包（Packs）管理；前端基于 Next.js 和 Tailwind CSS 构建，界面美观且响应迅速；后端则依托 Supabase 处理数据库与用户认证，并可选配 Resend 实现邮件通知功能。此外，项目设计注重平台无关性，不仅限于 Vercel 部署，方便在各种托管环境中运行。对于想要验证创意或学习全栈 AI 应用开发的团队而言，这是一个极佳的起点。","# 👨‍💼 [Headshot AI](https:\u002F\u002Fheadshots-starter.vercel.app\u002F) - Professional Headshots with AI (powered by Astria.ai)\n\nIntroducing Headshot AI, an open-source project from [Astria](https:\u002F\u002Fwww.astria.ai\u002F) that generates Professional AI Headshots in minutes.\n\nThis project was built to give developers & makers a great starting point into building AI applications. This is your launch pad - fork the code, modify it, and make it your own to build a popular AI SaaS app.\n\n[![Deploy with Vercel](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fastriaai_headshots-starter_readme_a4c0f8073a9c.png)](https:\u002F\u002Fvercel.com\u002Fnew\u002Fclone?repository-url=https%3A%2F%2Fgithub.com%2Fleap-ai%2Fheadshots-starter%2Ftree%2Fmain&env=ASTRIA_API_KEY,APP_WEBHOOK_SECRET&envDescription=Set%20up%20environment%20variables%20for%20Leap%20AI%20and%20redirect%20URL%20in%20Supabase%20Auth%20dashboard.%20See%20.env.local.example%20for%20full%20config%20with%20Resend%20and%20Stripe.&envLink=https%3A%2F%2Fgithub.com%2Fleap-ai%2Fheadshots-starter%2Fblob%2Fmain%2F.env.local.example&project-name=headshots-starter-clone&repository-name=headshots-starter-clone&demo-title=AI%20Headshot%20Generator&demo-description=A%20Professional%20AI%20headshot%20generator%20starter%20kit%20powered%20by%20Next.js%2C%20Leap%20AI%2C%20and%20Vercel&demo-url=https%3A%2F%2Fwww.getheadshots.ai%2F&demo-image=https%3A%2F%2Fimages.ctfassets.net%2Fe5382hct74si%2F1CEDfTwO5vPEiNMgN2Y1t6%2F245d1e0c11c4d8e734fbe345b9ecdc7c%2Fdemo.png&integration-ids=oac_VqOgBHqhEoFTPzGkPd7L0iH6&external-id=https%3A%2F%2Fgithub.com%2Fleap-ai%2Fheadshots-starter%2Ftree%2Fmain)\n\n[![Headshot AI Demo](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fastriaai_headshots-starter_readme_faad6dede69e.png)](https:\u002F\u002Fheadshots-starter.vercel.app\u002F)\n\n## Incoming changes\n\nIncoming [PR]((https:\u002F\u002Fgithub.com\u002Fastriaai\u002Fheadshots-starter\u002Fpull\u002F121)) has been merged to allow usage of  Astria's packs API which helps you avoid hardcoding prompts in your code as well as offering different packs of prompts, and switching to the new Flux model fine-tuning easily.\nRead more on advantage of using packs [Astria's documentation](https:\u002F\u002Fdocs.astria.ai\u002Fdocs\u002Fapi\u002Fpack\u002Fpack\u002F).\n\nWhen migrating to the new packs api, add to your vercel environment:\n```text\nNEXT_PUBLIC_TUNE_TYPE=packs\nPACK_QUERY_TYPE=both\n```\n\n![Headshot AI Packs](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fastriaai_headshots-starter_readme_be51edd39154.png)\nHere is how it looks\n\n## Important Environment Variable Change\n\n**Note:** The environment variable `VERCEL_URL` has been renamed to `DEPLOYMENT_URL` for consistency across the codebase. If you're updating from a previous version, please update your environment variables accordingly. This change makes the application more platform-agnostic and clearer for deployments on any hosting provider, not just Vercel.\n\n## How It Works\n\nLive demo **[here](https:\u002F\u002Fgetheadshots.ai)**.\n\nThe app is powered by:\n\n- 🚀 [Astria](https:\u002F\u002Fwww.astria.ai\u002F) for AI model training & inference\n- ▲ [Next.js](https:\u002F\u002Fnextjs.org\u002F) for app and landing page\n- 🔋 [Supabase](https:\u002F\u002Fsupabase.com\u002F) for DB & Auth\n- 📩 [Resend](https:\u002F\u002Fresend.com\u002F) (optional) to email user when headshots are ready\n- ⭐️ [Shadcn](https:\u002F\u002Fui.shadcn.com\u002F) with [Tailwind CSS](https:\u002F\u002Ftailwindcss.com\u002F) for styles\n- ▲ [Vercel](https:\u002F\u002Fvercel.com\u002Fnew\u002Fclone?repository-url=https%3A%2F%2Fgithub.com%2Fleap-ai%2Fheadshots-starter%2Ftree%2Fmain&env=ASTRIA_API_KEY,APP_WEBHOOK_SECRET&envDescription=Set%20up%20environment%20variables%20for%20Leap%20AI%20and%20redirect%20URL%20in%20Supabase%20Auth%20dashboard.%20See%20.env.local.example%20for%20full%20config%20with%20Resend%20and%20Stripe.&envLink=https%3A%2F%2Fgithub.com%2Fleap-ai%2Fheadshots-starter%2Fblob%2Fmain%2F.env.local.example&project-name=headshots-starter-clone&repository-name=headshots-starter-clone&demo-title=AI%20Headshot%20Generator&demo-description=A%20Professional%20AI%20headshot%20generator%20starter%20kit%20powered%20by%20Next.js%2C%20Leap%20AI%2C%20and%20Vercel&demo-url=https%3A%2F%2Fwww.getheadshots.ai%2F&demo-image=https%3A%2F%2Fimages.ctfassets.net%2Fe5382hct74si%2F1CEDfTwO5vPEiNMgN2Y1t6%2F245d1e0c11c4d8e734fbe345b9ecdc7c%2Fdemo.png&integration-ids=oac_VqOgBHqhEoFTPzGkPd7L0iH6&external-id=https%3A%2F%2Fgithub.com%2Fleap-ai%2Fheadshots-starter%2Ftree%2Fmain) for deployments\n- 💳 [Stripe](https:\u002F\u002Fstripe.com\u002F) for billing\n\n[![Headshot AI Explainer](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fastriaai_headshots-starter_readme_a037500d62b4.png)](https:\u002F\u002Fwww.astria.ai\u002F)\n\n## Running Locally\n\nTo create your own Headshot AI app, follow these steps:\n\n**Note**\nTraining models is only available on paid plans. You'll need an active [Astria API Key](\u003C[url](https:\u002F\u002Fwww.astria.ai\u002Fpricing)>) to train models.\n\n### 1. Vercel template\n\nTo setup Supabase\u002FVercel and your github repo, click on the Vercel Deploy Button and follow the steps.\n\nIMPORTANT: In the Supabase integration step: Make sure you leave the Create sample tables option checked. This might take a few minutes to complete.\n\n[![Deploy with Vercel](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fastriaai_headshots-starter_readme_a4c0f8073a9c.png)](https:\u002F\u002Fvercel.com\u002Fnew\u002Fclone?repository-url=https%3A%2F%2Fgithub.com%2Fleap-ai%2Fheadshots-starter%2Ftree%2Fmain&env=ASTRIA_API_KEY,APP_WEBHOOK_SECRET&envDescription=Set%20up%20environment%20variables%20for%20Leap%20AI%20and%20redirect%20URL%20in%20Supabase%20Auth%20dashboard.%20See%20.env.local.example%20for%20full%20config%20with%20Resend%20and%20Stripe.&envLink=https%3A%2F%2Fgithub.com%2Fleap-ai%2Fheadshots-starter%2Fblob%2Fmain%2F.env.local.example&project-name=headshots-starter-clone&repository-name=headshots-starter-clone&demo-title=AI%20Headshot%20Generator&demo-description=A%20Professional%20AI%20headshot%20generator%20starter%20kit%20powered%20by%20Next.js%2C%20Leap%20AI%2C%20and%20Vercel&demo-url=https%3A%2F%2Fwww.getheadshots.ai%2F&demo-image=https%3A%2F%2Fimages.ctfassets.net%2Fe5382hct74si%2F1CEDfTwO5vPEiNMgN2Y1t6%2F245d1e0c11c4d8e734fbe345b9ecdc7c%2Fdemo.png&integration-ids=oac_VqOgBHqhEoFTPzGkPd7L0iH6&external-id=https%3A%2F%2Fgithub.com%2Fleap-ai%2Fheadshots-starter%2Ftree%2Fmain)\n\nThe Vercel Deployment will create a new repository with this template on your GitHub account and guide you through a new Supabase project creation. The Supabase Vercel Deploy Integration will set up the necessary Supabase environment variables and run the SQL migrations to set up the Database schema on your account. You can inspect the created tables in your project's Table editor.\n\nThis will create the tables with their respective columns and RLS policies:\n\n- credits\n- images\n- models\n- samples\n\n### 2. Clone your newly created repo:\n\n```\ngit clone {{your-repo-name}}\n```\n\n### 3. Enter your newly created repo's directory:\n\n```\ncd {{your-repo-name}}\n```\n\n### 4. Install dependencies:\n\nFor npm:\n\n```bash\nnpm install\n```\n\nFor yarn:\n\n```bash\nyarn\n```\n\n### 5. Magic Link Auth (Supabase)\n\nIn your supabase [dashboard](https:\u002F\u002Fsupabase.com\u002Fdashboard\u002F), select newly created project, go to Authentication -> Email Templates -> Magic Link and paste the following template:\n\n```\n\u003Ch2>Magic Link\u003C\u002Fh2>\n\u003Cp>Follow this link to login:\u003C\u002Fp>\n\u003Cp>\u003Ca href=\"{{ .SiteURL }}\u002Fauth\u002Fconfirm?token_hash={{ .TokenHash }}&type=email\">Log In\u003C\u002Fa>\u003C\u002Fp>\n```\n\nThen, make sure to setup your site URL and redirect urls in the supabase dashboard under Authentication -> URL Configuration.\n\nFor example:\n\nSite URL: https:\u002F\u002Fheadshots-starter.vercel.app\n\nRedirect URL: https:\u002F\u002Fheadshots-starter.vercel.app\u002F**\n\n### 6. Create a [Astria](https:\u002F\u002Fwww.astria.ai\u002F) account\n\nIn your `.env.local` file:\n\n- Fill in `your_api_key` with your [Astria API key](https:\u002F\u002Fwww.astria.ai\u002Fusers\u002Fedit#api)\n- Fill in `your-webhook-secret` with any arbitrary URL friendly string eg.`shadf892yr398hq23h`\n- Fill in `your-deployment-url` with a url to catch webhooks from Astria. This will be your vercel deployment url or Ngrok tunnel locally (eg. https:\u002F\u002F{your-hosted-url}\u002Fastria\u002Ftrain-webhook)\n- Fill in `your-blob-read-write-token` with your Vercel Blob token (steps below)\n\nIf your production webhook callbacks do not seem to be working, make sure the callback URL is not of a Vercel dedicated branch deployment which requires authentication, in which case you will not see the callback in the logs.\n### 7. Configure the Announcement Bar (Optional)\n\nTo enable and customize the announcement bar at the top of your site, configure these environment variables in your `.env.local`:\n\n```text\n# Announcement Bar Configuration\nNEXT_PUBLIC_ANNOUNCEMENT_ENABLED=true # set to false to disable the announcement bar\nNEXT_PUBLIC_ANNOUNCEMENT_MESSAGE=\"Your announcement message here\" # the message to display\n```\n\n\n### 8. Configure [Vercel Blob](https:\u002F\u002Fvercel.com\u002Fdocs\u002Fstorage\u002Fvercel-blob\u002Fquickstart#client-uploads) for image uploads\n\nIn your Vercel project, create a [Blob store](https:\u002F\u002Fvercel.com\u002Fdocs\u002Fstorage\u002Fvercel-blob\u002Fquickstart#create-a-blob-store)\n\n- In your Vercel dashboard, select the Storage tab, then select the Connect Database button.\n- Under the Create New tab, select Blob and then the Continue button.\n\nThen to configure in your .env:\n\n- In your Vercel dashboard, select the Settings tab, then select the Environment Variables tab.\n- Copy your `BLOB_READ_WRITE_TOKEN` to your .env\n\n### 9. Create a [Resend](https:\u002F\u002Fresend.com\u002F) account (Optional)\n\n- Fill in `your-resend-api-key` with your Resend API Key if you wish to use Resend to email users when their model has finished training.\n\n### 10. Configure [Stripe](https:\u002F\u002Fstripe.com) to bill users on a credit basis. (Optional)\n\nThe current setup is for a credit based system. 1 credit = 1 model train.\n\nTo enable Stripe billing, you will need to fill out the following fields in your `.env.local` file:\n\n- STRIPE_SECRET_KEY=your-stripe-secret-key\n- STRIPE_WEBHOOK_SECRET=your-stripe-webhook-secret\n- STRIPE_PRICE_ID_ONE_CREDIT=your-stripe-price-id-one-credit\n- STRIPE_PRICE_ID_THREE_CREDITS=your-stripe-price-id-three-credit\n- STRIPE_PRICE_ID_FIVE_CREDITS=your-stripe-price-id-five-credit\n- NEXT_PUBLIC_STRIPE_IS_ENABLED=false # set to true to enable Stripe payments\n\nYou need to do multiple things to get Stripe working:\n\n- Get your Stripe API secret key from the [Stripe Dashboard](https:\u002F\u002Fdashboard.stripe.com\u002Ftest\u002Fapikeys)\n- Create a [Stripe Webhook](https:\u002F\u002Fdashboard.stripe.com\u002Ftest\u002Fwebhooks) that will point to your hosted URL. The webhook should be listening for the `checkout.session.completed` event. The webhook should point to `your-hosted-url\u002Fstripe\u002Fsubscription-webhook`.\n- Create a [Stripe Price](https:\u002F\u002Fdashboard.stripe.com\u002Ftest\u002Fproducts) for each credit package you want to offer.\n- Create a [Stripe Pricing Table](https:\u002F\u002Fdashboard.stripe.com\u002Ftest\u002Fpricing-tables) and replace the script @\u002Fcomponents\u002Fstripe\u002FStripeTable.tsx with your own values. It should look like this:\n\n```js\n\u003Cstripe-pricing-table\n  pricing-table-id=\"your-stripe-pricing-table-id\"\n  publishable-key=\"your-stripe-publishable-key\"\n  client-reference-id={user.id}\n  customer-email={user.email}\n>\u003C\u002Fstripe-pricing-table>\n```\n\nHere are the products you need to create to get Stripe working with our example, checkout the images [Here](\u002Fpublic\u002FStripe\u002F)\n\nTo create them go on the Stripe dashboard, search for Product Catalog and then click on the add product button on the top right of the screen. You will need to create 3 products, one for each credit package as shown in the images before. We set them to One time payments, but you can change that if you want to and you can set the price too. After creating the products make sure to update the variables in the .env.local [your-stripe-price-id-one-credit, your-stripe-price-id-three-credit, your-stripe-price-id-five-credit] with their respective price ids, each price id is found in the product page at the bottom.\n\n### 11. Start the development server:\n\nFor npm:\n\n```bash\nnpm run dev\n```\n\nFor yarn:\n\n```bash\nyarn dev\n```\n\n### 12. Visit `http:\u002F\u002Flocalhost:3000` in your browser to see the running app.\n\n## One-Click Deploy\n\nDefault deploy using Vercel:\n\n[![Deploy with Vercel](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fastriaai_headshots-starter_readme_a4c0f8073a9c.png)](https:\u002F\u002Fvercel.com\u002Fnew\u002Fclone?repository-url=https%3A%2F%2Fgithub.com%2Fastria-ai%2Fheadshots-starter%2Ftree%2Fmain&env=ASTRIA_API_KEY,APP_WEBHOOK_SECRET&envDescription=Set%20up%20environment%20variables%20for%20Astria%20AI%20and%20redirect%20URL%20in%20Supabase%20Auth%20dashboard.%20See%20.env.local.example%20for%20full%20config%20with%20Resend%20and%20Stripe.&envLink=https%3A%2F%2Fgithub.com%2Fleap-ai%2Fheadshots-starter%2Fblob%2Fmain%2F.env.local.example&project-name=headshots-starter-clone&repository-name=headshots-starter-clone&demo-title=AI%20Headshot%20Generator&demo-description=A%20Professional%20AI%20headshot%20generator%20starter%20kit%20powered%20by%20Next.js%2C%20Leap%20AI%2C%20and%20Vercel&demo-url=https%3A%2F%2Fwww.getheadshots.ai%2F&demo-image=https%3A%2F%2Fimages.ctfassets.net%2Fe5382hct74si%2F1CEDfTwO5vPEiNMgN2Y1t6%2F245d1e0c11c4d8e734fbe345b9ecdc7c%2Fdemo.png&integration-ids=oac_VqOgBHqhEoFTPzGkPd7L0iH6&external-id=https%3A%2F%2Fgithub.com%2Fleap-ai%2Fheadshots-starter%2Ftree%2Fmain)\n\n\n## How To Get Good Results\n\n[![Good results Demo](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fastriaai_headshots-starter_readme_9b9813998333.png)](https:\u002F\u002Fblog.tryleap.ai\u002Fcreate-an-ai-headshot-generator-fine-tune-stable-diffusion-with-leap-api\u002F#step-1-gather-your-image-samples-%F0%9F%93%B8)\n\nThe image samples used to teach the model what your face looks like are critical. Garbage in = garbage out.\n\n- Enforce close-ups of faces and consider cropping so that the face is centered.\n- Enforce images with only one person in the frame.\n- Avoid accessories in samples like sunglasses and hats.\n- Ensure the face is clearly visible. (For face detection, consider using tools like [Cloudinary API](https:\u002F\u002Fcloudinary.com\u002Fdocumentation\u002Fface_detection_based_transformations?ref=blog.tryleap.ai)).\n\n[![Avoid multiple faces](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fastriaai_headshots-starter_readme_23cd618d7c67.png)](https:\u002F\u002Fblog.tryleap.ai\u002Fcreate-an-ai-headshot-generator-fine-tune-stable-diffusion-with-leap-api\u002F#how-to-avoid-multiple-faces-in-results-%E2%9D%8C)\n\nIf you get distorted results with multiple faces, repeated subjects, multiple limbs, etc, make sure to follow these steps and minimize the chance of this happening:\n\n- Make sure any samples uploaded are the same 1:1 height \u002F width aspect ratio, for example 512x512, 1024x1024, etc.\n- Avoid multiple people in the samples uploaded.\n- Add \"double torso, totem pole\" to the negative prompt when generating.\n- Make sure your dimensions when generating are also 1:1 with the same height \u002F width ratios of the samples.\n\nFor more information on how to improve quality, read the blog [here](https:\u002F\u002Fblog.tryleap.ai\u002Fcreate-an-ai-headshot-generator-fine-tune-stable-diffusion-with-leap-api\u002F#step-1-gather-your-image-samples-%F0%9F%93%B8).\n\n### All Thanks To Our Contributors:\n\n\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fleap-ai\u002Fheadshots-starter\u002Fgraphs\u002Fcontributors\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fastriaai_headshots-starter_readme_3f82b4752027.png\" \u002F>\n\u003C\u002Fa>\n\n## Additional Use-Cases\n\nHeadshot AI can be easily adapted to support many other use-cases of [Astria](https:\u002F\u002Fwww.astria.ai\u002F) including:\n\n- AI Avatars\n  - [Anime](https:\u002F\u002Fblog.tryleap.ai\u002Ftransforming-images-into-anime-with-leap-ai\u002F)\n  - [Portraits](https:\u002F\u002Fblog.tryleap.ai\u002Fai-time-machine-images-a-glimpse-into-the-future-with-leap-ai\u002F)\n  - [Story Illustrations](https:\u002F\u002Fblog.tryleap.ai\u002Fnovel-ai-image-generator-using-leap-ai-a-comprehensive-guide\u002F)\n\n[![Anime AI Demo](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fastriaai_headshots-starter_readme_752e92d89050.png)](https:\u002F\u002Fwww.astria.ai\u002Fgallery\u002Fpacks)\n\n- Pet Portraits\n\n[![Pet AI Demo](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fastriaai_headshots-starter_readme_fd51e0b26f31.png)](https:\u002F\u002Fwww.astria.ai\u002Fgallery\u002Fpacks)\n\n- Product Shots\n- Food Photography\n\n[![Product AI Demo](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fastriaai_headshots-starter_readme_d82cc58a5588.png)](https:\u002F\u002Fwww.astria.ai\u002F)\n\n- Icons\n- [Style-Consistent Assets](https:\u002F\u002Fblog.tryleap.ai\u002Fhow-to-generate-style-consistent-assets-finetuning-on-leap\u002F)\n\n[![Icons AI Demo](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fastriaai_headshots-starter_readme_35f59974474a.png)](https:\u002F\u002Fwww.astria.ai\u002F)\n\n& more!\n\n## Contributing\n\nWe welcome collaboration and appreciate your contribution to Headshot AI. If you have suggestions for improvement or significant changes in mind, feel free to open an issue!\n\nIf you want to contribute to the codebase make sure you create a new branch and open a pull request that points to `dev`.\n\n## Resources and Support\n\n- Help Email: support@astria.ai\n\n## License\n\nHeadshot AI is released under the [MIT License](https:\u002F\u002Fchoosealicense.com\u002Flicenses\u002Fmit\u002F).\n","# 👨‍💼 [Headshot AI](https:\u002F\u002Fheadshots-starter.vercel.app\u002F) - 使用 AI 生成专业头像（由 Astria.ai 提供支持）\n\n隆重推出 Headshot AI，这是一项来自 [Astria](https:\u002F\u002Fwww.astria.ai\u002F) 的开源项目，可在几分钟内生成专业的 AI 头像。\n\n该项目旨在为开发者和创作者提供一个构建 AI 应用程序的良好起点。这是你的发射平台——克隆代码、修改它，并根据自己的需求进行定制，从而打造一款热门的 AI SaaS 应用。\n\n[![使用 Vercel 部署](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fastriaai_headshots-starter_readme_a4c0f8073a9c.png)](https:\u002F\u002Fvercel.com\u002Fnew\u002Fclone?repository-url=https%3A%2F%2Fgithub.com%2Fleap-ai%2Fheadshots-starter%2Ftree%2Fmain&env=ASTRIA_API_KEY,APP_WEBHOOK_SECRET&envDescription=Set%20up%20environment%20variables%20for%20Leap%20AI%20and%20redirect%20URL%20in%20Supabase%20Auth%20dashboard.%20See%20.env.local.example%20for%20full%20config%20with%20Resend%20and%20Stripe.&envLink=https%3A%2F%2Fgithub.com%2Fleap-ai%2Fheadshots-starter%2Fblob%2Fmain%2F.env.local.example&project-name=headshots-starter-clone&repository-name=headshots-starter-clone&demo-title=AI%20Headshot%20Generator&demo-description=A%20Professional%20AI%20headshot%20generator%20starter%20kit%20powered%20by%20Next.js%2C%20Leap%20AI%2C%20and%20Vercel&demo-url=https%3A%2F%2Fwww.getheadshots.ai%2F&demo-image=https%3A%2F%2Fimages.ctfassets.net%2Fe5382hct74si%2F1CEDfTwO5vPEiNMgN2Y1t6%2F245d1e0c11c4d8e734fbe345b9ecdc7c%2Fdemo.png&integration-ids=oac_VqOgBHqhEoFTPzGkPd7L0iH6&external-id=https%3A%2F%2Fgithub.com%2Fleap-ai%2Fheadshots-starter%2Ftree%2Fmain)\n\n[![Headshot AI 演示](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fastriaai_headshots-starter_readme_faad6dede69e.png)](https:\u002F\u002Fheadshots-starter.vercel.app\u002F)\n\n## 即将到来的变更\n\n即将合并的 [PR]((https:\u002F\u002Fgithub.com\u002Fastriaai\u002Fheadshots-starter\u002Fpull\u002F121)) 允许使用 Astria 的 packs API，这有助于避免在代码中硬编码提示词，并提供不同的提示词包，同时可以轻松切换到新的 Flux 模型微调。更多关于使用 packs 的优势，请参阅 [Astria 的文档](https:\u002F\u002Fdocs.astria.ai\u002Fdocs\u002Fapi\u002Fpack\u002Fpack\u002F)。\n\n迁移到新的 packs API 时，请在 Vercel 环境中添加：\n```text\nNEXT_PUBLIC_TUNE_TYPE=packs\nPACK_QUERY_TYPE=both\n```\n\n![Headshot AI Packs](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fastriaai_headshots-starter_readme_be51edd39154.png)\n这就是它的样子。\n\n## 重要环境变量变更\n\n**注意：** 为了保持代码库的一致性，环境变量 `VERCEL_URL` 已更名为 `DEPLOYMENT_URL`。如果您是从旧版本更新而来，请相应地更新您的环境变量。这一更改使应用程序更具平台无关性，并且在任何托管提供商上部署时都更加清晰，而不仅仅是 Vercel。\n\n## 工作原理\n\n实时演示 **[在这里](https:\u002F\u002Fgetheadshots.ai)**。\n\n该应用由以下技术驱动：\n\n- 🚀 [Astria](https:\u002F\u002Fwww.astria.ai\u002F) 用于 AI 模型的训练与推理\n- ▲ [Next.js](https:\u002F\u002Fnextjs.org\u002F) 用于应用和着陆页\n- 🔋 [Supabase](https:\u002F\u002Fsupabase.com\u002F) 用于数据库与身份验证\n- 📩 [Resend](https:\u002F\u002Fresend.com\u002F)（可选）用于在头像准备好时向用户发送电子邮件\n- ⭐️ [Shadcn](https:\u002F\u002Fui.shadcn.com\u002F) 结合 [Tailwind CSS](https:\u002F\u002Ftailwindcss.com\u002F) 实现样式\n- ▲ [Vercel](https:\u002F\u002Fvercel.com\u002Fnew\u002Fclone?repository-url=https%3A%2F%2Fgithub.com%2Fleap-ai%2Fheadshots-starter%2Ftree%2Fmain&env=ASTRIA_API_KEY,APP_WEBHOOK_SECRET&envDescription=Set%20up%20environment%20variables%20for%20Leap%20AI%20and%20redirect%20URL%20in%20Supabase%20Auth%20dashboard.%20See%20.env.local.example%20for%20full%20config%20with%20Resend%20and%20Stripe.&envLink=https%3A%2F%2Fgithub.com%2Fleap-ai%2Fheadshots-starter%2Fblob%2Fmain%2F.env.local.example&project-name=headshots-starter-clone&repository-name=headshots-starter-clone&demo-title=AI%20Headshot%20Generator&demo-description=A%20Professional%20AI%20headshot%20generator%20starter%20kit%20powered%20by%20Next.js%2C%20Leap%20AI%2C%20and%20Vercel&demo-url=https%3A%2F%2Fwww.getheadshots.ai%2F&demo-image=https%3A%2F%2Fimages.ctfassets.net%2Fe5382hct74si%2F1CEDfTwO5vPEiNMgN2Y1t6%2F245d1e0c11c4d8e734fbe345b9ecdc7c%2Fdemo.png&integration-ids=oac_VqOgBHqhEoFTPzGkPd7L0iH6&external-id=https%3A%2F%2Fgithub.com%2Fleap-ai%2Fheadshots-starter%2Ftree%2Fmain) 用于部署\n- 💳 [Stripe](https:\u002F\u002Fstripe.com\u002F) 用于计费\n\n[![Headshot AI 解说](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fastriaai_headshots-starter_readme_a037500d62b4.png)](https:\u002F\u002Fwww.astria.ai\u002F)\n\n## 本地运行\n\n要创建您自己的 Headshot AI 应用程序，请按照以下步骤操作：\n\n**注意**\n模型训练仅适用于付费计划。您需要有效的 [Astria API 密钥](\u003C[url](https:\u002F\u002Fwww.astria.ai\u002Fpricing)>) 才能训练模型。\n\n### 1. Vercel 模板\n\n要设置 Supabase\u002FVercel 和您的 GitHub 仓库，请点击 Vercel 部署按钮并按照步骤操作。\n\n重要提示：在 Supabase 集成步骤中，请确保勾选“创建示例表”选项。此过程可能需要几分钟时间。\n\n[![使用 Vercel 部署](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fastriaai_headshots-starter_readme_a4c0f8073a9c.png)](https:\u002F\u002Fvercel.com\u002Fnew\u002Fclone?repository-url=https%3A%2F%2Fgithub.com%2Fleap-ai%2Fheadshots-starter%2Ftree%2Fmain&env=ASTRIA_API_KEY,APP_WEBHOOK_SECRET&envDescription=Set%20up%20environment%20variables%20for%20Leap%20AI%20and%20redirect%20URL%20in%20Supabase%20Auth%20dashboard.%20See%20.env.local.example%20for%20full%20config%20with%20Resend%20and%20Stripe.&envLink=https%3A%2F%2Fgithub.com%2Fleap-ai%2Fheadshots-starter%2Fblob%2Fmain%2F.env.local.example&project-name=headshots-starter-clone&repository-name=headshots-starter-clone&demo-title=AI%20Headshot%20Generator&demo-description=A%20Professional%20AI%20headshot%20generator%20starter%20kit%20powered%20by%20Next.js%2C%20Leap%20AI%2C%20and%20Vercel&demo-url=https%3A%2F%2Fwww.getheadshots.ai%2F&demo-image=https%3A%2F%2Fimages.ctfassets.net%2Fe5382hct74si%2F1CEDfTwO5vPEiNMgN2Y1t6%2F245d1e0c11c4d8e734fbe345b9ecdc7c%2Fdemo.png&integration-ids=oac_VqOgBHqhEoFTPzGkPd7L0iH6&external-id=https%3A%2F%2Fgithub.com%2Fleap-ai%2Fheadshots-starter%2Ftree%2Fmain)\n\nVercel 部署将在您的 GitHub 账户上创建一个包含此模板的新仓库，并引导您完成新的 Supabase 项目创建。Supabase Vercel 部署集成会设置必要的 Supabase 环境变量，并运行 SQL 迁移以在您的账户上设置数据库模式。您可以在项目的表编辑器中查看已创建的表。\n\n这将创建具有各自列和 RLS 策略的以下表：\n\n- credits\n- images\n- models\n- samples\n\n### 2. 克隆您新创建的仓库：\n\n```\ngit clone {{your-repo-name}}\n```\n\n### 3. 进入您新创建的仓库目录：\n\n```\ncd {{your-repo-name}}\n```\n\n### 4. 安装依赖：\n\n对于 npm：\n\n```bash\nnpm install\n```\n\n对于 yarn：\n\n```bash\nyarn\n```\n\n### 5. 魔术链接认证（Supabase）\n\n在你的 Supabase [控制台](https:\u002F\u002Fsupabase.com\u002Fdashboard\u002F)中，选择新创建的项目，进入“认证” -> “电子邮件模板” -> “魔术链接”，并将以下模板粘贴进去：\n\n```\n\u003Ch2>魔术链接\u003C\u002Fh2>\n\u003Cp>请点击此链接登录：\u003C\u002Fp>\n\u003Cp>\u003Ca href=\"{{ .SiteURL }}\u002Fauth\u002Fconfirm?token_hash={{ .TokenHash }}&type=email\">登录\u003C\u002Fa>\u003C\u002Fp>\n```\n\n然后，请确保在 Supabase 控制台的“认证” -> “URL 配置”中设置好你的站点 URL 和重定向 URL。\n\n例如：\n\n站点 URL：https:\u002F\u002Fheadshots-starter.vercel.app\n\n重定向 URL：https:\u002F\u002Fheadshots-starter.vercel.app\u002F**\n\n### 6. 创建一个 [Astria](https:\u002F\u002Fwww.astria.ai\u002F) 账户\n\n在你的 `.env.local` 文件中：\n\n- 将 `your_api_key` 填写为你的 [Astria API 密钥](https:\u002F\u002Fwww.astria.ai\u002Fusers\u002Fedit#api)。\n- 将 `your-webhook-secret` 填写为任意符合 URL 规则的字符串，例如 `shadf892yr398hq23h`。\n- 将 `your-deployment-url` 填写为用于接收来自 Astria 的 Webhook 的 URL。这可以是你的 Vercel 部署 URL，或者本地的 Ngrok 隧道地址（例如 https:\u002F\u002F{your-hosted-url}\u002Fastria\u002Ftrain-webhook）。\n- 将 `your-blob-read-write-token` 填写为你的 Vercel Blob 令牌（步骤见下文）。\n\n如果生产环境中的 Webhook 回调似乎没有生效，请确认回调 URL 不是需要身份验证的 Vercel 特定分支部署，因为在这种情况下，你将无法在日志中看到回调信息。\n### 7. 配置公告栏（可选）\n\n要启用并自定义网站顶部的公告栏，请在你的 `.env.local` 中配置以下环境变量：\n\n```text\n# 公告栏配置\nNEXT_PUBLIC_ANNOUNCEMENT_ENABLED=true # 设置为 false 可禁用公告栏\nNEXT_PUBLIC_ANNOUNCEMENT_MESSAGE=\"此处填写你的公告消息\" # 要显示的消息\n```\n\n\n### 8. 配置 [Vercel Blob](https:\u002F\u002Fvercel.com\u002Fdocs\u002Fstorage\u002Fvercel-blob\u002Fquickstart#client-uploads) 以支持图片上传\n\n在你的 Vercel 项目中，创建一个 [Blob 存储](https:\u002F\u002Fvercel.com\u002Fdocs\u002Fstorage\u002Fvercel-blob\u002Fquickstart#create-a-blob-store)：\n\n- 在 Vercel 控制台中，选择“存储”选项卡，然后点击“连接数据库”按钮。\n- 在“新建”选项卡中，选择“Blob”，然后点击“继续”按钮。\n\n接着，在 `.env` 文件中进行配置：\n\n- 在 Vercel 控制台中，选择“设置”选项卡，然后选择“环境变量”选项卡。\n- 将你的 `BLOB_READ_WRITE_TOKEN` 复制到 `.env` 文件中。\n\n### 9. 创建一个 [Resend](https:\u002F\u002Fresend.com\u002F) 账户（可选）\n\n- 如果你希望使用 Resend 向用户发送邮件通知其模型训练完成，请将 `your-resend-api-key` 填写为你的 Resend API 密钥。\n\n### 10. 配置 [Stripe](https:\u002F\u002Fstripe.com) 以按积分计费（可选）\n\n当前的设置是基于积分的计费系统。1 积分 = 1 次模型训练。\n\n要启用 Stripe 计费，你需要在 `.env.local` 文件中填写以下字段：\n\n- STRIPE_SECRET_KEY=你的 Stripe 秘密密钥\n- STRIPE_WEBHOOK_SECRET=你的 Stripe Webhook 密钥\n- STRIPE_PRICE_ID_ONE_CREDIT=你的 Stripe 单次积分价格 ID\n- STRIPE_PRICE_ID_THREE_CREDITS=你的 Stripe 三次积分价格 ID\n- STRIPE_PRICE_ID_FIVE_CREDITS=你的 Stripe 五次积分价格 ID\n- NEXT_PUBLIC_STRIPE_IS_ENABLED=false # 设置为 true 以启用 Stripe 支付\n\n要使 Stripe 正常工作，你需要完成以下步骤：\n\n- 从 [Stripe 控制台](https:\u002F\u002Fdashboard.stripe.com\u002Ftest\u002Fapikeys)获取你的 Stripe API 秘密密钥。\n- 创建一个 [Stripe Webhook](https:\u002F\u002Fdashboard.stripe.com\u002Ftest\u002Fwebhooks)，使其指向你的托管 URL。Webhook 应监听 `checkout.session.completed` 事件，并指向 `your-hosted-url\u002Fstripe\u002Fsubscription-webhook`。\n- 为每个你想要提供的积分套餐创建一个 [Stripe 价格](https:\u002F\u002Fdashboard.stripe.com\u002Ftest\u002Fproducts)。\n- 创建一个 [Stripe 定价表](https:\u002F\u002Fdashboard.stripe.com\u002Ftest\u002Fpricing-tables)，并将脚本 @\u002Fcomponents\u002Fstripe\u002FStripeTable.tsx 替换为你自己的值。代码应如下所示：\n\n```js\n\u003Cstripe-pricing-table\n  pricing-table-id=\"你的 Stripe 定价表 ID\"\n  publishable-key=\"你的 Stripe 公开密钥\"\n  client-reference-id={user.id}\n  customer-email={user.email}\n>\u003C\u002Fstripe-pricing-table>\n```\n\n以下是使 Stripe 与我们的示例正常工作的所需产品，请查看 [这里](\u002Fpublic\u002FStripe\u002F) 的图片说明。\n\n要创建这些产品，请登录 Stripe 控制台，搜索“产品目录”，然后点击屏幕右上角的“添加产品”按钮。你需要创建 3 个产品，分别对应每种积分套餐，如之前图片所示。我们将其设置为一次性支付，但你可以根据需要更改设置并调整价格。创建完产品后，务必更新 `.env.local` 文件中的变量 [your-stripe-price-id-one-credit、your-stripe-price-id-three-credit、your-stripe-price-id-five-credit] 为各自产品的价格 ID，每个价格 ID 都可以在产品页面底部找到。\n\n### 11. 启动开发服务器：\n\n对于 npm：\n\n```bash\nnpm run dev\n```\n\n对于 yarn：\n\n```bash\nyarn dev\n```\n\n### 12. 在浏览器中访问 `http:\u002F\u002Flocalhost:3000` 查看运行中的应用。\n\n## 一键部署\n\n使用 Vercel 的默认部署：\n\n[![使用 Vercel 部署](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fastriaai_headshots-starter_readme_a4c0f8073a9c.png)](https:\u002F\u002Fvercel.com\u002Fnew\u002Fclone?repository-url=https%3A%2F%2Fgithub.com%2Fastria-ai%2Fheadshots-starter%2Ftree%2Fmain&env=ASTRIA_API_KEY,APP_WEBHOOK_SECRET&envDescription=Set%20up%20environment%20variables%20for%20Astria%20AI%20and%20redirect%20URL%20in%20Supabase%20Auth%20dashboard.%20See%20.env.local.example%20for%20full%20config%20with%20Resend%20and%20Stripe.&envLink=https%3A%2F%2Fgithub.com%2Fleap-ai%2Fheadshots-starter%2Fblob%2Fmain%2F.env.local.example&project-name=headshots-starter-clone&repository-name=headshots-starter-clone&demo-title=AI%20Headshot%20Generator&demo-description=A%20Professional%20AI%20headshot%20generator%20starter%20kit%20powered%20by%20Next.js%2C%20Leap%20AI%2C%20and%20Vercel&demo-url=https%3A%2F%2Fwww.getheadshots.ai%2F&demo-image=https%3A%2F%2Fimages.ctfassets.net%2Fe5382hct74si%2F1CEDfTwO5vPEiNMgN2Y1t6%2F245d1e0c11c4d8e734fbe345b9ecdc7c%2Fdemo.png&integration-ids=oac_VqOgBHqhEoFTPzGkPd7L0iH6&external-id=https%3A%2F%2Fgithub.com%2Fleap-ai%2Fheadshots-starter%2Ftree%2Fmain)\n\n## 如何获得优质结果\n\n[![优质结果演示](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fastriaai_headshots-starter_readme_9b9813998333.png)](https:\u002F\u002Fblog.tryleap.ai\u002Fcreate-an-ai-headshot-generator-fine-tune-stable-diffusion-with-leap-api\u002F#step-1-gather-your-image-samples-%F0%9F%93%B8)\n\n用于教会模型你面部外观的图像样本至关重要。输入垃圾，输出也是垃圾。\n\n- 强制使用人脸特写，并考虑裁剪以使脸部居中。\n- 确保每张图片中只包含一个人。\n- 避免在样本中出现太阳镜、帽子等配饰。\n- 确保面部清晰可见。（对于人脸检测，可以考虑使用诸如 [Cloudinary API](https:\u002F\u002Fcloudinary.com\u002Fdocumentation\u002Fface_detection_based_transformations?ref=blog.tryleap.ai) 之类的工具）。\n\n[![避免多个人脸](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fastriaai_headshots-starter_readme_23cd618d7c67.png)](https:\u002F\u002Fblog.tryleap.ai\u002Fcreate-an-ai-headshot-generator-fine-tune-stable-diffusion-with-leap-api\u002F#how-to-avoid-multiple-faces-in-results-%E2%9D%8C)\n\n如果你的结果出现多个人脸、重复主体、多余肢体等扭曲情况，请务必遵循以下步骤，以尽量减少此类问题的发生：\n\n- 确保上传的所有样本都具有相同的 1:1 宽高比，例如 512x512、1024x1024 等。\n- 避免在上传的样本中包含多人。\n- 在生成时将“double torso, totem pole”添加到负面提示中。\n- 确保生成时的尺寸也保持 1:1 的宽高比，与样本一致。\n\n如需了解更多提升质量的方法，请阅读这篇博客文章：[点击此处](https:\u002F\u002Fblog.tryleap.ai\u002Fcreate-an-ai-headshot-generator-fine-tune-stable-diffusion-with-leap-api\u002F#step-1-gather-your-image-samples-%F0%9F%93%B8)。\n\n### 感谢所有贡献者：\n\n\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fleap-ai\u002Fheadshots-starter\u002Fgraphs\u002Fcontributors\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fastriaai_headshots-starter_readme_3f82b4752027.png\" \u002F>\n\u003C\u002Fa>\n\n## 其他应用场景\n\nAI 头像可以轻松适配支持 [Astria](https:\u002F\u002Fwww.astria.ai\u002F) 的许多其他用例，包括：\n\n- AI 头像\n  - [动漫风格](https:\u002F\u002Fblog.tryleap.ai\u002Ftransforming-images-into-anime-with-leap-ai\u002F)\n  - [肖像画](https:\u002F\u002Fblog.tryleap.ai\u002Fai-time-machine-images-a-glimpse-into-the-future-with-leap-ai\u002F)\n  - [故事插画](https:\u002F\u002Fblog.tryleap.ai\u002Fnovel-ai-image-generator-using-leap-ai-a-comprehensive-guide\u002F)\n\n[![动漫 AI 演示](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fastriaai_headshots-starter_readme_752e92d89050.png)](https:\u002F\u002Fwww.astria.ai\u002Fgallery\u002Fpacks)\n\n- 宠物肖像\n\n[![宠物 AI 演示](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fastriaai_headshots-starter_readme_fd51e0b26f31.png)](https:\u002F\u002Fwww.astria.ai\u002Fgallery\u002Fpacks)\n\n- 产品拍摄\n- 食品摄影\n\n[![产品 AI 演示](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fastriaai_headshots-starter_readme_d82cc58a5588.png)](https:\u002F\u002Fwww.astria.ai\u002F)\n\n- 图标\n- [风格一致的素材](https:\u002F\u002Fblog.tryleap.ai\u002Fhow-to-generate-style-consistent-assets-finetuning-on-leap\u002F)\n\n[![图标 AI 演示](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fastriaai_headshots-starter_readme_35f59974474a.png)](https:\u002F\u002Fwww.astria.ai\u002F)\n\n以及更多！\n\n## 贡献方式\n\n我们欢迎合作，并感谢您对 AI 头像项目的贡献。如果您有任何改进建议或重大变更想法，欢迎随时提交问题！\n\n若想参与代码库的贡献，请务必创建新分支，并向 `dev` 分支发起拉取请求。\n\n## 资源与支持\n\n- 帮助邮箱：support@astria.ai\n\n## 许可证\n\nAI 头像项目采用 [MIT 许可证](https:\u002F\u002Fchoosealicense.com\u002Flicenses\u002Fmit\u002F) 开源发布。","# Headshot AI 快速上手指南\n\nHeadshot AI 是一个由 Astria 推出的开源项目，旨在帮助开发者在几分钟内生成专业的 AI 头像。该项目基于 Next.js、Supabase 和 Astria AI 构建，是打造 AI SaaS 应用的理想起点。\n\n## 环境准备\n\n在开始之前，请确保你已准备好以下环境和账号：\n\n*   **系统要求**：Node.js (推荐 v18+)，npm 或 yarn。\n*   **代码托管**：GitHub 账号。\n*   **核心服务账号**：\n    *   [Astria](https:\u002F\u002Fwww.astria.ai\u002F)：用于 AI 模型训练与推理（**注意**：训练模型需要付费计划及 API Key）。\n    *   [Supabase](https:\u002F\u002Fsupabase.com\u002F)：用于数据库和用户认证。\n    *   [Vercel](https:\u002F\u002Fvercel.com\u002F)：用于应用部署和对象存储 (Blob)。\n*   **可选服务**：\n    *   [Resend](https:\u002F\u002Fresend.com\u002F)：用于发送完成通知邮件。\n    *   [Stripe](https:\u002F\u002Fstripe.com\u002F)：用于处理信用额度支付。\n\n## 安装步骤\n\n### 1. 一键部署与初始化\n点击下方的 Vercel 部署按钮，系统将自动在你的 GitHub 创建仓库，并引导你创建 Supabase 项目。\n\n[![Deploy with Vercel](https:\u002F\u002Fvercel.com\u002Fbutton)](https:\u002F\u002Fvercel.com\u002Fnew\u002Fclone?repository-url=https%3A%2F%2Fgithub.com%2Fleap-ai%2Fheadshots-starter%2Ftree%2Fmain&env=ASTRIA_API_KEY,APP_WEBHOOK_SECRET&envDescription=Set%20up%20environment%20variables%20for%20Leap%20AI%20and%20redirect%20URL%20in%20Supabase%20Auth%20dashboard.&envLink=https%3A%2F%2Fgithub.com%2Fleap-ai%2Fheadshots-starter%2Fblob%2Fmain%2F.env.local.example)\n\n**重要提示**：在 Supabase 集成步骤中，务必勾选 **\"Create sample tables\"** 选项，以便自动创建 `credits`, `images`, `models`, `samples` 等数据表及策略。\n\n### 2. 克隆项目\n部署完成后，克隆你新生成的 GitHub 仓库到本地：\n\n```bash\ngit clone {{your-repo-name}}\ncd {{your-repo-name}}\n```\n\n### 3. 安装依赖\n使用 npm 或 yarn 安装项目依赖：\n\n```bash\n# 使用 npm\nnpm install\n\n# 或使用 yarn\nyarn\n```\n\n### 4. 配置环境变量\n在项目根目录创建 `.env.local` 文件，并根据以下步骤填充关键变量：\n\n*   **Astria 配置**：\n    *   `ASTRIA_API_KEY`: 从 [Astria 后台](https:\u002F\u002Fwww.astria.ai\u002Fusers\u002Fedit#api) 获取。\n    *   `APP_WEBHOOK_SECRET`: 自定义一个随机字符串（如 `shadf892yr398hq23h`）。\n    *   `DEPLOYMENT_URL`: 你的回调地址。本地开发可用 Ngrok 隧道地址，生产环境为 Vercel 域名（例如：`https:\u002F\u002F{your-url}\u002Fastria\u002Ftrain-webhook`）。\n    *   *(可选)* `NEXT_PUBLIC_TUNE_TYPE=packs` 和 `PACK_QUERY_TYPE=both`：若需使用 Astria 的 Packs API 功能。\n\n*   **Vercel Blob 配置**：\n    1.  在 Vercel 控制台进入 **Storage** -> **Connect Database** -> 创建 **Blob**。\n    2.  在 **Settings** -> **Environment Variables** 中找到 `BLOB_READ_WRITE_TOKEN`。\n    3.  将其填入 `.env.local` 的 `BLOB_READ_WRITE_TOKEN` 字段。\n\n*   **Supabase 认证配置**：\n    1.  登录 Supabase 控制台，进入 **Authentication** -> **Email Templates** -> **Magic Link**。\n    2.  粘贴以下模板：\n        ```html\n        \u003Ch2>Magic Link\u003C\u002Fh2>\n        \u003Cp>Follow this link to login:\u003C\u002Fp>\n        \u003Cp>\u003Ca href=\"{{ .SiteURL }}\u002Fauth\u002Fconfirm?token_hash={{ .TokenHash }}&type=email\">Log In\u003C\u002Fa>\u003C\u002Fp>\n        ```\n    3.  在 **Authentication** -> **URL Configuration** 中设置 `Site URL` 和 `Redirect URLs`（例如：`https:\u002F\u002Fyour-app.vercel.app\u002F**`）。\n\n*   **其他可选配置**：\n    *   **Resend**: 填入 `RESEND_API_KEY` 以启用邮件通知。\n    *   **Stripe**: 填入 `STRIPE_SECRET_KEY`, `STRIPE_WEBHOOK_SECRET` 及各档位 `STRIPE_PRICE_ID` 以启用支付，并将 `NEXT_PUBLIC_STRIPE_IS_ENABLED` 设为 `true`。\n    *   **公告栏**: 设置 `NEXT_PUBLIC_ANNOUNCEMENT_ENABLED=true` 和 `NEXT_PUBLIC_ANNOUNCEMENT_MESSAGE` 可开启顶部公告。\n\n## 基本使用\n\n### 启动开发服务器\n完成上述配置后，运行以下命令启动本地服务：\n\n```bash\n# 使用 npm\nnpm run dev\n\n# 或使用 yarn\nyarn dev\n```\n\n### 访问应用\n打开浏览器访问 `http:\u002F\u002Flocalhost:3000`。\n\n1.  **登录**：使用邮箱通过 Magic Link 登录。\n2.  **上传样本**：上传多张个人照片作为训练样本。\n3.  **训练模型**：提交训练请求（需确保 Astria 账户有可用额度）。\n4.  **生成头像**：等待训练完成后，即可生成专业的 AI 头像。\n\n> **注意**：若在生产环境中 webhook 回调不生效，请检查回调 URL 是否指向了需要身份验证的 Vercel 预览分支部署，建议指向主生产域名。","一家初创公司急需为官网团队页面制作统一风格的高清职业照，但团队成员分散各地且预算有限，无法组织线下集体拍摄。\n\n### 没有 headshots-starter 时\n- **成本高昂且协调困难**：聘请专业摄影师费用昂贵，且难以协调所有成员在同一时间前往影棚，导致项目无限期推迟。\n- **开发门槛极高**：若想自建 AI 生成服务，需从零搭建复杂的模型训练管道、数据库及支付系统，耗时数周甚至数月。\n- **风格难以统一**：成员各自用手机自拍或找不同机构修图，导致最终照片的光影、背景和着装风格杂乱无章，损害品牌形象。\n- **缺乏自动化流程**：从收集照片到通知用户取图全靠人工邮件沟通，效率低下且容易出错。\n\n### 使用 headshots-starter 后\n- **极速部署与低成本**：基于 Next.js 和 Vercel 的一键部署模板，开发者可在几分钟内上线专属应用，仅需支付极低的 API 调用成本。\n- **全流程自动化**：集成 Supabase 认证与 Resend 邮件通知，用户上传自拍后，系统自动训练模型并在生成完毕后发送邮件提醒，无需人工干预。\n- **风格高度可控**：利用 Astria 的 Packs API，可预设多种专业提示词包（如“商务蓝底”、“创意光影”），确保全员输出风格一致的高质量头像。\n- **商业闭环就绪**：内置 Stripe 支付接口和现代化的 Shadcn UI 组件，让团队能直接将其转化为付费 SaaS 产品或内部高效工具。\n\nheadshots-starter 将原本需要数周开发的复杂 AI 应用缩短为小时级的配置任务，让团队以最低成本快速获得专业级的品牌视觉资产。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fastriaai_headshots-starter_faad6ded.png","astriaai","Astria","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fastriaai_a35be638.png","Stable-Diffusion fine-tuning, Dreambooth and inference API","support@astria.ai","astria_ai","https:\u002F\u002Fwww.astria.ai","https:\u002F\u002Fgithub.com\u002Fastriaai",[84,88,92],{"name":85,"color":86,"percentage":87},"TypeScript","#3178c6",99,{"name":89,"color":90,"percentage":91},"CSS","#663399",0.9,{"name":93,"color":94,"percentage":95},"JavaScript","#f1e05a",0.1,4457,853,"2026-04-03T11:24:48","MIT",4,"未说明 (基于 Next.js，通常支持 Linux, macOS, Windows)","不需要本地 GPU (AI 模型训练和推理通过 Astria API 在云端完成)","未说明 (标准 Node.js\u002FNext.js 开发环境需求即可)",{"notes":105,"python":106,"dependencies":107},"这是一个基于 Next.js 的全栈 Web 应用模板，而非本地运行的 AI 模型。核心 AI 功能（头像生成）依赖外部 API (Astria.ai)，因此本地无需配置 GPU、CUDA 或 Python 环境。运行需安装 Node.js 依赖，并配置 Supabase 数据库、Astria API Key 及 Vercel Blob 存储。若需启用支付和邮件通知，还需配置 Stripe 和 Resend 账号。","不需要 (项目基于 Node.js\u002FNext.js，非 Python 项目)",[108,109,110,111,112,113,114,115,116],"Next.js","Node.js","Supabase (DB & Auth)","Astria API (AI 服务)","Tailwind CSS","Shadcn UI","Stripe (可选，支付)","Resend (可选，邮件)","Vercel Blob (存储)",[15],"2026-03-27T02:49:30.150509","2026-04-06T15:55:34.240445",[121,126,131,136,141,146,151,155],{"id":122,"question_zh":123,"answer_zh":124,"source_url":125},19533,"启动项目时提示找不到 `pages` 目录错误怎么办？","该错误通常是因为项目结构不符合 Next.js 要求。请确保在项目根目录下创建了 `pages` 文件夹。如果是参考 README 进行部署，请检查是否遗漏了初始化步骤或文件迁移。维护者指出可以在 README 中查看所需的表结构和类型关系，确保数据库 Schema 已正确配置。","https:\u002F\u002Fgithub.com\u002Fastriaai\u002Fheadshots-starter\u002Fissues\u002F12",{"id":127,"question_zh":128,"answer_zh":129,"source_url":130},19534,"模型训练一直显示“正在训练”（Constantly training）且无法完成怎么办？","这是一个常见问题，通常由以下两个原因导致：\n1. **Webhook 地址配置错误**：检查代码中的 `webhookUrl` 常量。如果 `process.env.VERCEL_URL` 未正确解析，需手动将其替换为实际的域名。例如：将 `const webhookUrl = \\`https:\u002F\u002F${process.env.VERCEL_URL}\u002Fleap\u002Ftrain-webhook\\`;` 修改为 `const webhookUrl = 'https:\u002F\u002F你的实际域名.com\u002Fleap\u002Ftrain-webhook';`。\n2. **账户费用问题**：训练模型需要消耗 GPU 资源，必须确保你的 Astria.ai 或 Leap AI 账户已付费或有足够的额度，免费账户可能无法完成训练。","https:\u002F\u002Fgithub.com\u002Fastriaai\u002Fheadshots-starter\u002Fissues\u002F76",{"id":132,"question_zh":133,"answer_zh":134,"source_url":135},19535,"为什么训练模型时会报错或提示需要付费？","训练模型需要使用 GPU 资源，成本较高，因此项目本身不提供免费训练服务。你必须先在 Leap AI (或 Astria) 平台上创建账户并获取 API Key，同时确保账户内有可用的额度或已绑定支付方式。如果在未配置付费账户的情况下尝试训练，系统会报错或卡住。","https:\u002F\u002Fgithub.com\u002Fastriaai\u002Fheadshots-starter\u002Fissues\u002F44",{"id":137,"question_zh":138,"answer_zh":139,"source_url":140},19536,"Stripe 支付成功后，用户的积分（Credits）没有在数据库中更新怎么办？","这通常是由于环境变量命名不一致导致的代码 Bug。请检查你的 `.env.local` 文件和 webhook 处理代码：\n1. 在 `.env.local` 中，你可能定义了类似 `STRIPE_PRODUCT_ID_3X` 的变量。\n2. 但在 `stripe-webhook` 代码中，程序可能尝试读取带有复数形式 'S' 的变量名（如 `STRIPE_PRODUCT_IDS_3X`）。\n**解决方案**：修改代码中的变量引用，去掉末尾多余的 'S'，使其与 `.env.local` 中的定义完全一致，或者反之修改环境变量名以匹配代码。","https:\u002F\u002Fgithub.com\u002Fastriaai\u002Fheadshots-starter\u002Fissues\u002F37",{"id":142,"question_zh":143,"answer_zh":144,"source_url":145},19537,"部署时提示 `Column 'modelId' of relation 'models' does not exist` 错误如何解决？","此错误表明 Supabase 数据库中的表结构与代码预期不符，缺少 `modelId` 列。这通常发生在数据库迁移脚本未完全执行时。\n**解决方案**：\n1. 登录 Supabase Dashboard。\n2. 检查 `models` 表的结构。\n3. 手动添加缺失的 `modelId` 列，或者重新运行项目提供的 SQL 迁移脚本以同步最新架构。\n4. 如果 UI 显示缓存问题，尝试清除浏览器缓存或重启本地开发服务器。","https:\u002F\u002Fgithub.com\u002Fastriaai\u002Fheadshots-starter\u002Fissues\u002F50",{"id":147,"question_zh":148,"answer_zh":149,"source_url":150},19538,"Astria AI 的回调（Callback\u002FWebhook）从未被触发怎么办？","如果模型创建成功但收不到回调，通常是回调 URL 配置问题。\n**检查步骤**：\n1. 确认 `VERCEL_URL` 环境变量已设置为你的真实域名（而非 localhost 或空值）。\n2. 检查生成的回调 URL 格式是否正确，应类似于 `https:\u002F\u002F你的域名.com\u002Fastria\u002Ftrain-webhook?user_id=...&webhook_secret=...`。\n3. 确保该域名是公网可访问的，且防火墙或 Vercel 设置没有阻止来自 Astria 服务器的 POST 请求。\n4. 尝试在 Astria  dashboard 中手动测试 Webhook 连通性。","https:\u002F\u002Fgithub.com\u002Fastriaai\u002Fheadshots-starter\u002Fissues\u002F107",{"id":152,"question_zh":153,"answer_zh":154,"source_url":125},19539,"如何获取 Supabase 的 Schema 文件或数据库结构信息？","项目中可能不直接包含导出的 Schema 文件。你可以参考以下方式获取结构信息：\n1. 查看项目的 `README.md` 文件，其中通常详细列出了每个表所需的列名、数据类型及关联关系。\n2. 参考官方文档或 Issue 中提供的截图，了解 `tables`、`types` 和 `relations` 的具体定义。\n3. 直接在 Supabase 控制面板中查看已创建的表结构。",{"id":156,"question_zh":157,"answer_zh":158,"source_url":159},19540,"演示网站无法创建账户或需要找回密码怎么办？","该项目目前使用“魔术链接”（Magic Link）方式进行身份验证，不再支持传统的密码登录或找回密码功能。\n**解决方案**：\n1. 在登录页面输入你的邮箱地址。\n2. 系统会发送一封包含登录链接的邮件到你的邮箱。\n3. 点击邮件中的链接即可直接登录或验证账户。如果你已验证过邮箱但仍无法登录，请尝试重新发送魔术链接。","https:\u002F\u002Fgithub.com\u002Fastriaai\u002Fheadshots-starter\u002Fissues\u002F2",[]]