Image Generateのロゴ

Image Generate

コミュニティ
sagirimo
image-generate

Generate scientific illustrations (graphical abstracts, mechanism schematics, cover art, poster art) from a text prompt through the image provider configured in the BioDSH app. Not for data plots.

概要

公開者sagirimo
リポジトリBioDSH
スキル名image-generate
スター
65
フォーク
2
同梱ファイル
2
ライセンスMIT
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 2個の同梱ファイル

    モデルが作業中に読み取れるスクリプト、テンプレート、参考資料です。ファイルは読み取り専用で、実行されることはありません。

  • オープンソース

    sagirimoがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキル「Image Generate」をTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/sagirimo/BioDSH/tree/main/biodsh-core/skills/image-generate
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/sagirimo/BioDSH.git /tmp/BioDSH
mkdir -p .claude/skills
cp -r /tmp/BioDSH/biodsh-core/skills/image-generate .claude/skills/image-generate
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでImage Generateを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあるとすぐに、モデルが自動的にImage Generateを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Image Generateは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、スキルを使わない間は指示の読み込みにトークンを消費しません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

AI scientific illustration (text-to-image)

Use this skill when the user wants a picture that is drawn, not computed: a graphical abstract, a mechanism or pathway schematic, a cell/tissue cartoon, journal cover art, a poster hero image, a conceptual figure for a talk.

Do not use it for data plots (UMAP, volcano, heatmap, bar/box plots, survival curves). Those must come from the data through matplotlib/seaborn/scanpy so that every point is real. An image model cannot plot data; it only paints something that looks like a plot.

Provider configuration

The provider is configured by the user in the BioDSH app under 更多 → 图像生成 (base URL, API key, model). The app passes it to this script as environment variables BIODSH_IMAGE_BASE_URL, BIODSH_IMAGE_API_KEY, BIODSH_IMAGE_MODEL. Any OpenAI-compatible Images API works (OpenAI gpt-image-1, 智谱 CogView cogview-4-250304, SiliconFlow Kwai-Kolors/Kolors, 通义万相 wan2.2-t2i-flash, ...).

If the script prints {"error": "...not configured..."}, tell the user to fill in 更多 → 图像生成 in the app. Never guess a base URL or key and never ask the user to paste a key into the chat.

Command

bash
python "<skill dir>/generate.py" --prompt "..." --out generated_images

Options: --name NAME (file stem, default: slug of the prompt + timestamp), --size 1024x1024 (normalized per provider, e.g. 智谱 accepts 1024x1024, 768x1344, 864x1152, 1344x768, 1152x864, 1440x720, 720x1440), --n 1 (number of variants), --style scientific|flat|photo|none (default scientific, prepends a style template to your prompt), --negative "..." (things to avoid), --reference path.png (OpenAI-style providers only; others return an error).

Output: generated_images/<name>-1.png (one file per variant) plus generation.json (prompt, final prompt, model, provider hostname, size, files, elapsed seconds). The script prints the same JSON to stdout. On failure it prints {"error": ...} and exits 1; report the error text to the user as-is (HTTP status and body excerpt are included) and do not retry in a loop.

Writing a good prompt for a scientific figure

State, in one or two sentences each:

  • Subject — the biological entities and the relationship between them: "a T cell contacting a tumor cell through PD-1/PD-L1, with a blocking antibody in between".
  • Style — the --style scientific template already asks for a clean vector-like illustration on a white background with flat colors; add only the deviations ("isometric", "watercolor", "dark background for a slide").
  • Layout — left-to-right flow, number of panels, where the arrows go, what is enlarged in an inset.
  • What to avoid — put it in --negative: "text, letters, watermark, photorealistic gore, extra limbs, cluttered background". Ask for no text whenever possible: models misspell gene names; add labels afterwards in PowerPoint/Illustrator.

Keep prompts concrete and short (under ~80 words). Generate 2–3 variants (--n 2) when the user is exploring, one when they know what they want. Iterate on wording rather than re-running the same prompt.

After generation

  • Report the absolute path of every PNG to the user and show the image if the interface supports it.
  • Remind the user to check the image for factual errors: image models invent labels, ligand/receptor pairs, organelle shapes and arrow directions. A generated schematic is a draft to be corrected, not a source of truth, and should be labelled as AI-generated in a manuscript where the journal requires it.
  • Record the prompt in the report (it is in generation.json) so the figure can be regenerated.

Examples

bash
# graphical abstract, two variants to choose from
python "<skill dir>/generate.py" --prompt "left: a tumor with infiltrating T cells; right: the same tumor after anti-PD-1 therapy with more T cells and shrinking tumor; arrow between them" --n 2 --out generated_images

# wide poster banner, 智谱 CogView accepts 1440x720
python "<skill dir>/generate.py" --prompt "cross-section of a lymph node with B-cell follicles and T-cell zones" --size 1440x720 --negative "text, letters" --out generated_images

# photo-like cover art
python "<skill dir>/generate.py" --prompt "close-up of a single neuron with glowing synapses on a dark background" --style photo --name cover --out generated_images

Chinese prompt tips

Most image models follow English prompts more reliably than Chinese ones (CogView and 万相 handle Chinese well; OpenAI and Kolors prefer English). When the user writes the request in Chinese, translate the subject/style/layout into a precise English prompt internally before calling the script, but keep all your replies, file descriptions and the summary in Chinese. Do not translate gene, protein or drug names — keep the standard symbols (PD-1, TP53, KRAS G12C). If the user wants Chinese characters inside the image, warn that most models render CJK text poorly and suggest adding the text afterwards.

同梱ファイル

スキルが読み込まれている間、モデルは必要に応じてこれらを読み取ります。読み取り可能なファイルとして提供され、実行されることはありません。

よくある質問

AIスキル「Image Generate」では何ができますか?

Generate scientific illustrations (graphical abstracts, mechanism schematics, cover art, poster art) from a text prompt through the image provider configured in the BioDSH app. Not for data plots.

TypingMindでImage Generateを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Image Generateはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにImage Generateをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/sagirimo/BioDSH/tree/main/biodsh-core/skills/image-generateを貼り付けてください。TypingMindがSKILL.mdを読み込み、関連ファイルをまとめて、チャットごとに有効にできるスキルとしてインストールします。

Image Generateを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストの内容がこのスキルの用途に合ったときに、このスキルを読み込めます。

Image Generateで使えるAIモデルの数に制限はありますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもImage Generateを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Image Generate」は無料ですか?

はい。sagirimoがMITライセンスのもとでGitHubに公開しています。ご利用のAIプロバイダーに支払うのは、使用したトークンの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇