@blinkdotnew/sdk 0.19.0 → 0.19.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +44 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -146,7 +146,7 @@ This SDK powers every Blink-generated app with:
|
|
|
146
146
|
|
|
147
147
|
- **🔐 Authentication**: Flexible auth system with managed (redirect) and headless (custom UI) modes, email/password, social providers (Google, GitHub, Apple, Microsoft), magic links, RBAC, and custom email branding
|
|
148
148
|
- **🗄️ Database**: PostgREST-compatible CRUD operations with advanced filtering
|
|
149
|
-
- **🤖 AI**:
|
|
149
|
+
- **🤖 AI**: Multi-model image generation & editing (10 models), text generation with web search, object generation, speech synthesis, and transcription
|
|
150
150
|
- **📄 Data**: Extract text content from documents, secure API proxy with secret substitution, web scraping, screenshots, and web search
|
|
151
151
|
- **📁 Storage**: File upload, download, and management
|
|
152
152
|
- **📧 Notifications**: Email sending with attachments, custom branding, and delivery tracking
|
|
@@ -708,29 +708,56 @@ const { object: todoList } = await blink.ai.generateObject({
|
|
|
708
708
|
// })
|
|
709
709
|
// Error: "schema must be a JSON Schema of 'type: \"object\"', got 'type: \"array\"'"
|
|
710
710
|
|
|
711
|
-
// Generate and modify images with AI
|
|
712
|
-
// 🔥
|
|
711
|
+
// Generate and modify images with AI - Multi-Model Support (10 models available)
|
|
712
|
+
// 🔥 Choose between fast generation or high-quality results
|
|
713
713
|
// 🎨 For style transfer: provide ALL images in the images array, don't reference URLs in prompts
|
|
714
714
|
|
|
715
|
-
// Basic image generation
|
|
715
|
+
// Basic image generation (uses default fast model: fal-ai/nano-banana)
|
|
716
716
|
const { data } = await blink.ai.generateImage({
|
|
717
717
|
prompt: 'A serene landscape with mountains and a lake at sunset'
|
|
718
718
|
})
|
|
719
719
|
console.log('Image URL:', data[0].url)
|
|
720
720
|
|
|
721
|
-
//
|
|
721
|
+
// High-quality generation with Pro model
|
|
722
|
+
const { data: proImage } = await blink.ai.generateImage({
|
|
723
|
+
prompt: 'A detailed infographic about AI with charts and diagrams',
|
|
724
|
+
model: 'fal-ai/nano-banana-pro', // High quality model
|
|
725
|
+
n: 1,
|
|
726
|
+
size: '1792x1024' // Custom size
|
|
727
|
+
})
|
|
728
|
+
|
|
729
|
+
// Generate multiple variations
|
|
722
730
|
const { data } = await blink.ai.generateImage({
|
|
723
731
|
prompt: 'A futuristic robot in different poses',
|
|
732
|
+
model: 'fal-ai/nano-banana', // Fast model
|
|
724
733
|
n: 3
|
|
725
734
|
})
|
|
726
735
|
data.forEach((img, i) => console.log(`Image ${i+1}:`, img.url))
|
|
727
736
|
|
|
728
|
-
|
|
737
|
+
**Available Models for Text-to-Image:**
|
|
738
|
+
|
|
739
|
+
| Model | Speed | Quality | Best For |
|
|
740
|
+
|-------|-------|---------|----------|
|
|
741
|
+
| `fal-ai/nano-banana` (default) | ⚡ Fast | Good | Prototypes, high-volume generation |
|
|
742
|
+
| `fal-ai/nano-banana-pro` | Standard | ⭐ Excellent | Marketing materials, high-fidelity visuals |
|
|
743
|
+
| `fal-ai/gemini-25-flash-image` | ⚡ Fast | Good | Alias for `nano-banana` |
|
|
744
|
+
| `fal-ai/gemini-3-pro-image-preview` | Standard | ⭐ Excellent | Alias for `nano-banana-pro` |
|
|
745
|
+
| `gemini-2.5-flash-image-preview` | ⚡ Fast | Good | Legacy - Direct Gemini API |
|
|
746
|
+
| `gemini-3-pro-image-preview` | Standard | ⭐ Excellent | Legacy - Direct Gemini API |
|
|
747
|
+
|
|
748
|
+
// Image editing - transform existing images with prompts (uses default fast model)
|
|
729
749
|
const { data: headshots } = await blink.ai.modifyImage({
|
|
730
|
-
images: ['https://storage.example.com/user-photo.jpg'], // Up to
|
|
750
|
+
images: ['https://storage.example.com/user-photo.jpg'], // Up to 16 images supported!
|
|
731
751
|
prompt: 'Transform into professional business headshot with studio lighting'
|
|
732
752
|
})
|
|
733
753
|
|
|
754
|
+
// High-quality editing with Pro model
|
|
755
|
+
const { data: proEdited } = await blink.ai.modifyImage({
|
|
756
|
+
images: ['https://storage.example.com/portrait.jpg'],
|
|
757
|
+
prompt: 'Add a majestic ancient tree in the background with glowing leaves',
|
|
758
|
+
model: 'fal-ai/nano-banana-pro/edit' // High quality editing
|
|
759
|
+
})
|
|
760
|
+
|
|
734
761
|
// Advanced image editing with multiple input images
|
|
735
762
|
const { data } = await blink.ai.modifyImage({
|
|
736
763
|
images: [
|
|
@@ -739,9 +766,19 @@ const { data } = await blink.ai.modifyImage({
|
|
|
739
766
|
'https://storage.example.com/photo3.jpg'
|
|
740
767
|
],
|
|
741
768
|
prompt: 'Combine these architectural styles into a futuristic building design',
|
|
769
|
+
model: 'fal-ai/nano-banana/edit', // Fast editing
|
|
742
770
|
n: 2
|
|
743
771
|
})
|
|
744
772
|
|
|
773
|
+
**Available Models for Image Editing:**
|
|
774
|
+
|
|
775
|
+
| Model | Speed | Quality | Best For |
|
|
776
|
+
|-------|-------|---------|----------|
|
|
777
|
+
| `fal-ai/nano-banana/edit` (default) | ⚡ Fast | Good | Quick adjustments, style transfers |
|
|
778
|
+
| `fal-ai/nano-banana-pro/edit` | Standard | ⭐ Excellent | Detailed retouching, complex edits |
|
|
779
|
+
| `fal-ai/gemini-25-flash-image/edit` | ⚡ Fast | Good | Alias for `nano-banana/edit` |
|
|
780
|
+
| `fal-ai/gemini-3-pro-image-preview/edit` | Standard | ⭐ Excellent | Alias for `nano-banana-pro/edit` |
|
|
781
|
+
|
|
745
782
|
// 🎨 Style Transfer & Feature Application
|
|
746
783
|
// ⚠️ IMPORTANT: When applying styles/features from one image to another,
|
|
747
784
|
// provide ALL images in the array - don't reference images in the prompt text
|
package/package.json
CHANGED