This project provides an API endpoint that allows users to upload an image and a text prompt. It then leverages an AI API to edit the image based on the prompt, returning the URL of the edited image. It solves the problem of programmatically editing images using AI with a simple API interface.
- Image Upload: Accepts image uploads via
multipart/form-data. - AI-Powered Editing: Integrates with an AI API to modify images based on text prompts.
- CDN Storage: Uploads original images to
cdn.yupra.my.idfor storage and retrieval. - Error Handling: Implements robust error handling to gracefully manage issues during file processing, uploads, and API calls.
- Asynchronous Operations: Uses asynchronous functions to handle file uploads and API requests efficiently.
- Simple API: Provides a straightforward
/api/editendpoint for easy integration.
- Backend:
- Node.js
- Dependencies:
axios: For making HTTP requests to the AI API and CDN.cheerio: For HTML parsing (potentially used elsewhere in the project).file-type: For detecting the file type of uploaded images.form-data: For creatingmultipart/form-datastreams for file uploads.multer: For handlingmultipart/form-datafor image uploads.
- Other:
- Vercel (for deployment)
- Node.js (v18 or higher)
- npm or yarn
-
Clone the repository:
git clone https://github.com/Fiisya/ai-edit-image cd ai-image-editor -
Install dependencies:
npm install # or yarn install
- No local running is available, this is an API endpoint designed to be deployed on serverless functions.
- Deploy to Vercel or similar platform.
ai-image-editor/
├── api/
│ └── edit.js # API endpoint for image editing
├── package.json # Project metadata and dependencies
└── README.md # Project documentation (this file)
https://aduhai-fomonye.alfixd.my.id
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Make your changes and commit them with descriptive messages.
- Push your changes to your fork.
- Submit a pull request.
MIT (Replace with your project's license file if applicable)
Thank you for checking out this project! We hope it's helpful.