Skip to content

elcriuz/cmf2mic

Repository files navigation

CMF2MIC

Christoph's Marvellous Fal to Miro Image Creator

A desktop application for generating AI images using fal.ai and uploading them directly to Miro boards.

CMF2MIC Screenshot

Features

  • AI Image Generation: Generate images using fal.ai models (Nano Banana Pro, GPT Image 1.5)
  • Direct Miro Upload: Images are automatically uploaded to your selected Miro board in a grid layout
  • Reference Images: Upload reference images for image-to-image generation
  • Batch Generation: Generate up to 20 images at once, processed in parallel batches
  • Job Queue: Run multiple generation jobs in parallel (max 3 concurrent)
  • Create Boards: Create new Miro boards directly from the app

Installation

Option 1: Download Pre-built App (macOS)

  1. Download CMF2MIC-macOS-arm64.zip from Releases
  2. Unzip and move CMF2MIC.app to Applications
  3. Right-click → Open (first time only, to bypass Gatekeeper)
  4. Configure your API keys in Settings

Option 2: Run from Source

# Clone the repository
git clone https://github.com/yourusername/cmf2mic.git
cd cmf2mic

# Create virtual environment
python3 -m venv venv
source venv/bin/activate

# Install dependencies
pip install -r requirements.txt

# Run the application
python app.py

Configuration

You need API keys to use CMF2MIC. Follow these step-by-step guides:


1. fal.ai API Key (Required)

fal.ai provides the AI image generation models.

  1. Go to fal.ai and click Sign Up (or log in)
  2. Navigate to Dashboard → Keys
  3. Click Create Key
  4. Copy the key (format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx:xxxxxxxx)
  5. Paste it in CMF2MIC Settings or your .env file

Pricing: ~$0.01-0.05 per image depending on model and resolution. New accounts get free credits.


2. Miro Access Token (Required)

Miro is where your generated images will be uploaded.

Step 1: Create a Miro Developer App

  1. Log in to Miro
  2. Go to Developer Portal → Your Apps
  3. Click Create new app
  4. Fill in:
    • App name: CMF2MIC (or any name you like)
    • Description: Optional
    • Team: Select your team
  5. Click Create app

Step 2: Configure Permissions

In your app settings, scroll to Permissions and enable:

  • boards:read - Read board data
  • boards:write - Create and modify board content

Click Save.

Step 3: Install the App & Get Token

  1. Scroll to Install app and get OAuth token
  2. Select your team from the dropdown
  3. Click Install app
  4. Copy the Access Token that appears
  5. Paste it in CMF2MIC Settings or your .env file

Note: The token starts with eyJ... and is quite long. Copy the entire string.


3. OpenAI API Key (Optional)

Only needed if you want to use the AI prompt optimization feature.

  1. Go to OpenAI Platform
  2. Sign up or log in
  3. Click Create new secret key
  4. Copy the key (starts with sk-...)
  5. Paste it in CMF2MIC Settings or your .env file

Entering Your Keys

Option A: Settings Dialog (Recommended)

  1. Open CMF2MIC
  2. Click the ⚙️ gear icon
  3. Paste your keys
  4. Click Save

Option B: Create a .env file

Create a file named .env in the project folder:

FAL_KEY=your-fal-api-key-here
MIRO_ACCESS_TOKEN=your-miro-token-here
OPENAI_API_KEY=your-openai-key-here

Security: Never share your .env file or commit it to git!

How It Works

┌─────────────────────────────────────────────────────────────────┐
│                         CMF2MIC                                 │
├─────────────────────────────────────────────────────────────────┤
│                                                                 │
│  1. Enter Prompt ──────────────────────────────────────────►    │
│     "A futuristic cityscape at sunset"                          │
│                                                                 │
│  2. (Optional) Add Reference Images ──────────────────────►    │
│     Upload local images for image-to-image generation           │
│                                                                 │
│  3. Configure Settings ───────────────────────────────────►    │
│     • Model: Nano Banana Pro / GPT Image 1.5                    │
│     • Aspect Ratio: 1:1, 16:9, 9:16, etc.                      │
│     • Resolution: 1K, 2K, 4K                                    │
│     • Number of images: 1-20                                    │
│                                                                 │
│  4. Select Miro Board ────────────────────────────────────►    │
│     Choose from your recent boards or create a new one          │
│                                                                 │
│  5. Click GENERATE ───────────────────────────────────────►    │
│                                                                 │
└─────────────────────────────────────────────────────────────────┘
                              │
                              ▼
┌─────────────────────────────────────────────────────────────────┐
│                      Job Processing                             │
├─────────────────────────────────────────────────────────────────┤
│                                                                 │
│  • Job added to queue (max 3 parallel jobs)                     │
│  • Reference images uploaded to fal.ai (if any)                 │
│  • Images generated in batches of 4                             │
│  • Each batch uploaded to Miro immediately                      │
│  • Progress shown in job card                                   │
│                                                                 │
└─────────────────────────────────────────────────────────────────┘
                              │
                              ▼
┌─────────────────────────────────────────────────────────────────┐
│                        Miro Board                               │
├─────────────────────────────────────────────────────────────────┤
│                                                                 │
│  ┌───┐ ┌───┐ ┌───┐ ┌───┐ ┌───┐ ┌───┐ ┌───┐ ┌───┐ ...          │
│  │ 1 │ │ 2 │ │ 3 │ │ 4 │ │ 5 │ │ 6 │ │ 7 │ │ 8 │               │
│  └───┘ └───┘ └───┘ └───┘ └───┘ └───┘ └───┘ └───┘               │
│  ┌───┐ ┌───┐ ┌───┐ ┌───┐                                        │
│  │ 9 │ │10 │ │11 │ │12 │  ...                                   │
│  └───┘ └───┘ └───┘ └───┘                                        │
│                                                                 │
│  Images placed in grid (12 columns, 550px spacing)              │
│                                                                 │
└─────────────────────────────────────────────────────────────────┘

Models

Model Best For Features
Nano Banana Pro Fast generation, creative prompts Resolution control (1K/2K/4K), image-to-image
GPT Image 1.5 High quality, precise prompts Quality control (low/medium/high), detailed output

Costs

  • fal.ai: ~$0.01-0.05 per image (varies by model and resolution)
  • Miro: Free tier allows 3 boards, unlimited with paid plans

Building from Source

# Activate virtual environment
source venv/bin/activate

# Build macOS app
pyinstaller CMF2MIC.spec --clean --noconfirm

# Output in dist/CMF2MIC.app

Project Structure

cmf2mic/
├── app.py              # Main GUI application (CustomTkinter)
├── generator.py        # fal.ai image generation
├── miro_upload.py      # Miro API integration
├── config.py           # API key configuration
├── prompt_optimizer.py # Optional GPT prompt enhancement
├── requirements.txt    # Python dependencies
├── CMF2MIC.spec       # PyInstaller build configuration
└── logo.png           # Application logo

License

MIT License - feel free to use and modify.

Acknowledgments

  • fal.ai for the image generation API
  • Miro for the collaboration platform API
  • CustomTkinter for the modern UI framework

About

Fal.ai to Miro image generator

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages