├── config ├── aisettings.txt ├── igsettings.txt └── captions.txt ├── run.bat ├── output ├── 1.jpg ├── 2.jpg ├── 3.jpg └── 4.jpg ├── requirements.txt ├── setup.bat ├── models └── instructions.txt ├── igbot.py ├── setup.py ├── README.md └── main.py /config/aisettings.txt: -------------------------------------------------------------------------------- 1 | 2 2 | 100 3 | 0 4 | 0 -------------------------------------------------------------------------------- /run.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | python -u "main.py" 3 | pause 4 | -------------------------------------------------------------------------------- /config/igsettings.txt: -------------------------------------------------------------------------------- 1 | USERNAME 2 | PASSWORD 3 | #like4like #follow4follow 4 | 0 -------------------------------------------------------------------------------- /output/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/louistaii/AI-Influencer/HEAD/output/1.jpg -------------------------------------------------------------------------------- /output/2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/louistaii/AI-Influencer/HEAD/output/2.jpg -------------------------------------------------------------------------------- /output/3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/louistaii/AI-Influencer/HEAD/output/3.jpg -------------------------------------------------------------------------------- /output/4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/louistaii/AI-Influencer/HEAD/output/4.jpg -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | diffusers==0.25.0 2 | gdown==4.7.1 3 | instagrapi==2.0.1 4 | Pillow==10.1.0 5 | psutil==5.9.7 6 | torch==2.0.1+cu118 7 | -------------------------------------------------------------------------------- /setup.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | echo Installing Dependencies... 3 | pip install -r requirements.txt 4 | pause 5 | cls 6 | python -u "setup.py" 7 | pause 8 | cls 9 | python -u "main.py" 10 | 11 | -------------------------------------------------------------------------------- /models/instructions.txt: -------------------------------------------------------------------------------- 1 | To use your own custom model, rename your model file to realistic (for models with SD v1-5 base) or realisticXL (SDXL v1.0 based) and then place the model folder into this folder. 2 | Custom LORA weights can be used by replacing the weight.safetensors (for models with SD v1-5 base) or weightsXL((SDXL v1.0 based)) file in this folder with your trained weight. -------------------------------------------------------------------------------- /igbot.py: -------------------------------------------------------------------------------- 1 | import pathlib 2 | import random 3 | import os 4 | from instagrapi import Client 5 | from instagrapi.types import Location 6 | 7 | 8 | 9 | 10 | path = pathlib.Path(__file__).parent.resolve() 11 | cl = Client() 12 | 13 | def f4f(): 14 | posts = cl.hashtag_medias_recent("like4like", 5) 15 | for i in range(5): 16 | print(f"Liked Post {i+1}") 17 | cl.media_like(posts[i].id) 18 | cl.user_follow(posts[i].user.pk) 19 | print("Followed " + posts[i].user.username) 20 | 21 | 22 | 23 | 24 | def getcaption(hashtags): 25 | num = random.randint(0,99) 26 | f = open(f"{path}/config/captions.txt", encoding="utf8") 27 | content = f.readlines() 28 | caption = content[num] + hashtags 29 | f.close() 30 | return caption 31 | 32 | 33 | def postimg(imgpath, caption): 34 | print("Posting with caption: " + caption) 35 | cl.photo_upload( 36 | imgpath, 37 | caption, 38 | location=Location(name='Singapore', lat=1.351880, lng =103.823339) 39 | ) 40 | 41 | def storyimg(imgpath, caption): 42 | print("Uploading Story") 43 | cl.photo_upload_to_story(imgpath, caption) 44 | 45 | 46 | def auto(hashtags, algo, confirm): 47 | prev = 1 48 | while (os.path.exists(f"{path}/output/{prev}.jpg")): 49 | prev+=1 50 | latest = prev - 1 51 | imgpath = f"{path}/output/{latest}.jpg" 52 | caption = getcaption(hashtags) 53 | 54 | #gain confirmation 55 | if int(confirm) == 0: 56 | print(f"Upload {latest}.jpg with caption: {caption} ? ") 57 | confirmation = input("[y/n]:") 58 | if (confirmation == "y" or confirmation == "Y"): 59 | postimg(imgpath, caption) 60 | if int(algo) == 0: 61 | f4f() 62 | else: 63 | quit() 64 | else: 65 | postimg(imgpath, caption) 66 | if int(algo) == 0: 67 | f4f() 68 | 69 | 70 | 71 | 72 | def main(): 73 | f = open(f"{path}/config/igsettings.txt", "r") 74 | username, password, hashtags, algo, confirm = f.read().splitlines() 75 | f.close() 76 | 77 | print(f"Logging in to @{username}") 78 | cl.login(username, password) 79 | auto(hashtags, algo, confirm) 80 | 81 | 82 | if __name__ == "__main__": 83 | main() 84 | 85 | 86 | 87 | 88 | 89 | 90 | -------------------------------------------------------------------------------- /config/captions.txt: -------------------------------------------------------------------------------- 1 | Embracing the chaos and finding beauty within. 🌪️✨ 2 | Lost in wanderlust, found in adventure. 🗺️✈️ 3 | Always take the scenic route. 🛤️🌄 4 | Serenity in simplicity. 🌿💫 5 | Creating my own sunshine on cloudy days. ☀️☁️ 6 | Dream big, sparkle more. ✨✨ 7 | Just another daydreamer with wanderlust. 🌌🌍 8 | Coffee in one hand, confidence in the other. ☕💃 9 | Dancing through life, one step at a time. 💫👣 10 | In a romance with the universe. 💖🌌 11 | Life's a canvas, make it colorful! 🎨🌈 12 | Finding joy in the journey, not just the destination. 🚗🌟 13 | Living life with a smile as my compass. 😊🌸 14 | Never fully dressed without a smile. 😄👗 15 | Sunshine mixed with a little hurricane. 🌪️☀️ 16 | Wander often, wonder always. 🌍✨ 17 | Making memories around the world. 🌏📸 18 | Being both soft and strong is a superpower. 💪🌸 19 | Chasing sunsets and dreams. 🌅💭 20 | Spreading kindness like confetti. 🎉💖 21 | Collecting moments, not things. 📸🌟 22 | Living my story, one adventure at a time. 📖✨ 23 | Radiating good vibes and positivity. 🌟☮️ 24 | Embracing my perfectly imperfect self. 🌺🌟 25 | Adventure awaits where the WiFi is weak. 🌐🌿 26 | Laughing at life's beautiful chaos. 😄🌼 27 | Sippin' on sunshine and good vibes. ☀️✌️ 28 | Life is short, make it sweet. 🍭💫 29 | Lost in the right direction. 🌟🌿 30 | Born to stand out in a world full of copycats. 🌟🦄 31 | Sparkle like you mean it. ✨💖 32 | Finding magic in the mundane. ✨🌟 33 | Living for the moments that take your breath away. 🌈🌬️ 34 | Adventure is calling, gotta go! 📞🌍 35 | Celebrating the art of being me. 🎨🌟 36 | Making every moment count. ⏳💫 37 | Dancing through life's ups and downs. 💃🎢 38 | Radiating positivity like it's going out of style. ✌️☀️ 39 | Being extra with a side of fabulous. 💁🌟 40 | Life's too short to not eat dessert first. 🍰🍭 41 | Dreaming in colors borrowed from the sea. 🌊🎨 42 | Living life with no regrets, just lessons learned. 📚🌟 43 | Finding joy in the ordinary. 🌼💫 44 | Fearless and fabulous. 💃🌟 45 | Living my best life one adventure at a time. 🌟🌍 46 | Embracing my wild and free spirit. 🌿🦋 47 | Choosing happiness every single day. 😊💫 48 | Spreading love, light, and good vibes. 💖☀️ 49 | Adventure begins where plans end. 🗺️🌟 50 | Glitter runs through my veins. ✨💖 51 | Finding my own kind of beautiful. 🌸✨ 52 | Making memories that will last a lifetime. 📸🌟 53 | Exploring the world one adventure at a time. 🗺️✈️ 54 | Chasing sunsets and dreams. 🌅💫 55 | Life's a journey, not a race. 🏃♀️🌟 56 | Dreaming big, living bigger. 💭🌟 57 | Sprinkling kindness like confetti. 🎉💖 58 | Embracing the messiness of life. 🌪️🌸 59 | Living on caffeine and wanderlust. ☕✈️ 60 | Spreading positivity like wildfire. 🔥✨ 61 | Happiness looks gorgeous on me. 😊🌟 62 | Finding joy in the little things. 🌼💫 63 | Adventure is out there, and I'm chasing it! 🌟🌍 64 | Making moments matter. 🌟📸 65 | Life's too short to wear boring clothes. 👗🌟 66 | Collecting sunsets and memories. 🌅📸 67 | Embracing my perfectly imperfect self. 💖🌟 68 | Sparkling my way through life. ✨💫 69 | Adventure is my soul's best friend. 🌟🧭 70 | Living my story, one chapter at a time. 📖✨ 71 | All about that positive vibe tribe. ✌️🌟 72 | Life's a party, dress like it! 🎉👗 73 | Dreaming of endless adventures. 💭🌟 74 | Chasing dreams and sunbeams. ☀️💫 75 | Striving for progress, not perfection. 🌟📈 76 | Making waves and riding high. 🌊🏄♀️ 77 | Radiating good vibes only. ✨☮️ 78 | Capturing moments and creating memories. 📸🌟 79 | Born to stand out in a world of followers. 🌟🌍 80 | Living my best life, one smile at a time. 😄🌟 81 | Wild heart, free spirit. 🌿🌟 82 | Spreading sunshine wherever I go. ☀️🌟 83 | Adventure is calling, gotta answer! 📞🌟 84 | Embracing the beauty of imperfection. 🌺✨ 85 | Life's a journey, enjoy the ride! 🚗🌟 86 | Living on sunshine and good vibes. ☀️💫 87 | Making memories in every moment. 🌟📸 88 | Loving fiercely and living fearlessly. 💖🌟 89 | Dancing through life's adventures. 💃🌟 90 | Living each day like it's my favorite. 🌟📆 91 | Finding joy in the everyday chaos. 🌪️🌟 92 | Spreading love, light, and laughter. 💖✨ 93 | Embracing my inner spark. 🌟🔥 94 | Adventure is out there, and I'm ready! 🌟🌍 95 | Making life a beautiful adventure. 🌟🌸 96 | Dreaming big and making it happen. 💭🌟 97 | In love with the magic of simple moments. ✨🌟 98 | Creating a life I love, one day at a time. 🌟💖 99 | Living life, one adventure after another. 🌟🌍 100 | Finding magic in every moment. ✨🌟 -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | import pathlib 2 | import psutil 3 | import torch 4 | 5 | class bcolors: 6 | HEADER = '\033[95m' 7 | ENDC = '\033[0m' 8 | BOLD = '\033[1m' 9 | 10 | 11 | path = pathlib.Path(__file__).parent.resolve() 12 | 13 | def igsaveconfig(username, password, hashtag, algo, confirm): 14 | f = open(f"{path}/config/igsettings.txt", "w") 15 | f.writelines(f"{username}\n{password}\n{hashtag}\n{algo}\n{confirm}") 16 | f.close() 17 | igconfig() 18 | 19 | def iginfo(hashtag, algo, confirm): 20 | username = input("Instagram username (without the @): ") 21 | password = input("Password: ") 22 | igsaveconfig(username,password,hashtag,algo,confirm) 23 | igconfig() 24 | 25 | def ighashtag(username,password,confirm): 26 | print("\nInput wanted hashtags in captions (eg.'#like4like #follow4follwow'). Leave blank if no hashtags are needed") 27 | hashtag = input("hashtags: ") 28 | yesno = input("Enable increase followers algorithm? [Y/N]: ") 29 | if yesno.lower == 'y': 30 | algo = 0 31 | else: 32 | algo = 1 33 | 34 | igsaveconfig(username,password,hashtag,algo,confirm) 35 | igconfig() 36 | 37 | def igconfirm(username, password,hashtag,algo): 38 | 39 | choice = input("Require confirmation before posting? [Y/N]:") 40 | if choice.lower() == 'y': 41 | confirm = 0 42 | else: 43 | confirm =1 44 | 45 | igsaveconfig(username,password,hashtag,algo,confirm) 46 | igconfig() 47 | 48 | 49 | def igconfig(): 50 | 51 | f = open(f"{path}/config/igsettings.txt", "r") 52 | username, password, hashtag, algo, confirm = f.read().splitlines() 53 | f.close() 54 | 55 | print(f"{bcolors.BOLD}\nMenu{bcolors.ENDC} \n1.) Input / change login info \n2.) Hashtags settings \n3.) Confirmation before posting \n4.) Quit") 56 | 57 | choice = input("Enter 1, 2, 3 or 4: ") 58 | if choice == "1": 59 | iginfo(hashtag,algo,confirm) 60 | if choice == "2": 61 | ighashtag(username, password,confirm) 62 | if choice == "3": 63 | igconfirm(username, password,hashtag,algo) 64 | if choice == "4": 65 | quit() 66 | 67 | 68 | def recommended(): 69 | ram = (round(psutil.virtual_memory().total / (1024.0 **3))) 70 | 71 | if torch.cuda.is_available(): 72 | # Get the total GPU memory 73 | total_memory = torch.cuda.get_device_properties(0).total_memory 74 | vrammb = total_memory / (1024 ** 2) 75 | vram = round(vrammb/(1000)) 76 | else: 77 | vram = 0 78 | 79 | print(f"You have {ram} GB of ram and {vram} GB of VRAM") 80 | 81 | if ram<=4 and vram <=2: 82 | print(f"{bcolors.BOLD}Low Tier PC config recommended{bcolors.ENDC}") 83 | elif ram >6 and vram >=10: 84 | print(f"{bcolors.BOLD}High Tier PC config recommended{bcolors.ENDC}") 85 | else: 86 | print (f"{bcolors.BOLD}Mid Tier PC config recommended{bcolors.ENDC}") 87 | 88 | 89 | def saveconfig(model,steps): 90 | # for auto prompt 91 | autoprompt = input("Enable auto prompt generation? [Y/N]:") 92 | if (autoprompt.lower() == 'y'): 93 | autoprompt = 0 94 | else: 95 | autoprompt = 1 96 | 97 | 98 | enablebotchoice = input("Link Instagram bot to image generator? [Y/N]:") 99 | if (enablebotchoice.lower() == 'y'): 100 | enablebot = 0 101 | else: 102 | enablebot = 1 103 | 104 | 105 | f = open(f"{path}/config/aisettings.txt", "w") 106 | f.writelines(f"{model} \n{steps} \n{autoprompt} \n{enablebot}") 107 | f.close() 108 | print(f"{bcolors.HEADER}Settings saved.{bcolors.ENDC}") 109 | 110 | if enablebot == 0: 111 | print(f"{bcolors.HEADER}Instagram Bot Config.{bcolors.ENDC}") 112 | igconfig() 113 | 114 | quit() 115 | 116 | 117 | def aiconfig(): 118 | print("Select configuration \n1.) Low Tier PC config \n2.) Mid Tier PC config \n3.) High Tier PC config \n4.) Custom") 119 | config = input("Enter 1, 2, 3 or 4: ") 120 | 121 | if config == "1": 122 | saveconfig(1,30) 123 | if config == "2": 124 | saveconfig(2,60) 125 | if config == "3": 126 | saveconfig(2,100) 127 | 128 | print(f"{bcolors.HEADER}\nCustom Config Setup{bcolors.ENDC}") 129 | 130 | print("Choose Stable Diffusion model: \n1.) SD v1-5 (Realistic Vision v6) \n2.) SDXL v 1.0 (SDXL Yamer's Realistic)") 131 | model = input("Enter 1 or 2: ") 132 | print(f"More inference steps leads to higher RAM/VRAM usage but better generated image quality. {bcolors.BOLD}We recommend any in the range of 30 to 100{bcolors.ENDC}") 133 | steps = input("Input number of inference steps: ") 134 | saveconfig(model, steps) 135 | 136 | 137 | def main(): 138 | print(f"{bcolors.HEADER}AI INFLUENCER SETUP{bcolors.ENDC}") 139 | print("") 140 | recommended() 141 | aiconfig() 142 | 143 | 144 | 145 | 146 | if __name__ == "__main__": 147 | main() -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | # AI Influencer 3 | The purpose of this project is to create an AI Instagram influencer by automating both the generation of AI Instagram worthy images and the management of an Instagram account. See [Claire Reety](#claire) for example of implementation. The repository consists of 2 parts: [AI image generation](#generating-ai-images) and [Instagram bot](#instagram-bot). AI Influencer also comes with a low spec mode to enable lower tier PCs to run the project. However, this comes with the cost of lower quality images. 4 | Note: AI image generation can work independently from the Instagram handler bot if the user chooses not to upload to Instagram. 5 | 6 | ## Generating AI images 7 | ### Introduction 8 | This part of the project is mainly powered by Diffusers from [huggingface](https://huggingface.co/docs/diffusers/index). To generate consistent facial features, this project utilizes trained image generating models and LORA weights. It's primarily optimized for generating Claire's distinctive features. However, it's adaptable for those with their own trained models to use. All generated images are saved in the "outputs" folder. 9 | Note: Intial run will take significantly longer due to the initial download of stable diffusion. Expect subsequent run times to be faster. 10 | 11 |
67 | Give Claire Reety a follow on Instagram! Click on the image below! 68 |
69 |
70 |
71 |