+
+
Create an Instagram post about our new summer collection
+
+
+
+
I'll create a beautiful post for your summer collection! Let me generate that for you...
+
+
+
+
+✨ Your Instagram post is ready!
+
+**Text Overlay:** "Summer Vibes Only"
+
+**Caption:** Embrace the warmth of the season with our stunning new summer collection. ☀️
+
+**Hashtags:** #SummerCollection #FashionVibes #SummerStyle #NewArrivals #SummerFashion #OOTD #StyleInspo
+
+**Image:** A vibrant beach scene with flowing summer dresses
+
+Would you like me to create more variations or adjust the style?
+
+
+
+
+
Yes, make 3 more with a minimal style for a carousel
+
+
+
+
+Perfect! I've created 3 additional cards with a minimal aesthetic:
+
+📸 **Card 1:** "Less is More" - Clean white background with single garment
+📸 **Card 2:** "Effortless Style" - Soft neutral tones
+📸 **Card 3:** "Simply Summer" - Minimal composition with plant accents
+
+All 4 images are now ready for your carousel post. The consistent minimal style will create a cohesive feed aesthetic.
+
+Shall I upload them to your drafts?
+
+
+
+
+## Implementation Details
+
+The CARD keyword performs the following steps:
+
+1. **Text Generation**: Uses LLM to create optimized overlay text based on the prompt
+2. **Image Generation**: Creates the base image using AI image generation
+3. **Style Application**: Applies color filters and effects based on the selected style
+4. **Text Overlay**: Adds the generated text with proper positioning and shadows
+5. **Social Content**: Generates relevant hashtags and a ready-to-use caption
+
+## Image Dimensions
+
+| Format | Dimensions | Use Case |
+|--------|------------|----------|
+| Square | 1080 × 1080 | Feed posts |
+| Portrait | 1080 × 1350 | Feed posts (more visibility) |
+| Story | 1080 × 1920 | Stories and Reels |
+| Landscape | 1080 × 566 | Link previews |
+
+## Best Practices
+
+1. **Be Specific with Image Prompts**: "golden retriever playing in autumn leaves" works better than just "dog"
+
+2. **Keep Text Prompts Thematic**: Focus on the message, not the exact words - the LLM will optimize
+
+3. **Match Style to Brand**: Use consistent styles across posts for brand recognition
+
+4. **Use Carousel for Stories**: Generate multiple related cards to create engaging carousel posts
+
+5. **Review Hashtags**: The generated hashtags are suggestions - customize for your audience
+
+## Error Handling
+
+```basic
+TRY
+ CARD "abstract art", "creativity unleashed", "vibrant" TO art_post
+
+ IF art_post.image_path = "" THEN
+ TALK "Image generation failed, please try again"
+ ELSE
+ TALK "Post created successfully!"
+ END IF
+CATCH error
+ TALK "Error creating card: " + error.message
+END TRY
+```
+
+## Related Keywords
+
+- [GENERATE IMAGE](./keyword-generate-image.md) - Generate images without text overlay
+- [UPLOAD](./keyword-upload.md) - Upload generated cards to storage
+- [POST TO SOCIAL](./keyword-post-to-social.md) - Publish directly to social media
+- [CREATE DRAFT](./keyword-create-draft.md) - Save as draft for review
+
+## See Also
+
+- [Social Media Keywords](./keywords-social-media.md)
+- [Image Processing](./keywords-image-processing.md)
\ No newline at end of file
diff --git a/src/basic/keywords/card.rs b/src/basic/keywords/card.rs
new file mode 100644
index 000000000..cd0af6862
--- /dev/null
+++ b/src/basic/keywords/card.rs
@@ -0,0 +1,601 @@
+//! CARD keyword - Creates beautiful Instagram-style posts from prompts
+//!
+//! Syntax:
+//! CARD image_prompt, text_prompt TO variable
+//! CARD image_prompt, text_prompt, style TO variable
+//! CARD image_prompt, text_prompt, style, count TO variable
+//!
+//! Examples:
+//! CARD "sunset over mountains", "inspirational quote about nature" TO post
+//! CARD "modern office", "productivity tips", "minimal" TO cards
+//! CARD "healthy food", "nutrition facts", "vibrant", 5 TO carousel
+
+use crate::basic::runtime::{BasicRuntime, BasicValue};
+use crate::llm::LLMProvider;
+use anyhow::{anyhow, Result};
+use image::{DynamicImage, ImageBuffer, Rgba, RgbaImage};
+use imageproc::drawing::{draw_text_mut, text_size};
+use rusttype::{Font, Scale};
+use serde::{Deserialize, Serialize};
+use std::sync::Arc;
+use tokio::sync::Mutex;
+
+/// Card style presets for Instagram posts
+#[derive(Debug, Clone, Serialize, Deserialize, Default)]
+pub enum CardStyle {
+ #[default]
+ Modern,
+ Minimal,
+ Vibrant,
+ Dark,
+ Light,
+ Gradient,
+ Polaroid,
+ Magazine,
+ Story,
+ Carousel,
+}
+
+impl From<&str> for CardStyle {
+ fn from(s: &str) -> Self {
+ match s.to_lowercase().as_str() {
+ "minimal" => CardStyle::Minimal,
+ "vibrant" => CardStyle::Vibrant,
+ "dark" => CardStyle::Dark,
+ "light" => CardStyle::Light,
+ "gradient" => CardStyle::Gradient,
+ "polaroid" => CardStyle::Polaroid,
+ "magazine" => CardStyle::Magazine,
+ "story" => CardStyle::Story,
+ "carousel" => CardStyle::Carousel,
+ _ => CardStyle::Modern,
+ }
+ }
+}
+
+/// Card dimensions for different formats
+#[derive(Debug, Clone, Copy)]
+pub struct CardDimensions {
+ pub width: u32,
+ pub height: u32,
+}
+
+impl CardDimensions {
+ pub const INSTAGRAM_SQUARE: Self = Self {
+ width: 1080,
+ height: 1080,
+ };
+ pub const INSTAGRAM_PORTRAIT: Self = Self {
+ width: 1080,
+ height: 1350,
+ };
+ pub const INSTAGRAM_STORY: Self = Self {
+ width: 1080,
+ height: 1920,
+ };
+ pub const INSTAGRAM_LANDSCAPE: Self = Self {
+ width: 1080,
+ height: 566,
+ };
+
+ pub fn for_style(style: &CardStyle) -> Self {
+ match style {
+ CardStyle::Story => Self::INSTAGRAM_STORY,
+ CardStyle::Carousel => Self::INSTAGRAM_SQUARE,
+ _ => Self::INSTAGRAM_SQUARE,
+ }
+ }
+}
+
+/// Text overlay configuration
+#[derive(Debug, Clone, Serialize, Deserialize)]
+pub struct TextOverlay {
+ pub text: String,
+ pub font_size: f32,
+ pub color: [u8; 4],
+ pub position: TextPosition,
+ pub max_width_ratio: f32,
+ pub shadow: bool,
+ pub background: Option<[u8; 4]>,
+}
+
+#[derive(Debug, Clone, Serialize, Deserialize, Default)]
+pub enum TextPosition {
+ Top,
+ #[default]
+ Center,
+ Bottom,
+ TopLeft,
+ TopRight,
+ BottomLeft,
+ BottomRight,
+}
+
+/// Generated card result
+#[derive(Debug, Clone, Serialize, Deserialize)]
+pub struct CardResult {
+ pub image_path: String,
+ pub image_url: Option