Community画像github.com

davila7/stable-diffusion-image-generation

HuggingFace Diffusersを使ったStable Diffusionモデルによる最新のテキストから画像への生成。テキストプロンプトからの画像生成、画像間変換、インペインティング、カスタム拡散パイプラインの構築に使用します。

stable-diffusion-image-generation とは?

このスキルは、HuggingFace Diffusersライブラリを介してStable Diffusionモデルを使用し、テキストから画像への最先端の生成機能を提供します。開発者はテキストプロンプトから高品質な画像を生成したり、既存の画像を別のスタイルやコンテンツに変換する画像間変換、画像の欠損部分を補完するインペインティング、そして独自の拡散パイプラインを構築することができます。主にPython環境で動作し、Diffusersライブラリの柔軟なAPIを活用することで、カスタムモデルのロードや生成パラメータの細かな調整が可能です。このスキルは、AIアシスタント(Claude CodeやCursorなど)と連携して、クリエイティブな画像生成タスクを自動化・効率化するのに役立ちます。

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/davila7/claude-code-templates/tree/main/skills/stable-diffusion-image-generation

Installed? Explore more 画像 skills: steipete/songsee, affaan-m/frontend-design, mattpocock/improve-codebase-architecture · View all 6 →

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

stable-diffusion-image-generation は何をしますか?

HuggingFace Diffusersを使ったStable Diffusionモデルによる最新のテキストから画像への生成。テキストプロンプトからの画像生成、画像間変換、インペインティング、カスタム拡散パイプラインの構築に使用します。

説明

このスキルは、Stable Diffusionモデルを利用してテキスト記述から画像を生成するためのツールを提供します。HuggingFace Diffusersライブラリを使用することで、さまざまな事前学習済みモデルにアクセスし、画像生成、画像間変換(img2img)、インペインティングなどのタスクを実行できます。

使い方

インストール

pip install diffusers transformers accelerate torch

基本的なテキストから画像への生成

from diffusers import StableDiffusionPipeline
import torch

model_id = "runwayml/stable-diffusion-v1-5"
pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16)
pipe = pipe.to("cuda")

prompt = "a photo of an astronaut riding a horse on mars"
image = pipe(prompt).images[0]
image.save("astronaut_horse.png")

画像間変換(img2img)

from diffusers import StableDiffusionImg2ImgPipeline
from PIL import Image

pipe = StableDiffusionImg2ImgPipeline.from_pretrained(model_id, torch_dtype=torch.float16).to("cuda")

init_image = Image.open("input.png").convert("RGB")
prompt = "a fantasy landscape"

images = pipe(prompt=prompt, image=init_image, strength=0.75, guidance_scale=7.5).images
images[0].save("fantasy_landscape.png")

インペインティング

from diffusers import StableDiffusionInpaintPipeline

pipe = StableDiffusionInpaintPipeline.from_pretrained(
    "runwayml/stable-diffusion-inpainting",
    torch_dtype=torch.float16
).to("cuda")

init_image = Image.open("input.png").convert("RGB")
mask_image = Image.open("mask.png").convert("RGB")
prompt = "a cat sitting on a bench"

image = pipe(prompt=prompt, image=init_image, mask_image=mask_image).images[0]
image.save("inpainted.png")

パラメータ

  • prompt: 生成する画像を記述したテキストプロンプト
  • negative_prompt: 生成を避ける内容を指定するオプションのプロンプト
  • num_inference_steps: 推論ステップ数(デフォルト: 50)
  • guidance_scale: プロンプトへの忠実度(デフォルト: 7.5)
  • height / width: 生成画像のサイズ
  • seed: 再現性のためのランダムシード

サポートされるモデル

  • Stable Diffusion v1.4/v1.5
  • Stable Diffusion v2.0/v2.1
  • Stable Diffusion XL (SDXL)
  • カスタムファインチューンモデル

注意事項

  • GPU(CUDA)を推奨しますが、CPUでも動作可能です(速度が大幅に低下します)
  • 使用前に各モデルのライセンスを確認してください
  • 生成された画像はモデルのバイアスを反映する可能性があるため、注意して使用してください

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

davila7/citation-management

Comprehensive citation management for academic research. Search Google Scholar and PubMed for papers, extract accurate metadata, validate citations, and generate properly formatted BibTeX entries. This skill should be used when you need to find papers, verify citation information, convert DOIs to BibTeX, or ensure reference accuracy in scientific writing.

davila7/claude-code-templates

Balance visual design with ATS compatibility for creative roles. Use when the user is in design, art, writing, marketing creative, or any visual/creative field and needs a resume that looks distinctive but still parses.

davila7/claude-code-templates

Optimize resumes for software engineering, product management, and technical roles. Use when the user mentions software engineer, developer, PM, data scientist, ML, DevOps, or other technical role resumes.

davila7/claude-code-templates

Expert in building portfolios that actually land jobs and clients - not just showing work, but creating memorable experiences. Covers developer portfolios, designer portfolios, creative portfolios, and portfolios that convert visitors into opportunities. Use when: portfolio, personal website, showcase work, developer portfolio, designer portfolio.

davila7/claude-code-templates

Create premium, Awwwards-quality website designs as React (.jsx) components that look like they were built by a top-tier agency charging $50k+ per project. Use this skill whenever the user asks for a website, landing page, portfolio, or web component that should look expensive, premium, luxury, editorial, high-end, or agency-quality. Also trigger when the user mentions Awwwards, FWA, award-winning design, or references brands like Apple, Aesop, Bottega Veneta, Stripe, or any luxury/fashion/design-forward brand. Trigger when the user says things like "make it look professional", "make it look expensive", "I want it to look really good", "high quality design", "not generic", or expresses dissatisfaction with typical AI-generated website aesthetics. Do NOT trigger for dashboards, admin panels, internal tools, or functional UI where aesthetics are secondary to utility — the standard frontend-design skill handles those.

davila7/claude-code-templates

Generates creative domain name ideas for your project and checks availability across multiple TLDs (.com, .io, .dev, .ai, etc.). Saves hours of brainstorming and manual checking.

davila7/claude-code-templates

When the user wants to optimize, improve, or increase conversions on any marketing page — including homepage, landing pages, pricing pages, feature pages, or blog posts. Also use when the user says "CRO," "conversion rate optimization," "this page isn't converting," "improve conversions," or "why isn't this page working." For signup/registration flows, see signup-flow-cro. For post-signup activation, see onboarding-cro. For forms outside of signup, see form-cro. For popups/modals, see popup-cro.

davila7/excel-analysis

Analyze Excel spreadsheets, create pivot tables, generate charts, and perform data analysis. Use when analyzing Excel files, spreadsheets, tabular data, or .xlsx files.

davila7/exploratory-data-analysis

Perform comprehensive exploratory data analysis on scientific data files across 200+ file formats. This skill should be used when analyzing any scientific data file to understand its structure, content, quality, and characteristics. Automatically detects file type and generates detailed markdown reports with format-specific analysis, quality metrics, and downstream analysis recommendations. Covers chemistry, bioinformatics, microscopy, spectroscopy, proteomics, metabolomics, and general scientific data formats.

davila7/generate-image

Generate or edit images using AI models (FLUX, Gemini). Use for general-purpose image generation including photos, illustrations, artwork, visual assets, concept art, and any image that isn't a technical diagram or schematic. For flowcharts, circuits, pathways, and technical diagrams, use the scientific-schematics skill instead.

davila7/jira

Use when the user mentions Jira issues (e.g., "PROJ-123"), asks about tickets, wants to create/view/update issues, check sprint status, or manage their Jira workflow. Triggers on keywords like "jira", "issue", "ticket", "sprint", "backlog", or issue key patterns.

davila7/literature-review

Conduct comprehensive, systematic literature reviews using multiple academic databases (PubMed, arXiv, bioRxiv, Semantic Scholar, etc.). This skill should be used when conducting systematic literature reviews, meta-analyses, research synthesis, or comprehensive literature searches across biomedical, scientific, and technical domains. Creates professionally formatted markdown documents and PDFs with verified citations in multiple citation styles (APA, Nature, Vancouver, etc.).

davila7/marketing-strategy-pmm

Product marketing, positioning, GTM strategy, and competitive intelligence. Includes ICP definition, April Dunford positioning methodology, launch playbooks, competitive battlecards, and international market entry guides. Use when developing positioning, planning product launches, creating messaging, analyzing competitors, entering new markets, enabling sales, or when user mentions product marketing, positioning, GTM, go-to-market, competitive analysis, market entry, or sales enablement.

davila7/market-research-reports

Generate comprehensive market research reports (50+ pages) in the style of top consulting firms (McKinsey, BCG, Gartner). Features professional LaTeX formatting, extensive visual generation with scientific-schematics and generate-image, deep integration with research-lookup for data gathering, and multi-framework strategic analysis including Porter's Five Forces, PESTLE, SWOT, TAM/SAM/SOM, and BCG Matrix.

davila7/markitdown

Convert files and office documents to Markdown. Supports PDF, DOCX, PPTX, XLSX, images (with OCR), audio (with transcription), HTML, CSV, JSON, XML, ZIP, YouTube URLs, EPubs and more.

davila7/mermaid-diagram-specialist

Mermaid diagram specialist for creating flowcharts, sequence diagrams, ERDs, and architecture visualizations

davila7/mobile-design

Mobile-first design thinking and decision-making for iOS and Android apps. Touch interaction, performance patterns, platform conventions. Teaches principles, not fixed values. Use when building React Native, Flutter, or native mobile apps.

davila7/prompt-engineer

Expert in designing effective prompts for LLM-powered applications. Masters prompt structure, context management, output formatting, and prompt evaluation. Use when: prompt engineering, system prompt, few-shot, chain of thought, prompt design.

davila7/remotion

Best practices and comprehensive guide for Remotion - programmatic video creation in React with animations, compositions, and media handling

davila7/scientific-slides

Build slide decks and presentations for research talks. Use this for making PowerPoint slides, conference presentations, seminar talks, research presentations, thesis defense slides, or any scientific talk. Provides slide structure, design templates, timing guidance, and visual validation. Works with PowerPoint and LaTeX Beamer.

関連スキル