Skip to main content

ai-influencer

Create and manage AI-powered Instagram influencers programmatically.

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

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:

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 AI image & video generation Credits-based
Cloudinary Permanent media hosting 25 GB free
OpenRouter Caption & prompt enhancement Pay per token
Meta Graph API Instagram publishing Free

License

MIT

Metadata

Release files for ai-influencer 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ai-influencer 0.1.0
File Size Uploaded Provenance Actions
ai_influencer-0.1.0.tar.gz 17.1 kB Without provenance Details for ai_influencer-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ai-influencer 0.1.0
File Interpreter ABI Platform Actions
ai_influencer-0.1.0-py3-none-any.whl Python 3 none any Details for ai_influencer-0.1.0-py3-none-any.whl

Total release size: 40.3 kB

Release files / ai_influencer-0.1.0.tar.gz

Download URL ai_influencer-0.1.0.tar.gz
Size 17.1 kB
Tags Source
SHA-256 checksum
How to use checksums
c69bfdd5274c171c2335dca8430011136cd9d240ef789fd6a2c24acd27a2f441
BLAKE2b-256 checksum
How to use checksums
992eab9e35770846063a009f941bcfb8f6276433bbaccae0a7acf14d45c38cf8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.13

Release files / ai_influencer-0.1.0-py3-none-any.whl

Download URL ai_influencer-0.1.0-py3-none-any.whl
Size 23.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b040577ffa78e7bf5b11b2819d468e5d240c318dd49c1f03626f7cbcbb0125d1
BLAKE2b-256 checksum
How to use checksums
f57ec99b3ff031c27931e5ebbf7fef9b5509838f281dfc630ae2b332670829b9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.13

Security for ai-influencer 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page