{"id":17145180,"url":"https://github.com/olokobayusuf/instruct-edit","last_synced_at":"2025-03-24T10:23:15.579Z","repository":{"id":189786885,"uuid":"681305183","full_name":"olokobayusuf/instruct-edit","owner":"olokobayusuf","description":"Image editor that uses natural language. Created with exactly zero image editing knowledge using https://fxn.ai.","archived":false,"fork":false,"pushed_at":"2023-08-21T18:20:03.000Z","size":2250,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-17T20:06:10.087Z","etag":null,"topics":["fxnai","image-editing","nextjs","opencv"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/olokobayusuf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-08-21T18:13:03.000Z","updated_at":"2025-01-02T01:30:07.000Z","dependencies_parsed_at":"2023-08-21T19:41:20.625Z","dependency_job_id":null,"html_url":"https://github.com/olokobayusuf/instruct-edit","commit_stats":null,"previous_names":["olokobayusuf/instruct-edit"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olokobayusuf%2Finstruct-edit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olokobayusuf%2Finstruct-edit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olokobayusuf%2Finstruct-edit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olokobayusuf%2Finstruct-edit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/olokobayusuf","download_url":"https://codeload.github.com/olokobayusuf/instruct-edit/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245249709,"owners_count":20584583,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["fxnai","image-editing","nextjs","opencv"],"created_at":"2024-10-14T21:04:51.472Z","updated_at":"2025-03-24T10:23:15.555Z","avatar_url":"https://github.com/olokobayusuf.png","language":"TypeScript","readme":"# Instruct Edit\n![instruct-edit](/instruct-edit.gif)\n\nThis is a minimal web app that performs image editing using a natural language prompt.\n\n## How it Works\nThis example builds upon the stock Next.js starter example to create a natural language image editor. The editor works in two steps:\n1. Convert natural language to structured image filter settings. For this, we use the [@yusuf/un2structured](https://www.fxn.ai/@yusuf/un2structured) predictor that takes in a `prompt` and a JSON `schema` to generate a JSON object:\n\n    ![un2structured](un2structured.gif)\n\n2. Perform image editing using OpenCV and Python. Here, we don't actually write any code. Instead, we use Function's ability to write code for us, all from a description of what we want the function to do. Head over to [fxn.ai/create](https://fxn.ai/create) and create a new predictor with the following prompt:\n    \u003e Create a predictor that accepts an image, a brightness value, contrast value, hue shift value, and saturation value. Each of the brightness, contrast, hue shift, and saturation values should be in range [-1, 1] and should have a default value of 0. The predictor should use OpenCV to edit the input image in order. Finally, the predictor should return the resulting image.\n\n## Setup Instructions\n1. Clone this repo.\n2. Rename `.env.example` to `.env.local`\n3. Login or register on [Function](https://fxn.ai) and generate an access key:\n    ![generate access key](https://raw.githubusercontent.com/fxnai/.github/main/access_key.gif) \u003cbr/\u003e\n    Then paste the generated access key as the `NEXT_PUBLIC_FXN_ACCESS_KEY` value in your `.env.local` file.\n    \u003e ⛔: **Do not publish this website with your access key**. Your key will be publicly viewable.\n4. Head over to [fxn.ai/create](https://fxn.ai/create) to create an image editing predictor. Use the prompt from the \"How it Works\" section above. Once the predictor is active, copy the predictor tag (e.g. `@username/predictor-name`) and paste it as the `NEXT_PUBLIC_EDIT_FXN_TAG` value in your `.env.local` file.\n5. Run the Next.js development server:\n    ```bash\n    # Open a terminal and run the following command\n    npm run dev\n    ```\n    Once you do this, open [localhost:3000](http://localhost:3000) and play around with the editor!\n\n## Useful Links\n- [Discover predictors to use in your apps](https://fxn.ai/explore).\n- [Join the Function community on Discord](https://fxn.ai/community).\n- [Check out Function docs](https://docs.fxn.ai).","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Folokobayusuf%2Finstruct-edit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Folokobayusuf%2Finstruct-edit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Folokobayusuf%2Finstruct-edit/lists"}