{"id":23587696,"url":"https://github.com/zhreyu/stable-clipstagram","last_synced_at":"2026-05-07T09:34:08.407Z","repository":{"id":269896518,"uuid":"908789312","full_name":"Zhreyu/stable-clipstagram","owner":"Zhreyu","description":"An intelligent content generation pipeline that uses AI to analyze Instagram content, generate engaging captions, and post unique images generated using SD3.","archived":false,"fork":false,"pushed_at":"2024-12-27T02:46:20.000Z","size":3625,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-20T15:23:24.689Z","etag":null,"topics":["ai","captioning-images","clip","content-generation","image-caching","insatgram","llama3","llama3-2","ollama","ranking-algorithm","stable-diffusion","transformers"],"latest_commit_sha":null,"homepage":"","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/Zhreyu.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-27T01:20:40.000Z","updated_at":"2024-12-27T02:46:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"3f5c99fe-0c64-45f9-bf8d-20d73f6ce82d","html_url":"https://github.com/Zhreyu/stable-clipstagram","commit_stats":null,"previous_names":["zhreyu/stable-clipstagram"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zhreyu%2Fstable-clipstagram","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zhreyu%2Fstable-clipstagram/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zhreyu%2Fstable-clipstagram/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zhreyu%2Fstable-clipstagram/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Zhreyu","download_url":"https://codeload.github.com/Zhreyu/stable-clipstagram/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239418547,"owners_count":19635203,"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":["ai","captioning-images","clip","content-generation","image-caching","insatgram","llama3","llama3-2","ollama","ranking-algorithm","stable-diffusion","transformers"],"created_at":"2024-12-27T05:09:21.833Z","updated_at":"2025-10-26T20:36:09.693Z","avatar_url":"https://github.com/Zhreyu.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# stable-clipstagram\n\nAn end-to-end AI pipeline demonstrating the practical integration of generative and discriminative models for automated content creation. The system analyzes existing Instagram content using CLIP to learn patterns, generates contextual captions using Llama 3.2, and creates new images using Stable Diffusion 3. This project showcases how modern AI models can be chained together to create a fully automated content generation pipeline, with built-in optimizations like OpenCV-based image fingerprinting to cache rankings and avoid redundant computations.\n\n## Generated Examples\nPrompts used to generate below images are generated by AI based on some source accounts:\n\n- \"In the mirror, we often see only what's on the surface, but the truth lies within. A glance inside can change everything.\"\n- \"Symbol of hope in darkness\"\n- \"A glimpse into the beauty that unfolds when life becomes just another canvas waiting to be explored\"\n- \"Thought-provoking images that capture love and sometimes, controversy.\"\n- \"A glowing aura surrounds purpose, even when systems crash and the mind freezes.\"\n![Generated Content](posted_images/examples.gif)\n\n## Technical Stack\n\n- **Computer Vision**: OpenAI CLIP for zero-shot image ranking and OpenCV for image fingerprinting and caching\n- **Text Generation**: Llama 3.2 (1B) for context-aware captions\n- **Image Generation**: Stable Diffusion 3\n- **Integration**: Instagram API via instagrapi and instaloder\n- **Optimization**: Pickle-based caching of image embeddings\n\n![image](https://github.com/user-attachments/assets/1628deee-c9d7-49de-8f6e-a4931fde13f1)\n\n\n## Features\n\n- 🤖 CLIP-based image quality assessment and ranking\n- 🔤 Local LLM integration for caption generation\n- 🎨 Batch image generation with Stable Diffusion 3\n- 📊 Automated content quality control\n- 💨 Performance optimization with OpenCV fingerprinting\n- 📱 Instagram API integration\n\n\n## Setup\n\n1. Clone and install dependencies:\n```bash\ngit clone https://github.com/Zhreyu/stable-clipstagram.git\ncd stable-clipstagram\npip install -r requirements.txt\n```\n\n2. Install Ollama and Llama 2:\n```bash\ncurl -fsSL https://ollama.com/install.sh | sh\nollama pull llama3.2:1b\nollama serve\n```\n\n3. Configure environment:\n```bash\n# Create .env file\nINSTAGRAM_USERNAME=your_username\nINSTAGRAM_PASSWORD=your_password\nSOURCE_ACCOUNTS=account1,account2,account3\n```\n\n## Usage\n\n```bash\npython main.py\n```\n\n## Learning Points\n\n- **CLIP Applications**: Practical usage of CLIP for image ranking beyond basic image-text matching\n- **Local LLM Integration**: Using Ollama for efficient local caption generation\n- **AI Pipeline Design**: Combining multiple AI models in a production-ready pipeline\n- **Quality Control**: Implementing automated content curation using AI\n\n## Contributing\n\nFeel free to:\n- Suggest model optimizations\n- Add alternative model implementations\n- Improve the pipeline efficiency\n- Enhance documentation\n\n## License\n\nMIT License - See LICENSE file\n\n## Author\n\n[@Zhreyu](https://github.com/Zhreyu)\n\n## Disclaimer\n\nThis project is for educational purposes. Ensure compliance with Instagram's terms of service when using this tool.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhreyu%2Fstable-clipstagram","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzhreyu%2Fstable-clipstagram","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhreyu%2Fstable-clipstagram/lists"}