[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7BJRVE3KSCZYMT1GA7P6RCC":3,"skill-same:01M7BJRVE3KSCZYMT1GA7P6RCC":67},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":37,"commitSha":38,"skillDirectory":39,"forksCount":14,"repositoryHtmlUrl":40,"repositoryHomepageUrl":6,"ownerHtmlUrl":41,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":42,"install":43,"resources":56},"01M7BJRVE3KSCZYMT1GA7P6RCC","multimodal-blip-2",null,"Vision-language pre-training framework bridging frozen image encoders and LLMs. Use when you need image captioning, visual question answering, image-text retrieval, or multimodal chat with state-of-the-art zero-shot performance.","origin-labs-ai\u002Fcode","origin-labs-ai","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F347654492?v=4","01M7B0MAD1JMVZ6ME9891AYYYG","Origin","01M7B0MADP3AZS42R4NEF1JTS8",0,"MIT","https:\u002F\u002Fgithub.com\u002Forigin-labs-ai\u002Fcode\u002Fblob\u002Fmain\u002Fpayloads\u002Fskills\u002Fmultimodal-blip-2\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: multimodal-blip-2\ndescription: Vision-language pre-training framework bridging frozen image encoders and LLMs. Use when you need image captioning, visual question answering, image-text retrieval, or multimodal chat with state-of-the-art zero-shot performance.\nlicense: MIT\nmetadata:\n  version: 1.0.0\n  author: Orchestra Research\n  tags: [Multimodal, Vision-Language, Image Captioning, VQA, Zero-Shot]\n  dependencies: [transformers>=4.30.0, torch>=1.10.0, Pillow]\n---\n\n# BLIP-2: Vision-Language Pre-training\n\nComprehensive guide to using Salesforce's BLIP-2 for vision-language tasks with frozen image encoders and large language models.\n\n## When to use BLIP-2\n\n**Use BLIP-2 when:**\n- Need high-quality image captioning with natural descriptions\n- Building visual question answering (VQA) systems\n- Require zero-shot image-text understanding without task-specific training\n- Want to leverage LLM reasoning for visual tasks\n- Building multimodal conversational AI\n- Need image-text retrieval or matching\n\n**Key features:**\n- **Q-Former architecture**: Lightweight query transformer bridges vision and language\n- **Frozen backbone efficiency**: No need to fine-tune large vision\u002Flanguage models\n- **Multiple LLM backends**: OPT (2.7B, 6.7B) and FlanT5 (XL, XXL)\n- **Zero-shot capabilities**: Strong performance without task-specific training\n- **Efficient training**: Only trains Q-Former (~188M parameters)\n- **State-of-the-art results**: Beats larger models on VQA benchmarks\n\n**Use alternatives instead:**\n- **LLaVA**: For instruction-following multimodal chat\n- **InstructBLIP**: For improved instruction-following (BLIP-2 successor)\n- **GPT-4V\u002FClaude 3**: For production multimodal chat (proprietary)\n- **CLIP**: For simple image-text similarity without generation\n- **Flamingo**: For few-shot visual learning\n\n## Quick start\n\n### Installation\n\n```bash\n# HuggingFace Transformers (recommended)\npip install transformers accelerate torch Pillow\n\n# Or LAVIS library (Salesforce official)\npip install salesforce-lavis\n```\n\n### Basic image captioning\n\n```python\nimport torch\nfrom PIL import Image\nfrom transformers import Blip2Processor, Blip2ForConditionalGeneration\n\n# Load model and processor\nprocessor = Blip2Processor.from_pretrained(\"Salesforce\u002Fblip2-opt-2.7b\")\nmodel = Blip2ForConditionalGeneration.from_pretrained(\n    \"Salesforce\u002Fblip2-opt-2.7b\",\n    torch_dtype=torch.float16,\n    device_map=\"auto\"\n)\n\n# Load image\nimage = Image.open(\"photo.jpg\").convert(\"RGB\")\n\n# Generate caption\ninputs = processor(images=image, return_tensors=\"pt\").to(\"cuda\", torch.float16)\ngenerated_ids = model.generate(**inputs, max_new_tokens=50)\ncaption = processor.batch_decode(generated_ids, skip_special_tokens=True)[0]\nprint(caption)\n```\n\n### Visual question answering\n\n```python\n# Ask a question about the image\nquestion = \"What color is the car in this image?\"\n\ninputs = processor(images=image, text=question, return_tensors=\"pt\").to(\"cuda\", torch.float16)\ngenerated_ids = model.generate(**inputs, max_new_tokens=50)\nanswer = processor.batch_decode(generated_ids, skip_special_tokens=True)[0]\nprint(answer)\n```\n\n### Using LAVIS library\n\n```python\nimport torch\nfrom lavis.models import load_model_and_preprocess\nfrom PIL import Image\n\n# Load model\ndevice = torch.device(\"cuda\" if torch.cuda.is_available() else \"cpu\")\nmodel, vis_processors, txt_processors = load_model_and_preprocess(\n    name=\"blip2_opt\",\n    model_type=\"pretrain_opt2.7b\",\n    is_eval=True,\n    device=device\n)\n\n# Process image\nimage = Image.open(\"photo.jpg\").convert(\"RGB\")\nimage = vis_processors[\"eval\"](image).unsqueeze(0).to(device)\n\n# Caption\ncaption = model.generate({\"image\": image})\nprint(caption)\n\n# VQA\nquestion = txt_processors[\"eval\"](\"What is in this image?\")\nanswer = model.generate({\"image\": image, \"prompt\": question})\nprint(answer)\n```\n\n## Core concepts\n\n### Architecture overview\n\n```\nBLIP-2 Architecture:\n┌─────────────────────────────────────────────────────────────┐\n│                        Q-Former                              │\n│  ┌─────────────────────────────────────────────────────┐    │\n│  │     Learned Queries (32 queries × 768 dim)          │    │\n│  └────────────────────────┬────────────────────────────┘    │\n│                           │                                  │\n│  ┌────────────────────────▼────────────────────────────┐    │\n│  │    Cross-Attention with Image Features               │    │\n│  └────────────────────────┬────────────────────────────┘    │\n│                           │                                  │\n│  ┌────────────────────────▼────────────────────────────┐    │\n│  │    Self-Attention Layers (Transformer)               │    │\n│  └────────────────────────┬────────────────────────────┘    │\n└───────────────────────────┼─────────────────────────────────┘\n                            │\n┌───────────────────────────▼─────────────────────────────────┐\n│  Frozen Vision Encoder    │      Frozen LLM                  │\n│  (ViT-G\u002F14 from EVA-CLIP) │      (OPT or FlanT5)            │\n└─────────────────────────────────────────────────────────────┘\n```\n\n### Model variants\n\n| Model | LLM Backend | Size | Use Case |\n|-------|-------------|------|----------|\n| `blip2-opt-2.7b` | OPT-2.7B | ~4GB | General captioning, VQA |\n| `blip2-opt-6.7b` | OPT-6.7B | ~8GB | Better reasoning |\n| `blip2-flan-t5-xl` | FlanT5-XL | ~5GB | Instruction following |\n| `blip2-flan-t5-xxl` | FlanT5-XXL | ~13GB | Best quality |\n\n### Q-Former components\n\n| Component | Description | Parameters |\n|-----------|-------------|------------|\n| Learned queries | Fixed set of learnable embeddings | 32 × 768 |\n| Image transformer | Cross-attention to vision features | ~108M |\n| Text transformer | Self-attention for text | ~108M |\n| Linear projection | Maps to LLM dimension | Varies |\n\n## Advanced usage\n\n### Batch processing\n\n```python\nfrom PIL import Image\nimport torch\n\n# Load multiple images\nimages = [Image.open(f\"image_{i}.jpg\").convert(\"RGB\") for i in range(4)]\nquestions = [\n    \"What is shown in this image?\",\n    \"Describe the scene.\",\n    \"What colors are prominent?\",\n    \"Is there a person in this image?\"\n]\n\n# Process batch\ninputs = processor(\n    images=images,\n    text=questions,\n    return_tensors=\"pt\",\n    padding=True\n).to(\"cuda\", torch.float16)\n\n# Generate\ngenerated_ids = model.generate(**inputs, max_new_tokens=50)\nanswers = processor.batch_decode(generated_ids, skip_special_tokens=True)\n\nfor q, a in zip(questions, answers):\n    print(f\"Q: {q}\\nA: {a}\\n\")\n```\n\n### Controlling generation\n\n```python\n# Control generation parameters\ngenerated_ids = model.generate(\n    **inputs,\n    max_new_tokens=100,\n    min_length=20,\n    num_beams=5,              # Beam search\n    no_repeat_ngram_size=2,   # Avoid repetition\n    top_p=0.9,                # Nucleus sampling\n    temperature=0.7,          # Creativity\n    do_sample=True,           # Enable sampling\n)\n\n# For deterministic output\ngenerated_ids = model.generate(\n    **inputs,\n    max_new_tokens=50,\n    num_beams=5,\n    do_sample=False,\n)\n```\n\n### Memory optimization\n\n```python\n# 8-bit quantization\nfrom transformers import BitsAndBytesConfig\n\nquantization_config = BitsAndBytesConfig(load_in_8bit=True)\n\nmodel = Blip2ForConditionalGeneration.from_pretrained(\n    \"Salesforce\u002Fblip2-opt-6.7b\",\n    quantization_config=quantization_config,\n    device_map=\"auto\"\n)\n\n# 4-bit quantization (more aggressive)\nquantization_config = BitsAndBytesConfig(\n    load_in_4bit=True,\n    bnb_4bit_compute_dtype=torch.float16\n)\n\nmodel = Blip2ForConditionalGeneration.from_pretrained(\n    \"Salesforce\u002Fblip2-flan-t5-xxl\",\n    quantization_config=quantization_config,\n    device_map=\"auto\"\n)\n```\n\n### Image-text matching\n\n```python\n# Using LAVIS for ITM (Image-Text Matching)\nfrom lavis.models import load_model_and_preprocess\n\nmodel, vis_processors, txt_processors = load_model_and_preprocess(\n    name=\"blip2_image_text_matching\",\n    model_type=\"pretrain\",\n    is_eval=True,\n    device=device\n)\n\nimage = vis_processors[\"eval\"](raw_image).unsqueeze(0).to(device)\ntext = txt_processors[\"eval\"](\"a dog sitting on grass\")\n\n# Get matching score\nitm_output = model({\"image\": image, \"text_input\": text}, match_head=\"itm\")\nitm_scores = torch.nn.functional.softmax(itm_output, dim=1)\nprint(f\"Match probability: {itm_scores[:, 1].item():.3f}\")\n```\n\n### Feature extraction\n\n```python\n# Extract image features with Q-Former\nfrom lavis.models import load_model_and_preprocess\n\nmodel, vis_processors, _ = load_model_and_preprocess(\n    name=\"blip2_feature_extractor\",\n    model_type=\"pretrain\",\n    is_eval=True,\n    device=device\n)\n\nimage = vis_processors[\"eval\"](raw_image).unsqueeze(0).to(device)\n\n# Get features\nfeatures = model.extract_features({\"image\": image}, mode=\"image\")\nimage_embeds = features.image_embeds  # Shape: [1, 32, 768]\nimage_features = features.image_embeds_proj  # Projected for matching\n```\n\n## Common workflows\n\n### Workflow 1: Image captioning pipeline\n\n```python\nimport torch\nfrom PIL import Image\nfrom transformers import Blip2Processor, Blip2ForConditionalGeneration\nfrom pathlib import Path\n\nclass ImageCaptioner:\n    def __init__(self, model_name=\"Salesforce\u002Fblip2-opt-2.7b\"):\n        self.processor = Blip2Processor.from_pretrained(model_name)\n        self.model = Blip2ForConditionalGeneration.from_pretrained(\n            model_name,\n            torch_dtype=torch.float16,\n            device_map=\"auto\"\n        )\n\n    def caption(self, image_path: str, prompt: str = None) -> str:\n        image = Image.open(image_path).convert(\"RGB\")\n\n        if prompt:\n            inputs = self.processor(images=image, text=prompt, return_tensors=\"pt\")\n        else:\n            inputs = self.processor(images=image, return_tensors=\"pt\")\n\n        inputs = inputs.to(\"cuda\", torch.float16)\n\n        generated_ids = self.model.generate(\n            **inputs,\n            max_new_tokens=50,\n            num_beams=5\n        )\n\n        return self.processor.decode(generated_ids[0], skip_special_tokens=True)\n\n    def caption_batch(self, image_paths: list, prompt: str = None) -> list:\n        images = [Image.open(p).convert(\"RGB\") for p in image_paths]\n\n        if prompt:\n            inputs = self.processor(\n                images=images,\n                text=[prompt] * len(images),\n                return_tensors=\"pt\",\n                padding=True\n            )\n        else:\n            inputs = self.processor(images=images, return_tensors=\"pt\", padding=True)\n\n        inputs = inputs.to(\"cuda\", torch.float16)\n\n        generated_ids = self.model.generate(**inputs, max_new_tokens=50)\n        return self.processor.batch_decode(generated_ids, skip_special_tokens=True)\n\n# Usage\ncaptioner = ImageCaptioner()\n\n# Single image\ncaption = captioner.caption(\"photo.jpg\")\nprint(f\"Caption: {caption}\")\n\n# With prompt for style\ncaption = captioner.caption(\"photo.jpg\", \"a detailed description of\")\nprint(f\"Detailed: {caption}\")\n\n# Batch processing\ncaptions = captioner.caption_batch([\"img1.jpg\", \"img2.jpg\", \"img3.jpg\"])\nfor i, cap in enumerate(captions):\n    print(f\"Image {i+1}: {cap}\")\n```\n\n### Workflow 2: Visual Q&A system\n\n```python\nclass VisualQA:\n    def __init__(self, model_name=\"Salesforce\u002Fblip2-flan-t5-xl\"):\n        self.processor = Blip2Processor.from_pretrained(model_name)\n        self.model = Blip2ForConditionalGeneration.from_pretrained(\n            model_name,\n            torch_dtype=torch.float16,\n            device_map=\"auto\"\n        )\n        self.current_image = None\n        self.current_inputs = None\n\n    def set_image(self, image_path: str):\n        \"\"\"Load image for multiple questions.\"\"\"\n        self.current_image = Image.open(image_path).convert(\"RGB\")\n\n    def ask(self, question: str) -> str:\n        \"\"\"Ask a question about the current image.\"\"\"\n        if self.current_image is None:\n            raise ValueError(\"No image set. Call set_image() first.\")\n\n        # Format question for FlanT5\n        prompt = f\"Question: {question} Answer:\"\n\n        inputs = self.processor(\n            images=self.current_image,\n            text=prompt,\n            return_tensors=\"pt\"\n        ).to(\"cuda\", torch.float16)\n\n        generated_ids = self.model.generate(\n            **inputs,\n            max_new_tokens=50,\n            num_beams=5\n        )\n\n        return self.processor.decode(generated_ids[0], skip_special_tokens=True)\n\n    def ask_multiple(self, questions: list) -> dict:\n        \"\"\"Ask multiple questions about current image.\"\"\"\n        return {q: self.ask(q) for q in questions}\n\n# Usage\nvqa = VisualQA()\nvqa.set_image(\"scene.jpg\")\n\n# Ask questions\nprint(vqa.ask(\"What objects are in this image?\"))\nprint(vqa.ask(\"What is the weather like?\"))\nprint(vqa.ask(\"How many people are there?\"))\n\n# Batch questions\nresults = vqa.ask_multiple([\n    \"What is the main subject?\",\n    \"What colors are dominant?\",\n    \"Is this indoors or outdoors?\"\n])\n```\n\n### Workflow 3: Image search\u002Fretrieval\n\n```python\nimport torch\nimport numpy as np\nfrom PIL import Image\nfrom lavis.models import load_model_and_preprocess\n\nclass ImageSearchEngine:\n    def __init__(self):\n        self.device = torch.device(\"cuda\" if torch.cuda.is_available() else \"cpu\")\n        self.model, self.vis_processors, self.txt_processors = load_model_and_preprocess(\n            name=\"blip2_feature_extractor\",\n            model_type=\"pretrain\",\n            is_eval=True,\n            device=self.device\n        )\n        self.image_features = []\n        self.image_paths = []\n\n    def index_images(self, image_paths: list):\n        \"\"\"Build index from images.\"\"\"\n        self.image_paths = image_paths\n\n        for path in image_paths:\n            image = Image.open(path).convert(\"RGB\")\n            image = self.vis_processors[\"eval\"](image).unsqueeze(0).to(self.device)\n\n            with torch.no_grad():\n                features = self.model.extract_features({\"image\": image}, mode=\"image\")\n                # Use projected features for matching\n                self.image_features.append(\n                    features.image_embeds_proj.mean(dim=1).cpu().numpy()\n                )\n\n        self.image_features = np.vstack(self.image_features)\n\n    def search(self, query: str, top_k: int = 5) -> list:\n        \"\"\"Search images by text query.\"\"\"\n        # Get text features\n        text = self.txt_processors[\"eval\"](query)\n        text_input = {\"text_input\": [text]}\n\n        with torch.no_grad():\n            text_features = self.model.extract_features(text_input, mode=\"text\")\n            text_embeds = text_features.text_embeds_proj[:, 0].cpu().numpy()\n\n        # Compute similarities\n        similarities = np.dot(self.image_features, text_embeds.T).squeeze()\n        top_indices = np.argsort(similarities)[::-1][:top_k]\n\n        return [(self.image_paths[i], similarities[i]) for i in top_indices]\n\n# Usage\nengine = ImageSearchEngine()\nengine.index_images([\"img1.jpg\", \"img2.jpg\", \"img3.jpg\", ...])\n\n# Search\nresults = engine.search(\"a sunset over the ocean\", top_k=5)\nfor path, score in results:\n    print(f\"{path}: {score:.3f}\")\n```\n\n## Output format\n\n### Generation output\n\n```python\n# Direct generation returns token IDs\ngenerated_ids = model.generate(**inputs, max_new_tokens=50)\n# Shape: [batch_size, sequence_length]\n\n# Decode to text\ntext = processor.batch_decode(generated_ids, skip_special_tokens=True)\n# Returns: list of strings\n```\n\n### Feature extraction output\n\n```python\n# Q-Former outputs\nfeatures = model.extract_features({\"image\": image}, mode=\"image\")\n\nfeatures.image_embeds          # [B, 32, 768] - Q-Former outputs\nfeatures.image_embeds_proj     # [B, 32, 256] - Projected for matching\nfeatures.text_embeds          # [B, seq_len, 768] - Text features\nfeatures.text_embeds_proj     # [B, 256] - Projected text (CLS)\n```\n\n## Performance optimization\n\n### GPU memory requirements\n\n| Model | FP16 VRAM | INT8 VRAM | INT4 VRAM |\n|-------|-----------|-----------|-----------|\n| blip2-opt-2.7b | ~8GB | ~5GB | ~3GB |\n| blip2-opt-6.7b | ~16GB | ~9GB | ~5GB |\n| blip2-flan-t5-xl | ~10GB | ~6GB | ~4GB |\n| blip2-flan-t5-xxl | ~26GB | ~14GB | ~8GB |\n\n### Speed optimization\n\n```python\n# Use Flash Attention if available\nmodel = Blip2ForConditionalGeneration.from_pretrained(\n    \"Salesforce\u002Fblip2-opt-2.7b\",\n    torch_dtype=torch.float16,\n    attn_implementation=\"flash_attention_2\",  # Requires flash-attn\n    device_map=\"auto\"\n)\n\n# Compile model (PyTorch 2.0+)\nmodel = torch.compile(model)\n\n# Use smaller images (if quality allows)\nprocessor = Blip2Processor.from_pretrained(\"Salesforce\u002Fblip2-opt-2.7b\")\n# Default is 224x224, which is optimal\n```\n\n## Common issues\n\n| Issue | Solution |\n|-------|----------|\n| CUDA OOM | Use INT8\u002FINT4 quantization, smaller model |\n| Slow generation | Use greedy decoding, reduce max_new_tokens |\n| Poor captions | Try FlanT5 variant, use prompts |\n| Hallucinations | Lower temperature, use beam search |\n| Wrong answers | Rephrase question, provide context |\n\n## References\n\n- **[Advanced Usage](references\u002Fadvanced-usage.md)** - Fine-tuning, integration, deployment\n- **[Troubleshooting](references\u002Ftroubleshooting.md)** - Common issues and solutions\n\n## Resources\n\n- **Paper**: https:\u002F\u002Farxiv.org\u002Fabs\u002F2301.12597\n- **GitHub (LAVIS)**: https:\u002F\u002Fgithub.com\u002Fsalesforce\u002FLAVIS\n- **HuggingFace**: https:\u002F\u002Fhuggingface.co\u002FSalesforce\u002Fblip2-opt-2.7b\n- **Demo**: https:\u002F\u002Fhuggingface.co\u002Fspaces\u002FSalesforce\u002FBLIP2\n- **InstructBLIP**: https:\u002F\u002Farxiv.org\u002Fabs\u002F2305.06500 (successor)\n","# BLIP-2: Vision-Language Pre-training\n\nComprehensive guide to using Salesforce's BLIP-2 for vision-language tasks with frozen image encoders and large language models.\n\n## When to use BLIP-2\n\n**Use BLIP-2 when:**\n- Need high-quality image captioning with natural descriptions\n- Building visual question answering (VQA) systems\n- Require zero-shot image-text understanding without task-specific training\n- Want to leverage LLM reasoning for visual tasks\n- Building multimodal conversational AI\n- Need image-text retrieval or matching\n\n**Key features:**\n- **Q-Former architecture**: Lightweight query transformer bridges vision and language\n- **Frozen backbone efficiency**: No need to fine-tune large vision\u002Flanguage models\n- **Multiple LLM backends**: OPT (2.7B, 6.7B) and FlanT5 (XL, XXL)\n- **Zero-shot capabilities**: Strong performance without task-specific training\n- **Efficient training**: Only trains Q-Former (~188M parameters)\n- **State-of-the-art results**: Beats larger models on VQA benchmarks\n\n**Use alternatives instead:**\n- **LLaVA**: For instruction-following multimodal chat\n- **InstructBLIP**: For improved instruction-following (BLIP-2 successor)\n- **GPT-4V\u002FClaude 3**: For production multimodal chat (proprietary)\n- **CLIP**: For simple image-text similarity without generation\n- **Flamingo**: For few-shot visual learning\n\n## Quick start\n\n### Installation\n\n```bash\n# HuggingFace Transformers (recommended)\npip install transformers accelerate torch Pillow\n\n# Or LAVIS library (Salesforce official)\npip install salesforce-lavis\n```\n\n### Basic image captioning\n\n```python\nimport torch\nfrom PIL import Image\nfrom transformers import Blip2Processor, Blip2ForConditionalGeneration\n\n# Load model and processor\nprocessor = Blip2Processor.from_pretrained(\"Salesforce\u002Fblip2-opt-2.7b\")\nmodel = Blip2ForConditionalGeneration.from_pretrained(\n    \"Salesforce\u002Fblip2-opt-2.7b\",\n    torch_dtype=torch.float16,\n    device_map=\"auto\"\n)\n\n# Load image\nimage = Image.open(\"photo.jpg\").convert(\"RGB\")\n\n# Generate caption\ninputs = processor(images=image, return_tensors=\"pt\").to(\"cuda\", torch.float16)\ngenerated_ids = model.generate(**inputs, max_new_tokens=50)\ncaption = processor.batch_decode(generated_ids, skip_special_tokens=True)[0]\nprint(caption)\n```\n\n### Visual question answering\n\n```python\n# Ask a question about the image\nquestion = \"What color is the car in this image?\"\n\ninputs = processor(images=image, text=question, return_tensors=\"pt\").to(\"cuda\", torch.float16)\ngenerated_ids = model.generate(**inputs, max_new_tokens=50)\nanswer = processor.batch_decode(generated_ids, skip_special_tokens=True)[0]\nprint(answer)\n```\n\n### Using LAVIS library\n\n```python\nimport torch\nfrom lavis.models import load_model_and_preprocess\nfrom PIL import Image\n\n# Load model\ndevice = torch.device(\"cuda\" if torch.cuda.is_available() else \"cpu\")\nmodel, vis_processors, txt_processors = load_model_and_preprocess(\n    name=\"blip2_opt\",\n    model_type=\"pretrain_opt2.7b\",\n    is_eval=True,\n    device=device\n)\n\n# Process image\nimage = Image.open(\"photo.jpg\").convert(\"RGB\")\nimage = vis_processors[\"eval\"](image).unsqueeze(0).to(device)\n\n# Caption\ncaption = model.generate({\"image\": image})\nprint(caption)\n\n# VQA\nquestion = txt_processors[\"eval\"](\"What is in this image?\")\nanswer = model.generate({\"image\": image, \"prompt\": question})\nprint(answer)\n```\n\n## Core concepts\n\n### Architecture overview\n\n```\nBLIP-2 Architecture:\n┌─────────────────────────────────────────────────────────────┐\n│                        Q-Former                              │\n│  ┌─────────────────────────────────────────────────────┐    │\n│  │     Learned Queries (32 queries × 768 dim)          │    │\n│  └────────────────────────┬────────────────────────────┘    │\n│                           │                                  │\n│  ┌────────────────────────▼────────────────────────────┐    │\n│  │    Cross-Attention with Image Features               │    │\n│  └────────────────────────┬────────────────────────────┘    │\n│                           │                                  │\n│  ┌────────────────────────▼────────────────────────────┐    │\n│  │    Self-Attention Layers (Transformer)               │    │\n│  └────────────────────────┬────────────────────────────┘    │\n└───────────────────────────┼─────────────────────────────────┘\n                            │\n┌───────────────────────────▼─────────────────────────────────┐\n│  Frozen Vision Encoder    │      Frozen LLM                  │\n│  (ViT-G\u002F14 from EVA-CLIP) │      (OPT or FlanT5)            │\n└─────────────────────────────────────────────────────────────┘\n```\n\n### Model variants\n\n| Model | LLM Backend | Size | Use Case |\n|-------|-------------|------|----------|\n| `blip2-opt-2.7b` | OPT-2.7B | ~4GB | General captioning, VQA |\n| `blip2-opt-6.7b` | OPT-6.7B | ~8GB | Better reasoning |\n| `blip2-flan-t5-xl` | FlanT5-XL | ~5GB | Instruction following |\n| `blip2-flan-t5-xxl` | FlanT5-XXL | ~13GB | Best quality |\n\n### Q-Former components\n\n| Component | Description | Parameters |\n|-----------|-------------|------------|\n| Learned queries | Fixed set of learnable embeddings | 32 × 768 |\n| Image transformer | Cross-attention to vision features | ~108M |\n| Text transformer | Self-attention for text | ~108M |\n| Linear projection | Maps to LLM dimension | Varies |\n\n## Advanced usage\n\n### Batch processing\n\n```python\nfrom PIL import Image\nimport torch\n\n# Load multiple images\nimages = [Image.open(f\"image_{i}.jpg\").convert(\"RGB\") for i in range(4)]\nquestions = [\n    \"What is shown in this image?\",\n    \"Describe the scene.\",\n    \"What colors are prominent?\",\n    \"Is there a person in this image?\"\n]\n\n# Process batch\ninputs = processor(\n    images=images,\n    text=questions,\n    return_tensors=\"pt\",\n    padding=True\n).to(\"cuda\", torch.float16)\n\n# Generate\ngenerated_ids = model.generate(**inputs, max_new_tokens=50)\nanswers = processor.batch_decode(generated_ids, skip_special_tokens=True)\n\nfor q, a in zip(questions, answers):\n    print(f\"Q: {q}\\nA: {a}\\n\")\n```\n\n### Controlling generation\n\n```python\n# Control generation parameters\ngenerated_ids = model.generate(\n    **inputs,\n    max_new_tokens=100,\n    min_length=20,\n    num_beams=5,              # Beam search\n    no_repeat_ngram_size=2,   # Avoid repetition\n    top_p=0.9,                # Nucleus sampling\n    temperature=0.7,          # Creativity\n    do_sample=True,           # Enable sampling\n)\n\n# For deterministic output\ngenerated_ids = model.generate(\n    **inputs,\n    max_new_tokens=50,\n    num_beams=5,\n    do_sample=False,\n)\n```\n\n### Memory optimization\n\n```python\n# 8-bit quantization\nfrom transformers import BitsAndBytesConfig\n\nquantization_config = BitsAndBytesConfig(load_in_8bit=True)\n\nmodel = Blip2ForConditionalGeneration.from_pretrained(\n    \"Salesforce\u002Fblip2-opt-6.7b\",\n    quantization_config=quantization_config,\n    device_map=\"auto\"\n)\n\n# 4-bit quantization (more aggressive)\nquantization_config = BitsAndBytesConfig(\n    load_in_4bit=True,\n    bnb_4bit_compute_dtype=torch.float16\n)\n\nmodel = Blip2ForConditionalGeneration.from_pretrained(\n    \"Salesforce\u002Fblip2-flan-t5-xxl\",\n    quantization_config=quantization_config,\n    device_map=\"auto\"\n)\n```\n\n### Image-text matching\n\n```python\n# Using LAVIS for ITM (Image-Text Matching)\nfrom lavis.models import load_model_and_preprocess\n\nmodel, vis_processors, txt_processors = load_model_and_preprocess(\n    name=\"blip2_image_text_matching\",\n    model_type=\"pretrain\",\n    is_eval=True,\n    device=device\n)\n\nimage = vis_processors[\"eval\"](raw_image).unsqueeze(0).to(device)\ntext = txt_processors[\"eval\"](\"a dog sitting on grass\")\n\n# Get matching score\nitm_output = model({\"image\": image, \"text_input\": text}, match_head=\"itm\")\nitm_scores = torch.nn.functional.softmax(itm_output, dim=1)\nprint(f\"Match probability: {itm_scores[:, 1].item():.3f}\")\n```\n\n### Feature extraction\n\n```python\n# Extract image features with Q-Former\nfrom lavis.models import load_model_and_preprocess\n\nmodel, vis_processors, _ = load_model_and_preprocess(\n    name=\"blip2_feature_extractor\",\n    model_type=\"pretrain\",\n    is_eval=True,\n    device=device\n)\n\nimage = vis_processors[\"eval\"](raw_image).unsqueeze(0).to(device)\n\n# Get features\nfeatures = model.extract_features({\"image\": image}, mode=\"image\")\nimage_embeds = features.image_embeds  # Shape: [1, 32, 768]\nimage_features = features.image_embeds_proj  # Projected for matching\n```\n\n## Common workflows\n\n### Workflow 1: Image captioning pipeline\n\n```python\nimport torch\nfrom PIL import Image\nfrom transformers import Blip2Processor, Blip2ForConditionalGeneration\nfrom pathlib import Path\n\nclass ImageCaptioner:\n    def __init__(self, model_name=\"Salesforce\u002Fblip2-opt-2.7b\"):\n        self.processor = Blip2Processor.from_pretrained(model_name)\n        self.model = Blip2ForConditionalGeneration.from_pretrained(\n            model_name,\n            torch_dtype=torch.float16,\n            device_map=\"auto\"\n        )\n\n    def caption(self, image_path: str, prompt: str = None) -> str:\n        image = Image.open(image_path).convert(\"RGB\")\n\n        if prompt:\n            inputs = self.processor(images=image, text=prompt, return_tensors=\"pt\")\n        else:\n            inputs = self.processor(images=image, return_tensors=\"pt\")\n\n        inputs = inputs.to(\"cuda\", torch.float16)\n\n        generated_ids = self.model.generate(\n            **inputs,\n            max_new_tokens=50,\n            num_beams=5\n        )\n\n        return self.processor.decode(generated_ids[0], skip_special_tokens=True)\n\n    def caption_batch(self, image_paths: list, prompt: str = None) -> list:\n        images = [Image.open(p).convert(\"RGB\") for p in image_paths]\n\n        if prompt:\n            inputs = self.processor(\n                images=images,\n                text=[prompt] * len(images),\n                return_tensors=\"pt\",\n                padding=True\n            )\n        else:\n            inputs = self.processor(images=images, return_tensors=\"pt\", padding=True)\n\n        inputs = inputs.to(\"cuda\", torch.float16)\n\n        generated_ids = self.model.generate(**inputs, max_new_tokens=50)\n        return self.processor.batch_decode(generated_ids, skip_special_tokens=True)\n\n# Usage\ncaptioner = ImageCaptioner()\n\n# Single image\ncaption = captioner.caption(\"photo.jpg\")\nprint(f\"Caption: {caption}\")\n\n# With prompt for style\ncaption = captioner.caption(\"photo.jpg\", \"a detailed description of\")\nprint(f\"Detailed: {caption}\")\n\n# Batch processing\ncaptions = captioner.caption_batch([\"img1.jpg\", \"img2.jpg\", \"img3.jpg\"])\nfor i, cap in enumerate(captions):\n    print(f\"Image {i+1}: {cap}\")\n```\n\n### Workflow 2: Visual Q&A system\n\n```python\nclass VisualQA:\n    def __init__(self, model_name=\"Salesforce\u002Fblip2-flan-t5-xl\"):\n        self.processor = Blip2Processor.from_pretrained(model_name)\n        self.model = Blip2ForConditionalGeneration.from_pretrained(\n            model_name,\n            torch_dtype=torch.float16,\n            device_map=\"auto\"\n        )\n        self.current_image = None\n        self.current_inputs = None\n\n    def set_image(self, image_path: str):\n        \"\"\"Load image for multiple questions.\"\"\"\n        self.current_image = Image.open(image_path).convert(\"RGB\")\n\n    def ask(self, question: str) -> str:\n        \"\"\"Ask a question about the current image.\"\"\"\n        if self.current_image is None:\n            raise ValueError(\"No image set. Call set_image() first.\")\n\n        # Format question for FlanT5\n        prompt = f\"Question: {question} Answer:\"\n\n        inputs = self.processor(\n            images=self.current_image,\n            text=prompt,\n            return_tensors=\"pt\"\n        ).to(\"cuda\", torch.float16)\n\n        generated_ids = self.model.generate(\n            **inputs,\n            max_new_tokens=50,\n            num_beams=5\n        )\n\n        return self.processor.decode(generated_ids[0], skip_special_tokens=True)\n\n    def ask_multiple(self, questions: list) -> dict:\n        \"\"\"Ask multiple questions about current image.\"\"\"\n        return {q: self.ask(q) for q in questions}\n\n# Usage\nvqa = VisualQA()\nvqa.set_image(\"scene.jpg\")\n\n# Ask questions\nprint(vqa.ask(\"What objects are in this image?\"))\nprint(vqa.ask(\"What is the weather like?\"))\nprint(vqa.ask(\"How many people are there?\"))\n\n# Batch questions\nresults = vqa.ask_multiple([\n    \"What is the main subject?\",\n    \"What colors are dominant?\",\n    \"Is this indoors or outdoors?\"\n])\n```\n\n### Workflow 3: Image search\u002Fretrieval\n\n```python\nimport torch\nimport numpy as np\nfrom PIL import Image\nfrom lavis.models import load_model_and_preprocess\n\nclass ImageSearchEngine:\n    def __init__(self):\n        self.device = torch.device(\"cuda\" if torch.cuda.is_available() else \"cpu\")\n        self.model, self.vis_processors, self.txt_processors = load_model_and_preprocess(\n            name=\"blip2_feature_extractor\",\n            model_type=\"pretrain\",\n            is_eval=True,\n            device=self.device\n        )\n        self.image_features = []\n        self.image_paths = []\n\n    def index_images(self, image_paths: list):\n        \"\"\"Build index from images.\"\"\"\n        self.image_paths = image_paths\n\n        for path in image_paths:\n            image = Image.open(path).convert(\"RGB\")\n            image = self.vis_processors[\"eval\"](image).unsqueeze(0).to(self.device)\n\n            with torch.no_grad():\n                features = self.model.extract_features({\"image\": image}, mode=\"image\")\n                # Use projected features for matching\n                self.image_features.append(\n                    features.image_embeds_proj.mean(dim=1).cpu().numpy()\n                )\n\n        self.image_features = np.vstack(self.image_features)\n\n    def search(self, query: str, top_k: int = 5) -> list:\n        \"\"\"Search images by text query.\"\"\"\n        # Get text features\n        text = self.txt_processors[\"eval\"](query)\n        text_input = {\"text_input\": [text]}\n\n        with torch.no_grad():\n            text_features = self.model.extract_features(text_input, mode=\"text\")\n            text_embeds = text_features.text_embeds_proj[:, 0].cpu().numpy()\n\n        # Compute similarities\n        similarities = np.dot(self.image_features, text_embeds.T).squeeze()\n        top_indices = np.argsort(similarities)[::-1][:top_k]\n\n        return [(self.image_paths[i], similarities[i]) for i in top_indices]\n\n# Usage\nengine = ImageSearchEngine()\nengine.index_images([\"img1.jpg\", \"img2.jpg\", \"img3.jpg\", ...])\n\n# Search\nresults = engine.search(\"a sunset over the ocean\", top_k=5)\nfor path, score in results:\n    print(f\"{path}: {score:.3f}\")\n```\n\n## Output format\n\n### Generation output\n\n```python\n# Direct generation returns token IDs\ngenerated_ids = model.generate(**inputs, max_new_tokens=50)\n# Shape: [batch_size, sequence_length]\n\n# Decode to text\ntext = processor.batch_decode(generated_ids, skip_special_tokens=True)\n# Returns: list of strings\n```\n\n### Feature extraction output\n\n```python\n# Q-Former outputs\nfeatures = model.extract_features({\"image\": image}, mode=\"image\")\n\nfeatures.image_embeds          # [B, 32, 768] - Q-Former outputs\nfeatures.image_embeds_proj     # [B, 32, 256] - Projected for matching\nfeatures.text_embeds          # [B, seq_len, 768] - Text features\nfeatures.text_embeds_proj     # [B, 256] - Projected text (CLS)\n```\n\n## Performance optimization\n\n### GPU memory requirements\n\n| Model | FP16 VRAM | INT8 VRAM | INT4 VRAM |\n|-------|-----------|-----------|-----------|\n| blip2-opt-2.7b | ~8GB | ~5GB | ~3GB |\n| blip2-opt-6.7b | ~16GB | ~9GB | ~5GB |\n| blip2-flan-t5-xl | ~10GB | ~6GB | ~4GB |\n| blip2-flan-t5-xxl | ~26GB | ~14GB | ~8GB |\n\n### Speed optimization\n\n```python\n# Use Flash Attention if available\nmodel = Blip2ForConditionalGeneration.from_pretrained(\n    \"Salesforce\u002Fblip2-opt-2.7b\",\n    torch_dtype=torch.float16,\n    attn_implementation=\"flash_attention_2\",  # Requires flash-attn\n    device_map=\"auto\"\n)\n\n# Compile model (PyTorch 2.0+)\nmodel = torch.compile(model)\n\n# Use smaller images (if quality allows)\nprocessor = Blip2Processor.from_pretrained(\"Salesforce\u002Fblip2-opt-2.7b\")\n# Default is 224x224, which is optimal\n```\n\n## Common issues\n\n| Issue | Solution |\n|-------|----------|\n| CUDA OOM | Use INT8\u002FINT4 quantization, smaller model |\n| Slow generation | Use greedy decoding, reduce max_new_tokens |\n| Poor captions | Try FlanT5 variant, use prompts |\n| Hallucinations | Lower temperature, use beam search |\n| Wrong answers | Rephrase question, provide context |\n\n## References\n\n- **[Advanced Usage](references\u002Fadvanced-usage.md)** - Fine-tuning, integration, deployment\n- **[Troubleshooting](references\u002Ftroubleshooting.md)** - Common issues and solutions\n\n## Resources\n\n- **Paper**: https:\u002F\u002Farxiv.org\u002Fabs\u002F2301.12597\n- **GitHub (LAVIS)**: https:\u002F\u002Fgithub.com\u002Fsalesforce\u002FLAVIS\n- **HuggingFace**: https:\u002F\u002Fhuggingface.co\u002FSalesforce\u002Fblip2-opt-2.7b\n- **Demo**: https:\u002F\u002Fhuggingface.co\u002Fspaces\u002FSalesforce\u002FBLIP2\n- **InstructBLIP**: https:\u002F\u002Farxiv.org\u002Fabs\u002F2305.06500 (successor)\n",{"name":5,"license":15,"metadata":24,"description":7},{"tags":25,"author":31,"version":32,"dependencies":33},[26,27,28,29,30],"Multimodal","Vision-Language","Image Captioning","VQA","Zero-Shot","Orchestra Research","1.0.0",[34,35,36],"transformers>=4.30.0","torch>=1.10.0","Pillow","main","1e72c52e0f3ffd72fbc6ba994fda0f4a6d63911a","payloads\u002Fskills\u002Fmultimodal-blip-2","https:\u002F\u002Fgithub.com\u002Forigin-labs-ai\u002Fcode","https:\u002F\u002Fgithub.com\u002Forigin-labs-ai","2026-11-14 20:35:25",{"source":8,"skillName":5,"commands":44,"prompt":54,"zipAvailable":55},[45,48,51],{"tool":46,"command":47},"npx","npx skills add origin-labs-ai\u002Fcode --skill multimodal-blip-2",{"tool":49,"command":50},"bunx","bunx skills add origin-labs-ai\u002Fcode --skill multimodal-blip-2",{"tool":52,"command":53},"pnpm","pnpm dlx skills add origin-labs-ai\u002Fcode --skill multimodal-blip-2","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Forigin-labs-ai\u002Fcode\u002Fblob\u002Fmain\u002Fpayloads\u002Fskills\u002Fmultimodal-blip-2\u002FSKILL.md",true,[57,63],{"path":58,"resourceType":59,"resourceTypeDesc":60,"sizeBytes":61,"sourceHtmlUrl":62},"references\u002Fadvanced-usage.md","REFERENCE","参考文档",18889,"https:\u002F\u002Fgithub.com\u002Forigin-labs-ai\u002Fcode\u002Fblob\u002Fmain\u002Fpayloads\u002Fskills\u002Fmultimodal-blip-2\u002Freferences\u002Fadvanced-usage.md",{"path":64,"resourceType":59,"resourceTypeDesc":60,"sizeBytes":65,"sourceHtmlUrl":66},"references\u002Ftroubleshooting.md",11981,"https:\u002F\u002Fgithub.com\u002Forigin-labs-ai\u002Fcode\u002Fblob\u002Fmain\u002Fpayloads\u002Fskills\u002Fmultimodal-blip-2\u002Freferences\u002Ftroubleshooting.md",[68,76,84,92,100,109],{"skillNo":69,"name":70,"nameZh":6,"description":71,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":72,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":19},"01M7BP6Z7NBQXMB8Y5ZRR7PGCF","web-search","Implement web search capabilities using the z-ai-web-dev-sdk. Use this skill when the user needs to search for real-time information from the web, retrieve up-to-date content beyond the knowledge cutoff, or find the latest news and data. Returns structured search results with URLs, snippets, and metadata.","https:\u002F\u002Fgithub.com\u002Forigin-labs-ai\u002Fcode\u002Fblob\u002Fmain\u002Fwindows\u002Fsonar\u002Fmerger\u002Fcode-fusion-dead-20261101\u002Fskills\u002Fweb-search\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Forigin-labs-ai\u002Fcode\u002Fblob\u002Fmain\u002Fwindows\u002Fsonar\u002Fmerger\u002Fcode-fusion-dead-20261101\u002Fskills\u002Fweb-search\u002FSKILL.md",[],[],{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":80,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":19},"01M7BP6T13CWYHZSHGYG0RT885","web-reader","Implement web page content extraction capabilities using the z-ai-web-dev-sdk. Use this skill when the user needs to scrape web pages, extract article content, retrieve page metadata, or build applications that process web content. Supports automatic content extraction with title, HTML, and publication time retrieval.","https:\u002F\u002Fgithub.com\u002Forigin-labs-ai\u002Fcode\u002Fblob\u002Fmain\u002Fwindows\u002Fsonar\u002Fmerger\u002Fcode-fusion-dead-20261101\u002Fskills\u002Fweb-reader\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Forigin-labs-ai\u002Fcode\u002Fblob\u002Fmain\u002Fwindows\u002Fsonar\u002Fmerger\u002Fcode-fusion-dead-20261101\u002Fskills\u002Fweb-reader\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":88,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":19},"01M7BP6GM9Z301PPT4ZRV049AN","video-understand","Implement specialized video understanding capabilities using the z-ai-web-dev-sdk. Use this skill when the user needs to analyze video content, understand motion and temporal sequences, extract information from video frames, describe video scenes, or perform video-based AI analysis. Optimized for MP4, AVI, MOV, and other common video formats.","https:\u002F\u002Fgithub.com\u002Forigin-labs-ai\u002Fcode\u002Fblob\u002Fmain\u002Fwindows\u002Fsonar\u002Fmerger\u002Fcode-fusion-dead-20261101\u002Fskills\u002Fvideo-understand\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Forigin-labs-ai\u002Fcode\u002Fblob\u002Fmain\u002Fwindows\u002Fsonar\u002Fmerger\u002Fcode-fusion-dead-20261101\u002Fskills\u002Fvideo-understand\u002FSKILL.md",[],[],{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":96,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":19},"01M7BP6ANRHQ1K7PVS11RBZCC7","Video Generation","Implement AI-powered video generation capabilities using the z-ai-web-dev-sdk. Use this skill when the user needs to generate videos from text prompts or images, create video content programmatically, or build applications that produce video outputs. Supports asynchronous task management with status polling and result retrieval.","https:\u002F\u002Fgithub.com\u002Forigin-labs-ai\u002Fcode\u002Fblob\u002Fmain\u002Fwindows\u002Fsonar\u002Fmerger\u002Fcode-fusion-dead-20261101\u002Fskills\u002Fvideo-generation\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Forigin-labs-ai\u002Fcode\u002Fblob\u002Fmain\u002Fwindows\u002Fsonar\u002Fmerger\u002Fcode-fusion-dead-20261101\u002Fskills\u002Fvideo-generation\u002FSKILL.md",[],[],{"skillNo":101,"name":102,"nameZh":6,"description":103,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":104,"licenseFileUrl":105,"sourceHtmlUrl":106,"categories":107,"keywords":108,"publishedAt":19},"01M7BP56W5SX2MMJWKMJVC66F0","skill-creator","Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.","Apache-2.0","https:\u002F\u002Fgithub.com\u002Forigin-labs-ai\u002Fcode\u002Fblob\u002Fmain\u002Fwindows\u002Fsonar\u002Fmerger\u002Fcode-fusion-dead-20261101\u002Fskills\u002Fskill-creator\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Forigin-labs-ai\u002Fcode\u002Fblob\u002Fmain\u002Fwindows\u002Fsonar\u002Fmerger\u002Fcode-fusion-dead-20261101\u002Fskills\u002Fskill-creator\u002FSKILL.md",[],[],{"skillNo":110,"name":111,"nameZh":6,"description":112,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":104,"licenseFileUrl":6,"sourceHtmlUrl":113,"categories":114,"keywords":115,"publishedAt":19},"01M7BP503HPG0DBCN4K0JKCA88","seo-content-writer","Use when the user asks to \"write SEO content\", \"create a blog post\", \"write an article\", \"content writing\", \"draft optimized content\", \"write me an article\", \"create a blog post about\", \"help me write SEO content\", or \"draft content for\". Creates high-quality, SEO-optimized content that ranks in search engines. Applies on-page SEO best practices, keyword optimization, and content structure for maximum visibility and engagement. For AI citation optimization, see geo-content-optimizer. For updating existing content, see content-refresher.","https:\u002F\u002Fgithub.com\u002Forigin-labs-ai\u002Fcode\u002Fblob\u002Fmain\u002Fwindows\u002Fsonar\u002Fmerger\u002Fcode-fusion-dead-20261101\u002Fskills\u002Fseo-content-writer\u002FSKILL.md",[],[]]