Metadata-Version: 2.4
Name: ai-influencer
Version: 0.1.0
Summary: Create and manage AI-powered Instagram influencers programmatically
License: MIT
Project-URL: Homepage, https://github.com/yourusername/influencer-ai
Keywords: instagram,ai,influencer,automation,social-media
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Multimedia :: Video
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: requests>=2.31
Requires-Dist: cloudinary>=1.36
Requires-Dist: apscheduler>=3.10
Requires-Dist: python-dotenv>=1.0
Requires-Dist: pydantic>=2.0
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Requires-Dist: pytest-mock; extra == "dev"
Requires-Dist: responses; extra == "dev"
Requires-Dist: black; extra == "dev"
Requires-Dist: ruff; extra == "dev"

# ai-influencer

**Create and manage AI-powered Instagram influencers programmatically.**

```bash
pip install ai-influencer
```

## What it does

`ai-influencer` lets you spin up a fully automated AI Instagram influencer with a single Python file. Give it a persona (name, niche, reference photo) and it will:

- 🎨 **Generate images** of your influencer using Kie.ai (GPT Image 2) with reference-image consistency
- 🎬 **Generate Reels** via a two-step pipeline: scene image → Grok image-to-video (15s, 720p)
- 🖼️ **Generate carousels** where every slide looks visually consistent (same outfit, same setting)
- ✍️ **Write captions** via OpenRouter (on-brand, with hashtags)
- 📸 **Post to Instagram** automatically via the Meta Graph API
- ⏰ **Schedule posts** for a future date/time

---

## Quick start

```python
from influencer_ai import Influencer

# 1. Initialize (reads from .env automatically)
kai = Influencer()

# 2. Define the influencer's identity
kai.set_persona(
    name="Kai",
    gender="female",
    age=24,
    niche="fitness & lifestyle",
    tone="energetic and motivating",
    # Local file or HTTPS URL — auto-uploaded to Cloudinary
    sample_images=["path/to/reference_photo.jpg"],
)

# 3. Post a Reel (full AI pipeline)
kai.post_reel(
    prompt="Morning yoga on the beach at golden hour",
    caption="auto",
    hashtags=["#yoga", "#morningvibes"],
    improve_prompt=True,
    duration=15,
    resolution="720p",
)

# 4. Post an image
kai.post_image(
    prompt="Sitting in a cosy café, warm sunlight, candid smile",
    caption="auto",
)

# 5. Post a carousel (consistent theme across all slides)
kai.post_carousel(
    prompts=[
        "At the entrance of Taj Mahal at sunrise, excited, white salwar kameez",
        "Selfie with Taj Mahal in background, same white outfit",
        "Walking along the reflecting pool, golden hour, same outfit",
    ],
    caption="auto",
    hashtags=["#tajmahal", "#travel"],
)

# 6. Schedule a future post
kai.post_image(
    prompt="Sunset beach yoga",
    schedule="2025-12-01 07:00",
)
```

---

## Environment variables

Create a `.env` file in your project root:

```env
KIE_API_KEY=...
INSTAGRAM_ACCESS_TOKEN=...
INSTAGRAM_USER_ID=...
OPENROUTER_API_KEY=...        # optional — enables prompt enhancement & captions
CLOUDINARY_CLOUD_NAME=...
CLOUDINARY_API_KEY=...
CLOUDINARY_API_SECRET=...
```

Or pass them directly to `Influencer(kie_api_key=..., ...)`.

---

## How it works

```
prompt
  └─► OpenRouter (enhance_prompt)
        └─► Kie.ai GPT Image 2 (scene image with reference photos)
              └─► Kie.ai Grok image-to-video (15s, 720p)
                    └─► Cloudinary (permanent hosting)
                          └─► Meta Graph API (Instagram publish)
```

**Visual consistency**: The last 5 generated posts are automatically used as reference images for future generations, keeping your influencer's appearance consistent across content.

---

## Services required

| Service | Purpose | Free tier |
|---|---|---|
| [Kie.ai](https://kie.ai) | AI image & video generation | Credits-based |
| [Cloudinary](https://cloudinary.com) | Permanent media hosting | 25 GB free |
| [OpenRouter](https://openrouter.ai) | Caption & prompt enhancement | Pay per token |
| [Meta Graph API](https://developers.facebook.com/docs/instagram) | Instagram publishing | Free |

---

## License

MIT
