{"id":27773564,"url":"https://github.com/asutoshpati/artikle","last_synced_at":"2026-04-11T10:36:10.558Z","repository":{"id":290152548,"uuid":"972798295","full_name":"AsutoshPati/artikle","owner":"AsutoshPati","description":"Turn boring text into stunning visuals with this Python pipeline. Artikle extracts text from images using OCR, summarizes it with AI (OpenAI, Gemini, or Ollama), and generates beautiful illustrations through DALL-E or local diffusion models—inspired by Harry Potter's magical newspapers! #image-generation #visualization#ocr","archived":false,"fork":false,"pushed_at":"2025-04-27T08:13:50.000Z","size":39185,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-27T08:26:33.056Z","etag":null,"topics":["dalle-3","fastapi","gemini","image-generation","image-to-text","llm-inference","ocr-recognition","ollama","openai","stable-diffusion","text-to-image"],"latest_commit_sha":null,"homepage":"https://www.linkedin.com/posts/asutoshpati_artikle-samples-activity-7322158037090078720-oCHg","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/AsutoshPati.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,"zenodo":null}},"created_at":"2025-04-25T17:19:56.000Z","updated_at":"2025-04-27T08:13:53.000Z","dependencies_parsed_at":"2025-04-27T08:36:43.369Z","dependency_job_id":null,"html_url":"https://github.com/AsutoshPati/artikle","commit_stats":null,"previous_names":["asutoshpati/artikle"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AsutoshPati%2Fartikle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AsutoshPati%2Fartikle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AsutoshPati%2Fartikle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AsutoshPati%2Fartikle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AsutoshPati","download_url":"https://codeload.github.com/AsutoshPati/artikle/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251608442,"owners_count":21616858,"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":["dalle-3","fastapi","gemini","image-generation","image-to-text","llm-inference","ocr-recognition","ollama","openai","stable-diffusion","text-to-image"],"created_at":"2025-04-30T01:10:21.944Z","updated_at":"2025-10-16T19:44:25.778Z","avatar_url":"https://github.com/AsutoshPati.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Artikle - Some Text Deserves to Be Seen\n\n## ✨ Why Artikle?\nIt all started with my little brother. He asked me something from his textbook, and like any busy older sibling, I gave him the universal “wait a minute.” That “minute” never came. But the idea stuck — what if text could just... come to life?\n\nAnd just like that, inspired by the magical newspapers from Harry Potter (yes, the ones that move), Artikle was born. It's not wizardry — it's code. But to non-techies, the results are just as magical.\n\n\n## 🧑‍💻 What Does Artikle Do?\nArtikle is your mini creative studio in a Python pipeline. Give it an image of text—be it a textbook page, a news clipping, or even that 3rd grade storybook—and it’ll:\n- 📸 Read the text using OCR (Tesseract).\n- 🧠 Summarize the key idea using your favorite LLM (Gemini, OpenAI, or Ollama).\n- ✏️ Craft an image generation prompt.\n- 🎨 Generate a stunning image using DALL·E or a local diffusion model.\n\nYes, all of that. From one picture. You’re welcome.\n\n\n## 🔥 Features\n- 🖋️ **Image-to-Text Extraction**  \n    Snatch text straight out of images (like textbooks, articles, or even that weird meme) using Tesseract OCR.\n\n- 📚 **Smart Summarization**  \n    Summon the power of LLMs—ChatGPT, Gemini, or Ollama—to compress walls of text into crystal-clear summaries.\n\n- 🎯 **Built-in Prompt Engineering**  \n    Automatically converts summaries into art-ready prompts, so you don’t have to channel your inner poet.\n\n- 🖼️ **Stunning Image Generation**  \n    Turn text into eye-candy using OpenAI’s DALL·E or locally hosted diffusion models like Stable Diffusion XL or Waifu Diffusion.\n\n- 🔄 **Model-Switching Magic**  \n    No need to crack open the code! Just tweak a `.env` file to swap between LLMs or image generators.\n\n- 💡 **Prompt Customization? EZ.**  \n    Want to fine-tune the image prompt style? Just edit a file in the `prompts directory` —no digging through code required.\n\n- 🌍 **On-Prem Ready**  \n    Run everything locally. No cloud? No problem. Perfect for secure, offline, or private deployments.\n\n- 🔌 **API-First Architecture**  \n    Use Artikle as a service! Easily integrate it into other apps, bots, or tools without rewriting logic.\n\n- 🧪 **Minimal Dependencies, Max Impact**  \n    Clean codebase with modular components—hackable, forkable, remixable.\n\n- ✨ **Harry-Potter-Vibes? Definitely.**  \n    Because why shouldn’t textbook learning feel like flipping through a magical newspaper?\n\n\n## ⚙️ Setup Guide (Get Comfy First)\n### 1️⃣ Clone the Repo and Install Dependencies\n```bash\ngit clone https://github.com/AsutoshPati/artikle.git\ncd artikle\n```\n\n[**Optional, but highly recomended**] Create a virtual environment to keep things clean, isolated, and drama-free (avoid any library conflicts):\n```bash\npython3 -m venv venv\nsource venv/bin/activate  \n# On Windows use `venv\\Scripts\\activate`\n```\n\nNow install the required packages\n```bash\npip install -r requirements.txt\n```\n\n### 2️⃣ Install Tesseract OCR (So Artikle Can \"Read\")\n- Linux\n    ```bash\n    sudo apt install tesseract-ocr\n    ```\n\n- macOS\n    ```bash\n    brew install tesseract\n    ```\n\n- Windows \u003cbr\u003e\n    Download the installer from [Tesseract UB Mannheim](https://github.com/UB-Mannheim/tesseract/wiki) \u003cbr\u003e\n    And add the installation path to your system’s environment variables.\n\n🔗 [Tesseract Documentation](https://tesseract-ocr.github.io/tessdoc/Installation.html)\n\n\n### 3️⃣ LLM Setup\n#### Install Ollama (if using local LLM)\nOllama runs models locally on your machine, like LLaMA or Mistral.\n- Install from: \u003chttps://ollama.com/download\u003e\n- Run locally with:\n    ```bash\n    ollama run \u003cmodel-name\u003e\n    # example: ollama run llama3.2:3b\n    ```\n- 🔗 Docs: [Ollama Dev Guide](https://github.com/ollama/ollama)\n\n\n#### OpenAI\n- Sign up: \u003chttps://auth.openai.com/create-account\u003e\n- Go to API keys → generate one.\n- Docs: [OpenAI API Guide](https://platform.openai.com/docs/overview)\n\n\n#### Gemini (Google AI)\n- Visit: \u003chttps://makersuite.google.com/app\u003e\n- Create a project, get your API key.\n- Docs: [Gemini API Reference](https://ai.google.dev/gemini-api/docs)\n\n\n### 4️⃣ Configure the .env File\nCopy from the template and make it your own:\n```bash\ncp sample.env .env\n```\n\nThen, update like so:\n\n```env\n# Server Config\nHOST=\"0.0.0.0\"\nPORT=9090\n\n# LLM Model Config\nUSE_MODEL=\"OLLAMA\"\n#### Options\n#### GEMINI - API key needed\n#### OLLAMA - Local (Prior installation required)\n#### OPENAI - API key needed\n\n# Image Gen Model Config\nIMG_GEN_SERVICE=\"DIFFUSION\"\n#### Options\n#### OPENAI - API key needed\n#### DIFFUSION - Local (Prior installation required)\n\n## OpenAI Config\nOPENAI_API_KEY=\u003cyour_openai_api_key\u003e\nOPENAI_LLM_MODEL=\"gpt-4o-mini\"\nOPENAI_IMG_MODEL=\"dall-e-3\"\n\n## Gemini Config\nGEMINI_API_KEY=\u003cyour_gemini_api_key\u003e\nGEMINI_MODEL=\"gemini-2.0-flash\"\n\n## Ollama Config\nOLLAMA_MODEL=\"llama3.2:3b\"\n\n## HuggingFace Credential\nHF_TOKEN=\u003cyour_huggingface_token\u003e\n\n## Diffusion Model\nDIFFUSION_MODEL_OPT=2\n#### Options\n#### 1 - Stable Diffusion by RunwayML\n#### 2 - Stable Diffusion XL\n#### 3 - Flux v1 Dev (Do not use; requires very high GPU)\n#### 4 - Waifu Diffusion\n#### 5 - DeepFloyd IF (Do not use; requires very high GPU)\n```\n\n\n## 🪄 Run the Magic (Project)\nOnce everything is set up; You’re ready to turn boring old text into magic!\n```bash\npython main.py\n```\nNow sit back and let Artikle turn words into worlds.\n\n\n### 🔌 API Quick Peek\n**Endpoint:** `/upload` \u003cbr\u003e\n**Method:** `POST` \u003cbr\u003e\n**Content-Type:** `multipart/form-data`\n\n**Payload Example:**\n```form\nstyle: realistic  # options: cartoon, comic, realistic\nfile: your_image.png\n```\n\n**Sample Response:**\n```json\n{\n  \"summary\": \"Photosynthesis is the process...\",\n  \"image_prompt\": \"A lush green forest under sunlight showing energy transfer\",\n  \"generated_image\": \"http://localhost:9090/images/generated.png\"\n}\n```\n\n\u003e💡 You can also use the prompt in your own image tools (ChatGPT web UI does wonders with it).\n\n\n\u003cbr\u003e\nOr, you can also use a minimalistic UI to call this API; \u003cbr\u003e\nJust head to the built-in Swagger Doc interface:\n\u003cbr\u003e\u003cbr\u003e\n\nSwagger Endpoint: `/docs`\n- Click “Try it out”\n- Choose your desired image style\n- Upload the image with the text content you want visualized\n- Hit \"Execute\" and relax while the magic happens\n\n\n### 🔄 Switching Between Models\nChange these in your .env, no code edits needed:\n```env\nUSE_MODEL=\"GEMINI\"  # or OPENAI or OLLAMA\nIMG_GEN_SERVICE=\"DIFFUSION\"  # or OPENAI\nDIFFUSION_MODEL_OPT=1  # 1 to 5 options available\n```\n\nDiffusion Options:\n| Option    | Model Name |\n| --------- | ---------- |\n| 1 | RunwayML Stable Diffusion v1.5 |\n| 2 | Stable Diffusion XL            |\n| 3 | Flux v1 Dev (GPU hungry!)      |\n| 4 | Waifu Diffusion                |\n| 5 | DeepFloyd IF (GPU hungry!)     |\n\n😞 Not happy with the response? Want to upgrade the prompt? \u003cbr\u003e\n🤩 **It’s EZ!** \u003cbr\u003e\n\u003e You don’t even need to touch the code — just head over to the **prompts directory** and tweak the templates to your heart’s content. Your creativity, your rules.\n\n\n## 🖼 Sample Gallery\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"./sample_gallery/news_raw.jpg\" width=\"250\" alt=\"News Article\" /\u003e\n  \u003cimg src=\"./sample_gallery/ed_sub_raw.jpeg\" width=\"250\" alt=\"Educational Subject\" /\u003e\n  \u003cimg src=\"./sample_gallery/story_raw.jpeg\" width=\"250\" alt=\"Short Story\" /\u003e\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"./sample_gallery/news_cartoon.png\" width=\"250\" alt=\"Cartoon Style News Article\" /\u003e\n  \u003cimg src=\"./sample_gallery/ed_sub_cartoon.png\" width=\"250\" alt=\"Cartoon Style Educational Subject\" /\u003e\n  \u003cimg src=\"./sample_gallery/story_cartoon.png\" width=\"250\" alt=\"Cartoon Style Short Story\" /\u003e\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"./sample_gallery/news_realistic.png\" width=\"250\" alt=\"Realistic Style News Article\" /\u003e\n  \u003cimg src=\"./sample_gallery/ed_sub_realistic.png\" width=\"250\" alt=\"Realistic Style Educational Subject\" /\u003e\n  \u003cimg src=\"./sample_gallery/story_realistic.png\" width=\"250\" alt=\"Realistic Style Short Story\" /\u003e\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"./sample_gallery/news_comic.png\" width=\"250\" alt=\"Comic Style News Article\" /\u003e\n  \u003cimg src=\"./sample_gallery/ed_sub_comic.png\" width=\"250\" alt=\"Comic Style Educational Subject\" /\u003e\n  \u003cimg src=\"./sample_gallery/story_comic.png\" width=\"250\" alt=\"Comic Style Short Story\" /\u003e\n\u003c/div\u003e\n\n\u003cbr\u003e\u003cbr\u003e\u003cbr\u003e\n\n**By ChatGPT**\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"./sample_gallery/news_cartoon_chatgpt.png\" width=\"250\" alt=\"Cartoon Style News Article\" /\u003e\n  \u003cimg src=\"./sample_gallery/ed_sub_cartoon_chatgpt.png\" width=\"250\" alt=\"Cartoon Style Educational Subject\" /\u003e\n  \u003cimg src=\"./sample_gallery/story_cartoon_chatgpt.png\" width=\"250\" alt=\"Cartoon Style Short Story\" /\u003e\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"./sample_gallery/news_realistic_chatgpt.png\" width=\"250\" alt=\"Realistic Style News Article\" /\u003e\n  \u003cimg src=\"./sample_gallery/ed_sub_realistic_chatgpt.png\" width=\"250\" alt=\"Realistic Style Educational Subject\" /\u003e\n  \u003cimg src=\"./sample_gallery/story_realistic_chatgpt.png\" width=\"250\" alt=\"Realistic Style Short Story\" /\u003e\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"./sample_gallery/news_comic_chatgpt.png\" width=\"250\" alt=\"Comic Style News Article\" /\u003e\n  \u003cimg src=\"./sample_gallery/ed_sub_comic_chatgpt.jpeg\" width=\"250\" alt=\"Comic Style Educational Subject\" /\u003e\n  \u003cimg src=\"./sample_gallery/story_comic_chatgpt.png\" width=\"250\" alt=\"Comic Style Short Story\" /\u003e\n\u003c/div\u003e\n\n\n## 🧭 Roadmap / Future Improvements\n- 🔊 Add Text-to-Speech narration\n- 🎮 Let users fine-tune image styles\n- 🧠 Support more LLM/image models\n- 🌐 Host a web UI for non-tech users\n\n\n## 🧑‍💻 For Devs Who Still Read READMEs 🤝\nYou made it to the bottom? You're my kind of developer. Thanks. ❤️ \u003cbr\u003e\nThis project was written not just to solve a problem, but to spark a little joy and curiosity. \u003cbr\u003e\nFeel free to fork, hack, and build something even cooler with it. And, don’t forget to ⭐ **give a star** if you liked the project — it really helps and keeps the magic going!\n\n\n## 📝 License\nThis project is licensed under the MIT License - see the [LICENSE]() file for details.\n\n\n## 🙌 Shoutout\n- Inspired by my curious little brother 🧒\n- And Harry Potter, for making newspapers awesome again.\n- Thanks to the incredible models by OpenAI, Hugging Face, Google AI, and Ollama.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasutoshpati%2Fartikle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fasutoshpati%2Fartikle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasutoshpati%2Fartikle/lists"}