Convert Figma logo to code with AI

betomoedano logosnapai

AI-powered icon generation CLI for React Native & Expo developers. Generate stunning app icons in seconds using OpenAI's latest models.

1,537
90
1,537
2

Top Related Projects

96,496

Robust Speech Recognition via Large-Scale Weak Supervision

Port of OpenAI's Whisper model in C/C++

10,048

High-performance GPGPU inference of OpenAI's Whisper automatic speech recognition (ASR) model

19,575

WhisperX: Automatic Speech Recognition with Word-level Timestamps (& Diarization)

Faster Whisper transcription with CTranslate2

Quick Overview

SnapAI is a mobile application built with React Native that integrates OpenAI's GPT-3.5 model to provide AI-powered image and text generation capabilities. The app allows users to create images from text prompts and engage in conversations with an AI assistant, showcasing the potential of AI in mobile applications.

Pros

  • Demonstrates practical implementation of AI in a mobile app
  • Uses React Native for cross-platform development
  • Integrates popular AI models (GPT-3.5 and DALL-E) for diverse functionalities
  • Clean and modern user interface

Cons

  • Requires API key management, which could be a security concern
  • Limited to specific AI models (OpenAI's offerings)
  • May have high API usage costs for frequent users
  • Potential for misuse of AI-generated content

Code Examples

  1. Setting up the OpenAI API client:
import { Configuration, OpenAIApi } from "openai";

const configuration = new Configuration({
  apiKey: process.env.OPENAI_API_KEY,
});
const openai = new OpenAIApi(configuration);
  1. Generating an image using DALL-E:
const generateImage = async (prompt) => {
  try {
    const response = await openai.createImage({
      prompt: prompt,
      n: 1,
      size: "512x512",
    });
    return response.data.data[0].url;
  } catch (error) {
    console.error("Error generating image:", error);
    return null;
  }
};
  1. Sending a message to the GPT-3.5 model:
const sendMessage = async (message) => {
  try {
    const response = await openai.createChatCompletion({
      model: "gpt-3.5-turbo",
      messages: [{ role: "user", content: message }],
    });
    return response.data.choices[0].message.content;
  } catch (error) {
    console.error("Error sending message:", error);
    return null;
  }
};

Getting Started

To get started with SnapAI:

  1. Clone the repository:

    git clone https://github.com/betomoedano/snapai.git
    
  2. Install dependencies:

    cd snapai
    npm install
    
  3. Set up your OpenAI API key in a .env file:

    OPENAI_API_KEY=your_api_key_here
    
  4. Run the app:

    npx expo start
    
  5. Use an emulator or scan the QR code with the Expo Go app on your mobile device to run the application.

Competitor Comparisons

96,496

Robust Speech Recognition via Large-Scale Weak Supervision

Pros of Whisper

  • More comprehensive and advanced speech recognition capabilities
  • Supports multiple languages and accents
  • Backed by OpenAI's extensive research and development resources

Cons of Whisper

  • Requires more computational resources and processing power
  • May be more complex to implement and integrate into projects
  • Potentially higher latency for real-time applications

Code Comparison

Whisper:

import whisper

model = whisper.load_model("base")
result = model.transcribe("audio.mp3")
print(result["text"])

SnapAI:

import { Audio } from 'expo-av';
import { useEffect, useState } from 'react';

const [recording, setRecording] = useState();
const [recordings, setRecordings] = useState([]);

The code snippets demonstrate the different approaches and languages used in each project. Whisper focuses on direct speech recognition, while SnapAI appears to be more oriented towards audio recording and management in a mobile app context.

Port of OpenAI's Whisper model in C/C++

Pros of whisper.cpp

  • Highly optimized C++ implementation for efficient speech recognition
  • Supports various model sizes and quantization options for performance tuning
  • Cross-platform compatibility (Windows, macOS, Linux, iOS, Android)

Cons of whisper.cpp

  • Focused solely on speech recognition, lacking additional AI features
  • Requires more technical expertise to set up and use effectively
  • Limited to command-line interface, no built-in GUI

Code Comparison

whisper.cpp:

#include "whisper.h"

int main(int argc, char ** argv) {
    struct whisper_context * ctx = whisper_init_from_file("ggml-base.en.bin");
    whisper_full_default(ctx, wparams, pcmf32.data(), pcmf32.size());
    whisper_print_timings(ctx);
    whisper_free(ctx);
}

snapai:

import React from 'react';
import { View, Text } from 'react-native';
import { Camera } from 'expo-camera';

const SnapAI = () => {
  // Component implementation
};

Summary

whisper.cpp is a specialized, high-performance speech recognition library, while snapai appears to be a React Native-based mobile application with AI capabilities. whisper.cpp offers better performance and cross-platform support for speech recognition tasks, but requires more technical knowledge. snapai likely provides a more user-friendly interface and broader AI features, but may not match whisper.cpp's speech recognition performance.

10,048

High-performance GPGPU inference of OpenAI's Whisper automatic speech recognition (ASR) model

Pros of Whisper

  • Optimized for performance with CUDA acceleration
  • Supports multiple languages for transcription
  • Provides a C++ API for integration into other applications

Cons of Whisper

  • More complex setup and dependencies
  • Limited to speech-to-text functionality
  • Requires more technical knowledge to use effectively

Code Comparison

Whisper (C++):

#include <whisper.h>

whisper_context * ctx = whisper_init_from_file("ggml-base.en.bin");
whisper_full_params params = whisper_full_default_params(WHISPER_SAMPLING_GREEDY);
whisper_full(ctx, params, pcmf32.data(), pcmf32.size(), false);

SnapAI (JavaScript):

import { Configuration, OpenAIApi } from "openai";

const configuration = new Configuration({ apiKey: process.env.OPENAI_API_KEY });
const openai = new OpenAIApi(configuration);
const response = await openai.createCompletion({ model: "text-davinci-003", prompt: userInput });

Summary

Whisper focuses on efficient speech-to-text transcription with multi-language support, while SnapAI provides a more user-friendly interface for general AI interactions using OpenAI's API. Whisper offers better performance for specific audio processing tasks, but SnapAI is more versatile for various AI applications and easier to integrate into web-based projects.

19,575

WhisperX: Automatic Speech Recognition with Word-level Timestamps (& Diarization)

Pros of WhisperX

  • More advanced speech recognition capabilities, including speaker diarization
  • Supports multiple languages and can handle longer audio files
  • Actively maintained with frequent updates and improvements

Cons of WhisperX

  • More complex setup and usage compared to SnapAI
  • Requires more computational resources due to its advanced features
  • May be overkill for simple transcription tasks

Code Comparison

WhisperX:

import whisperx

model = whisperx.load_model("large-v2")
result = model.transcribe("audio.mp3")
print(result["text"])

SnapAI:

from snapai import SnapAI

snap = SnapAI()
transcript = snap.transcribe("audio.mp3")
print(transcript)

WhisperX offers more advanced features and flexibility, while SnapAI provides a simpler, more straightforward approach to transcription. WhisperX is better suited for complex audio processing tasks, whereas SnapAI is ideal for quick and easy transcriptions without additional features.

Faster Whisper transcription with CTranslate2

Pros of faster-whisper

  • Optimized for speed, offering faster transcription than the original Whisper model
  • Supports multiple languages and can perform language detection
  • Provides flexible API for various use cases, including streaming audio

Cons of faster-whisper

  • Focused solely on speech recognition, lacking image processing capabilities
  • Requires more setup and dependencies compared to SnapAI's simpler implementation
  • May have higher computational requirements for optimal performance

Code Comparison

faster-whisper:

from faster_whisper import WhisperModel

model = WhisperModel("large-v2", device="cuda", compute_type="float16")
segments, info = model.transcribe("audio.mp3", beam_size=5)

for segment in segments:
    print("[%.2fs -> %.2fs] %s" % (segment.start, segment.end, segment.text))

SnapAI:

import openai

openai.api_key = "your-api-key"
audio_file = open("audio.mp3", "rb")
transcript = openai.Audio.transcribe("whisper-1", audio_file)

print(transcript.text)

The code comparison shows that faster-whisper provides more granular control over the transcription process, including segment-level output. SnapAI, on the other hand, offers a simpler interface using the OpenAI API, which may be easier for beginners but less flexible for advanced use cases.

Pros of insanely-fast-whisper

  • Focuses specifically on optimizing Whisper for faster transcription
  • Provides detailed benchmarks and performance comparisons
  • Offers multiple optimization techniques like batching and quantization

Cons of insanely-fast-whisper

  • Limited to audio transcription functionality
  • Requires more technical setup and configuration
  • Less user-friendly for non-technical users

Code Comparison

snapai:

from snapai import SnapAI

snap = SnapAI()
response = snap.chat("What is the capital of France?")
print(response)

insanely-fast-whisper:

from faster_whisper import WhisperModel

model = WhisperModel("large-v2", device="cuda", compute_type="float16")
segments, info = model.transcribe("audio.mp3", beam_size=5)

for segment in segments:
    print("[%.2fs -> %.2fs] %s" % (segment.start, segment.end, segment.text))

The code snippets highlight the different focus areas of the two projects. snapai provides a simple interface for general AI interactions, while insanely-fast-whisper offers more specialized audio transcription functionality with various optimization options.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

SnapAI

SnapAI

Generate high-quality square app icon artwork from the terminal — built for React Native and Expo.

SnapAI is a developer-friendly CLI that talks directly to:

  • OpenAI Images (gpt-1.5 → gpt-image-1.5, gpt-1 → gpt-image-1)
  • Google Nano Banana (Gemini image models) — selected via --model banana

The workflow is intentionally square-only: always 1024x1024 (1:1) to match iOS/Android icon needs and avoid resizing headaches.

Features ✨

  • Fast: generate icons in seconds. No UI. No accounts.
  • Latest image models:
    • OpenAI:
      • gpt-1.5 (uses gpt-image-1.5 under the hood)
      • gpt-1 (uses gpt-image-1 under the hood)
    • Google Nano Banana (Gemini):
      • normal: gemini-2.5-flash-image
      • pro: gemini-3-pro-image-preview
  • iOS + Android oriented: prompt enhancement tuned for app-icon style outputs.
  • Quality controls:
    • OpenAI: --quality auto|high|medium|low (aliases: hd → high, standard → medium)
    • Nano Banana Pro: --quality 1k|2k|4k
  • DX-friendly: just a CLI (great for CI/CD too).
  • Privacy-first: no telemetry, no tracking. Uses your API keys and sends requests directly to the provider you choose.

Video tutorial 🎥

Watch on YouTube

Read: Introducing Code With Beto Skills

Install 📦

# Recommended (no install)
npx snapai --help

# Or install globally
npm install -g snapai

Important 🔑
You need at least one API key:

  • OpenAI (for gpt-1.5 → gpt-image-1.5, gpt-1 → gpt-image-1)
  • Google AI Studio (for Google Nano Banana / Gemini via --model banana)

SnapAI is CLI-only and sends requests directly to the provider you select.

Quickstart (first icon) ⚡

npx snapai icon --prompt "minimalist weather app with sun and cloud"

Output defaults to ./assets (timestamped filenames).

Note 📝
Models can still draw the subject with visual padding (an empty border). This is normal.
SnapAI avoids forcing the words "icon" / "logo" by default to reduce padding.
If you want more “icon-y” framing, opt in with --use-icon-words.

Providers & models (what “banana” means) 🧠

SnapAI exposes providers via --model:

ProviderSnapAI flagUnderlying modelNotes
OpenAI (latest)--model gpt-1.5gpt-image-1.5Always 1:1 square 1024x1024, background/output controls
OpenAI (previous)--model gpt-1gpt-image-1Same controls as above
Google Nano Banana (normal)--model bananagemini-2.5-flash-imageAlways 1 image, square output
Google Nano Banana (pro)--model banana --progemini-3-pro-image-previewQuality tiers via --quality 1k/2k/4k, multiple via -n

Tip 💡
If you want multiple variations quickly, use OpenAI (-n) or Banana Pro (--pro -n ...).

Setup 🔐

You can store keys locally (developer machine), or provide them at runtime (CI/CD).

Local config (writes to ~/.snapai/config.json)

snapai config --openai-api-key "sk-your-openai-api-key"
snapai config --google-api-key "your-google-ai-studio-key"

snapai config --show

CI/CD secrets (recommended)

Use environment variables so nothing is written to disk:

export SNAPAI_API_KEY="sk-..."
export SNAPAI_GOOGLE_API_KEY="..."

# Also supported:
# export OPENAI_API_KEY="sk-..."
# export GEMINI_API_KEY="..."

GitHub Actions example:

- name: Generate app icon
  run: npx snapai icon --prompt "minimalist weather app with sun and cloud" --output ./assets/icons
  env:
    SNAPAI_API_KEY: ${{ secrets.SNAPAI_API_KEY }}

You can also pass keys per command (does not persist):

npx snapai icon --openai-api-key "sk-..." --prompt "modern app artwork"
npx snapai icon --model banana --google-api-key "..." --prompt "modern app artwork"

Usage 🚀

Common (recommended)

# Default (OpenAI)
npx snapai icon --prompt "modern fitness tracker with heart rate monitor"

# Output directory
npx snapai icon --prompt "professional banking app with secure lock" --output ./assets/icons

# Style hint (appended after enhancement)
npx snapai icon --prompt "calculator app" --style minimalism

# Preview the final generated prompt (no image generation)
npx snapai icon --prompt "calculator app" --raw-prompt --prompt-only
npx snapai icon --prompt "calculator app" --prompt-only
npx snapai icon --prompt "calculator app" --style minimalism --prompt-only

OpenAI (gpt-1.5 / gpt-1)

# Multiple variations
npx snapai icon --prompt "app icon concept" --model gpt-1.5 -n 3

# Higher quality
npx snapai icon --prompt "premium app icon" --quality high

# Transparent background + output format
npx snapai icon --prompt "logo mark" --background transparent --output-format png

Google Gemini (gemini-2.5-flash-image / gemini-3-pro-image-preview)

# Normal (1 image)
npx snapai icon --prompt "modern app artwork" --model banana

# Pro (multiple images + quality tiers)
npx snapai icon --prompt "modern app artwork" --model banana --pro --quality 2k -n 3

Nano Banana notes:

  • Normal mode always generates 1 image (no -n, no --quality tiers).
  • Pro mode supports multiple images (-n) and HD tiers (--quality 1k|2k|4k).
  • Output is always square.

Prompt tips (small changes, big impact) 📝

  • Describe the product first, then the style:
    • “a finance app, shield + checkmark, modern, clean gradients”
  • If you see too much empty border:
    • remove the words "icon" / "logo" (default behavior), or keep them off and be explicit about “fill the frame”
  • Use --style for rendering/material hints (examples: minimalism, material, pixel, kawaii, cute, glassy, neon)

Note 📝
If you pass --style, the style system is treated as a hard constraint and will take priority over other wording in your prompt.
Try to avoid prompts that conflict with the chosen style (e.g. --style minimalism + “neon glow”), or the model may produce inconsistent results.

Command reference 📚

snapai icon flags

FlagShortDefaultDescription
--prompt-prequiredDescription of the icon to generate
--output-o./assetsOutput directory
--model-mgpt-1.5gpt-1.5/gpt-1 (OpenAI) or banana (Google Nano Banana)
--quality-qautoGPT: auto/high/medium/low (aliases: hd, standard). Banana Pro: 1k/2k/4k
--background-bautoBackground (transparent, opaque, auto) (OpenAI only)
--output-format-fpngOutput format (png, jpeg, webp) (OpenAI only)
--n-n1Number of images (max 10). For Banana normal, must be 1.
--moderationautoContent filtering (low, auto) (OpenAI only)
--prompt-onlyfalsePreview final prompt + config without generating images
--raw-prompt-rfalseSend prompt as-is (no SnapAI enhancement/constraints). Style still applies if set
--style-sRendering style hint appended after enhancement
--use-icon-words-ifalseInclude "icon" / "logo" in enhancement (may increase padding)
--pro-PfalseEnable Nano Banana Pro (banana only)
--openai-api-key-kOpenAI API key override (does not persist)
--google-api-key-gGoogle API key override (does not persist)

Examples (real outputs) 🖼️

PromptResultCommand
minimalist weather app with sun and cloudWeather Iconnpx snapai icon --prompt "minimalist weather app with sun and cloud" --model gpt-1.5
premium banking app, shield + checkmark, clean gradientsBanking Iconnpx snapai icon --prompt "premium banking app, shield + checkmark, clean gradients" --model gpt-1.5
calendar app, simple date grid, clean illustrationCalendar Iconnpx snapai icon --prompt "calendar app, simple date grid, clean illustration" --model gpt-1
notes app, pen + paper, minimal, friendlyNotes Iconnpx snapai icon --prompt "notes app, pen + paper, minimal, friendly" --model gpt-1
music player app, abstract sound wave, clean shapesMusic Iconnpx snapai icon --prompt "music player app, abstract sound wave, clean shapes" --model banana
camera app, lens icon, simple concentric circlesCamera Iconnpx snapai icon --prompt "camera app, lens icon, simple concentric circles" --model banana
finance app, secure lock, clean illustration, bold silhouetteFinance Lock Iconnpx snapai icon --prompt "finance app, secure lock, clean illustration, bold silhouette" --model banana --pro
photo editor app, magic wand + spark, simple shapes, modern gradientsPhoto Editor Iconnpx snapai icon --prompt "photo editor app, magic wand + spark, simple shapes, modern gradients" --model banana --pro

Privacy & security 🔒

  • SnapAI does not ship telemetry or analytics.
  • SnapAI sends requests directly to OpenAI or Google (depending on --model).
  • SnapAI does not run a backend and does not collect your prompts/images.
  • API keys are stored locally only if you run snapai config ... (or provided at runtime via env vars/flags).

Warning ⚠️
Never commit API keys to git. Use environment variables in CI.

Development 🛠️

git clone https://github.com/betomoedano/snapai.git
cd snapai && pnpm install && pnpm run build
./bin/dev.js --help

Contributing 🤝

License 📄

MIT