{"id":15055285,"url":"https://github.com/sae-llm-coconut/coconut-ai","last_synced_at":"2025-06-14T20:12:56.092Z","repository":{"id":197181670,"uuid":"698107795","full_name":"sae-llm-coconut/coconut-ai","owner":"sae-llm-coconut","description":"Python library that ease the installation process of Stable Diffusion, and allows to genrate images with a nice to use API.","archived":false,"fork":false,"pushed_at":"2024-01-26T08:06:29.000Z","size":174,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"develop","last_synced_at":"2025-02-02T19:06:51.620Z","etag":null,"topics":["llama2","python-library","stable-diffusion"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/coconut-ai/","language":"Python","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/sae-llm-coconut.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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}},"created_at":"2023-09-29T07:10:39.000Z","updated_at":"2025-01-27T18:01:55.000Z","dependencies_parsed_at":"2023-11-16T14:48:16.428Z","dependency_job_id":"d615978b-0c44-43c1-b246-de9e1852b491","html_url":"https://github.com/sae-llm-coconut/coconut-ai","commit_stats":{"total_commits":27,"total_committers":7,"mean_commits":3.857142857142857,"dds":"0.33333333333333337","last_synced_commit":"d5b79b768d95c08c634437852dd0fdbce5c840b9"},"previous_names":["sae-llm-coconut/coconut-ai"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sae-llm-coconut%2Fcoconut-ai","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sae-llm-coconut%2Fcoconut-ai/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sae-llm-coconut%2Fcoconut-ai/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sae-llm-coconut%2Fcoconut-ai/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sae-llm-coconut","download_url":"https://codeload.github.com/sae-llm-coconut/coconut-ai/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238677009,"owners_count":19511927,"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":["llama2","python-library","stable-diffusion"],"created_at":"2024-09-24T21:40:00.999Z","updated_at":"2025-02-16T11:32:18.497Z","avatar_url":"https://github.com/sae-llm-coconut.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# coconut-ai\n\n## About\n\n**Coconut AI** is a **Python library** that allows you to use [AUTOMATIC1111/Stable Diffusion Web API](https://github.com/AUTOMATIC1111/stable-diffusion-webui) and [LLama 2](https://ai.meta.com/llama/), to **generate images from text**, **images to images** or **text to text**.\n\nThe library is available on **PyPy**: \u003chttps://pypi.org/project/coconut-ai/\u003e.\n\n## Getting Started\n\n### Prerequisites\n\n- [Python](https://www.python.org/) v3.10\n- [Pipenv](https://pipenv.pypa.io/)\n- [AUTOMATIC1111/Stable Diffusion Web UI](https://github.com/AUTOMATIC1111/stable-diffusion-webui) v1.6.0\n\n### Installation\n\n```sh\npipenv install coconut-ai\n```\n\n### Stable Diffusion Guide\n\nFor a complete example, see the [coconut-ai-example](https://github.com/sae-llm-coconut/coconut-ai-example) repository.\n\n#### Install Stable Diffusion Web UI\n\n[AUTOMATIC1111/Stable Diffusion Web UI installation guide](https://github.com/AUTOMATIC1111/stable-diffusion-webui?tab=readme-ov-file#installation-and-running)\n\n```sh\n# Clone the AUTOMATIC1111/Stable Diffusion Web UI repository\ngit clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git\n\n# Go to AUTOMATIC1111/Stable Diffusion Web UI source code\ncd stable-diffusion-webui\n\n# For Windows users, run the following command for starting the server\n./webui-user.bat --api --nowebui\n\n# For Linux/MacOS users, run the following command for starting the server\n./webui.sh --api --nowebui\n```\n\n#### Stable Diffusion Usage\n\n**Note:** Before using the library, you must start the Stable Diffusion Web UI server.\n\n```sh\n# Go to your Python project/source code\ncd ../python-project\npipenv install coconut-ai\n```\n\nCreate a file named `main.py` with the following content (minimal example):\n\n```py\nimport os\n\nimport coconut_ai\n\nif __name__ == '__main__':\n    print(\"Coconut AI\")\n    output_path = os.path.abspath(\"output.png\")\n    os.makedirs(os.path.dirname(output_path), exist_ok=True)\n    coconut_ai.text_to_image({\n        \"input_text\": \"Coconut\",\n        \"output_path\": output_path,\n        \"steps\": 5\n    })\n```\n\nRun the script:\n\n```sh\npipenv run python main.py\n```\n\n### LLama 2 Guide\n\n#### Install LLama 2 Model\n\nFor a complete example, see the [coconut-ai-example](https://github.com/sae-llm-coconut/coconut-ai-example) repository.\n\nDownload the model [`llama-2-7b.Q5_K_M.gguf`](https://huggingface.co/TheBloke/Llama-2-7B-GGUF/blob/main/llama-2-7b.Q5_K_M.gguf) manually.\n\nAll available models can be found on the [Hugging Face](https://huggingface.co/TheBloke/Llama-2-7B-GGUF#provided-files) website.\n\n#### LLama 2 Usage\n\n```sh\n# Go to your Python project/source code\ncd ../python-project\npipenv install coconut-ai\n```\n\nCreate a file named `main.py` with the following content (minimal example):\n\n```py\nimport os\n\nimport coconut_ai\n\nif __name__ == '__main__':\n    print(\"Coconut AI\")\n    # Replace with the model path for the llama-2-7b.Q5_K_M.gguf model downloaded manually\n    model_path = os.path.abspath(\"data/llama-2-7b.Q5_K_M.gguf\")\n    print(coconut_ai.text_to_text({\n        'input_text': \"Generate a list of 5 funny dog names.\",\n        'max_tokens': 1000,\n        'model_path': model_path\n    }))\n```\n\nRun the script:\n\n```sh\npipenv run python main.py\n```\n\n## 💡 Contributing\n\nAnyone can help to improve the project, submit a Feature Request, a bug report or even correct a simple spelling mistake.\n\nThe steps to contribute can be found in the [CONTRIBUTING.md](./CONTRIBUTING.md) file.\n\n## 📄 License\n\n[MIT](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsae-llm-coconut%2Fcoconut-ai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsae-llm-coconut%2Fcoconut-ai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsae-llm-coconut%2Fcoconut-ai/lists"}