PyGiCo
~ Seamless ComfyUI Integration ~
[🌐 Website] • [🐱 GitHub] [🐦 Twitter] • [🍀 Official Blog]
[!IMPORTANT] このリポジトリのリリースノートやREADME、コミットメッセージの9割近くはclaude.aiやChatGPT4を活用したAIRA, SourceSage, Gaiah, HarmonAI_IIで生成しています。
PyGiCo とは
PyGiCo-ImageGenは、Python、GIMP、ComfyUIを使用して、ブログコンテンツから画像を生成し、テキストを追加するツールです。
機能
- ブログ記事からの内容抽出
- 抽出されたコンテンツに基づく画像生成プロンプトの作成
- ComfyUIを使用した高品質な画像生成
- GIMPを利用した画像へのテキスト追加
- コマンドラインインターフェース(CLI)とPythonパッケージの両方をサポート
- ワークフローのカスタマイズと設定管理
デモ動画
https://github.com/user-attachments/assets/7e5d4d97-1461-4484-9552-7488d04c701b
構成
PyGiCoはモジュール構造を採用し、以下の主要コンポーネントで構成されています。
- content_analysis:
blog_extractor.py: ブログ記事からコンテンツを抽出します。prompt_generator.py: 抽出されたコンテンツに基づいて画像生成プロンプトを作成します。
- image_generation:
comfy_interface.py: ComfyUIと連携して画像を生成します。
- image_processing:
gimp_executor.py: GIMPを使用して画像にテキストを追加します。
- utils:
config_manager.py: 環境変数や設定ファイルから設定を読み込みます。
インストール
pip install pygico-imagegen
使用方法
コマンドラインインターフェース
pygico-imagegen --blog path/to/blog.txt --output output.png --text "追加するテキスト"
Pythonパッケージとして
from pygico_imagegen import BlogExtractor, PromptGenerator, ComfyInterface, GimpExecutor
extractor = BlogExtractor("path/to/blog.txt")
content = extractor.extract()
generator = PromptGenerator()
prompt = generator.generate(content)
comfy = ComfyInterface()
image = comfy.generate_image(prompt)
gimp = GimpExecutor()
gimp.add_text(image, "追加するテキスト", "output.png")
設定
PyGiCoは環境変数または設定ファイルから設定を読み込みます。
- 環境変数:
.envファイルまたはシステム環境変数で設定 - コンフィグファイル:
~/.config/pygico-imagegen/config.jsonに配置
Example
PyGiCoを実際に使用するための手順を以下に示します。
前提条件
- ComfyUIのインストール: ComfyUIのインストールガイドに従って、ComfyUIをインストールしてください。
- GIMPのインストール: GIMPのダウンロードページからGIMPをダウンロードしてインストールしてください。
実行環境の準備
- PyGiCoのインストール: 上記のインストール手順に従ってPyGiCoをインストールします。
- ComfyUIの起動: ComfyUIを起動し、APIが有効になっていることを確認します。
- GIMPの実行ファイルパスを確認: GIMPの実行ファイルパス(例:
C:\Program Files\GIMP 2\bin\gimp-console-2.10.exe)を確認し、必要であれば設定ファイルに指定します。
実行例
1. CLI を使用した実行例
pygico-imagegen --blog example/blog.txt --output output.png --text "追加するテキスト"
2. Python スクリプトを使用した実行例
cd example
python python_usage.py
開発者向け情報
1. リポジトリのクローン:
git clone https://github.com/yourusername/pygico-imagegen.git
cd pygico-imagegen
2. 開発用依存関係のインストール:
pip install -e .[dev]
3. テストの実行:
pytest
poetry cache clear pypi --all
poetry update
poetry add pygimp-labs
poetry add --group dev C:\Prj\PyGIMP
ライセンス
このプロジェクトはMITライセンスの下で公開されています。詳細は LICENSE ファイルを参照してください。
コントリビューション
バグ報告、機能リクエスト、プルリクエストを歓迎します。大きな変更を加える前に、まずissueを開いて議論してください。
Metadata
Release files for pygico-imagegen 0.1.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pygico_imagegen-0.1.5.tar.gz | 13.3 kB | Without provenance | Details for pygico_imagegen-0.1.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pygico_imagegen-0.1.5-py3-none-any.whl | Python 3 | none | any | Details for pygico_imagegen-0.1.5-py3-none-any.whl |
Total release size: 26.1 kB
Release files / pygico_imagegen-0.1.5.tar.gz
| Download URL | pygico_imagegen-0.1.5.tar.gz |
|---|---|
| Size | 13.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
17b70ea4c7d9616056892500658de414b83f9803a3ce7d7904bfab4ca4848ded
|
|
BLAKE2b-256 checksum How to use checksums |
3d4320ce56cc7a60789a9bdec27e7fa913eb4ebc42c007536e56ba0659aba97d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.1.0 CPython/3.12.4
|
Release files / pygico_imagegen-0.1.5-py3-none-any.whl
| Download URL | pygico_imagegen-0.1.5-py3-none-any.whl |
|---|---|
| Size | 12.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8724b9fb96f72d5066fb091cbb64a9b19061db2a7601b61e31fb9ddfe0800e16
|
|
BLAKE2b-256 checksum How to use checksums |
fdc4baa3f8fc9efbedb421401b700c54fa4fd61dc703424e1206cbc919ceafbf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.1.0 CPython/3.12.4
|
Security for pygico-imagegen 0.1.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.