Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Bottom Panel Tabs API を使って ComfyUI の下部パネルにカスタムタブを追加します。インタラクティブ要素、React コンポーネント、スタンドアロン登録を含みます。
app.registerExtension({ name: "MyExtension", bottomPanelTabs: [ { id: "customTab", title: "カスタムタブ", type: "custom", render: (el) => { el.innerHTML = '<div>これは私のカスタムタブの内容です</div>'; } } ] });
id
title
type
{ id: string, // タブの固有識別子 title: string, // タブ上に表示されるタイトル type: string, // タブの種類(通常は "custom") icon?: string, // アイコンクラス名(任意) render: (element) => void // タブのコンテンツを描画する関数 }
render
app.registerExtension({ name: "InteractiveTabExample", bottomPanelTabs: [ { id: "controlsTab", title: "コントロール", type: "custom", render: (el) => { el.innerHTML = ` <div style="padding: 10px;"> <button id="runBtn">ワークフローを実行</button> </div> `; // イベントリスナーを追加 el.querySelector('#runBtn').addEventListener('click', () => { app.queuePrompt(); }); } } ] });
// 拡張機能内で React の依存関係をインポート import React from "react"; import ReactDOM from "react-dom/client"; // 単純な React コンポーネント function TabContent() { const [count, setCount] = React.useState(0); return ( <div style={{ padding: "10px" }}> <h3>React コンポーネント</h3> <p>カウント: {count}</p> <button onClick={() => setCount(count + 1)}>増加</button> </div> ); } // React コンテンツを含む拡張機能を登録 app.registerExtension({ name: "ReactTabExample", bottomPanelTabs: [ { id: "reactTab", title: "React タブ", type: "custom", render: (el) => { const container = document.createElement("div"); container.id = "react-tab-container"; el.appendChild(container); // React コンポーネントをマウント ReactDOM.createRoot(container).render( <React.StrictMode> <TabContent /> </React.StrictMode> ); } } ] });
registerExtension
app.extensionManager.registerBottomPanelTab({ id: "standAloneTab", title: "スタンドアロンタブ", type: "custom", render: (el) => { el.innerHTML = '<div>このタブは独立して登録されました</div>'; } });