{"id":35076783,"url":"https://github.com/raykitajima/flux1testapp","last_synced_at":"2026-05-23T07:04:28.034Z","repository":{"id":326381109,"uuid":"1105080863","full_name":"RayKitajima/FLUX1TestApp","owner":"RayKitajima","description":null,"archived":false,"fork":false,"pushed_at":"2025-11-27T12:31:14.000Z","size":29,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-01T08:00:05.790Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RayKitajima.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-27T05:32:39.000Z","updated_at":"2025-11-27T12:31:18.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/RayKitajima/FLUX1TestApp","commit_stats":null,"previous_names":["raykitajima/flux1testapp"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/RayKitajima/FLUX1TestApp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RayKitajima%2FFLUX1TestApp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RayKitajima%2FFLUX1TestApp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RayKitajima%2FFLUX1TestApp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RayKitajima%2FFLUX1TestApp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RayKitajima","download_url":"https://codeload.github.com/RayKitajima/FLUX1TestApp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RayKitajima%2FFLUX1TestApp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33386079,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-23T04:15:53.637Z","status":"ssl_error","status_checked_at":"2026-05-23T04:15:53.242Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-12-27T12:12:47.744Z","updated_at":"2026-05-23T07:04:28.028Z","avatar_url":"https://github.com/RayKitajima.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FLUX.1 [schnell] Text‑to‑Image + LoRA Testアプリ\n\n🤗 Diffusers を使って **`black-forest-labs/FLUX.1-schnell`** をローカルで動かす、シンプルなクライアント / サーバーアプリです。  \nReact 製のフロントエンドと、FastAPI 製のバックエンド、さらにオプションで **LoRA** に対応しています。\n\n- **バックエンド:** FastAPI (`flux-server/server.py`)\n- **フロントエンド:** React + Vite (`flux-app/`)\n- **ベースモデル:** `black-forest-labs/FLUX.1-schnell`（Hugging Face 上でライセンス承認が必要）\n\n## 1. flux-server\n\nプロジェクトルートから:\n\n```bash\ncd flux-server\n\npython -m venv .venv\nsource .venv/bin/activate\n\npip install -r requirements.txt\n````\n\nFLUX.1 のモデルはサーバ起動時にダウンロードされますが、**事前にライセンスに同意しておく必要** があります。\n\n1. HaggingFace → ログイン → [settings/tokens](https://huggingface.co/settings/tokens) → Token発行\n2. HaggingFace → [black-forest-labs/FLUX.1-schnell](https://huggingface.co/black-forest-labs/FLUX.1-schnell/tree/main) → Files \u0026 versions → Agree\n3. コマンドラインから `(.venv)$ huggingface-cli login` → Tokenを入力\n\nAPI の起動:\n\n```bash\nuvicorn server:app --host 0.0.0.0 --port 8000\n```\n\n動作確認:\n\n* [http://localhost:8000/health](http://localhost:8000/health)\n  → `{\"status\": \"ok\", ...}` のような JSON が返ってくれば OK です。\n\n## 2. flux-app\n\n別のターミナルで、プロジェクトルートから:\n\n```bash\ncd flux-app\nnpm install\nnpm run dev\n```\n\nブラウザで以下にアクセス:\n\n* [http://localhost:5173](http://localhost:5173)\n\nフロントエンドは `http://localhost:8000` のバックエンドと通信するよう設定済みです。\n\n## 3. 使い方\n\n1. **バックエンド** を起動（`uvicorn ...` ポート `8000`）。\n2. **フロントエンド** を起動（`npm run dev -- --port 5173`）。\n3. ブラウザで **[http://localhost:5173](http://localhost:5173)** を開く。\n\n左側のフォーム:\n\n* **Prompt**\n  生成したい画像のテキスト説明。\n* **Width / Height**\n  解像度（256–1536 px）。デフォルトは 768×768。\n* **Inference steps**\n  1–4。FLUX.1 [schnell] はこの範囲に最適化されています。\n* **Max sequence length**\n  トークン長の上限。通常は 256 のままで OK。\n* **# Images**\n  一度に生成する画像枚数（1–4）。\n* **Seed**\n  乱数シード。空欄なら毎回ランダム、数値を入れると再現性のある結果に。\n* **Output format**\n  PNG または JPEG。\n* **LoRA**（任意）\n  LoRA を使う場合に入力します（例は後述）。\n\n右側の結果パネル:\n\n* モデル名、デバイス、解像度、ステップ数、使用中の LoRA（あれば）を表示\n* 生成された画像の一覧\n\n  * それぞれのシード値（あれば）\n  * 各画像のダウンロードリンク\n\n\u003e LoRA を使わずベースモデルだけ試したい場合は、LoRA の入力欄をすべて空にしておきます。\n\n## 4. LoRA の使い方とサンプル\n\nフォーム内の **LoRA** セクションには、次の 3 つのフィールドがあります:\n\n* **LoRA model (repo or path)**\n  Hugging Face のリポジトリ ID（例: `user/repo`）またはローカルディレクトリのパス。\n\n* **LoRA weight file**（任意）\n  LoRA の重みファイル名（**拡張子 `.safetensors` まで含めたフルファイル名**）。\n  例: `my-style-lora.safetensors`\n  空欄の場合、diffusers 側のデフォルトが使われるケースもあります。\n\n* **LoRA strength**\n  LoRA の強さ。\n\n  * `0.0` … ほぼ効果なし\n  * `1.0` … 標準の強さ\n  * `0.7–1.3` あたりを中心に調整するのがおすすめ\n\n**LoRA model** が空欄のときは LoRA は適用されません。\n\n\u003e なるべく **FLUX.1-schnell 用に学習された LoRA** を使うと結果が安定します。\n\n## 5 LoRA サンプル一覧\n\n下記は、UI の **LoRA** 入力欄にそのまま使えるサンプルです。  \n各行には **LoRA の指定方法** と **実際に生成テストした際のプロンプト例** を記載しています。\n\n| スタイル            | LoRA model                              | LoRA weight file                             | プロンプト例 |\n|---------------------------|-----------------------------------------|----------------------------------------------|--------------|\n| フォトリアリスティック | `hugovntr/flux-schnell-realism`        | `schnell-realism_v2.3.safetensors` または `schnell-realism_v1.safetensors` | *A cozy, moody kitchen at dusk, warm golden lighting, ultra detailed, 35mm photography* |\n| フィギュア風 | `p1atdev/flux.1-schnell-pvc-style-lora` | `pvc-shnell-7250+7500.safetensors`           | *pvc figure, nendoroid, cute anime girl with blue hair standing in a cozy bedroom, soft lighting, full body* |\n| ポートレート | `Octree/flux-schnell-lora`             | `flux-schnell-lora.safetensors`              | *A beautiful woman with a slight warm smile in a bustling cafe, 4k, be4u7y* |\n\n\u003e **LoRA weight file** は必ず `.safetensors` まで含めた名前で入力してください。\n\n## 6. トラブルシューティング\n\n* **モデルアクセスのエラー（401 / 403 など）**\n\n  Hugging Face で `black-forest-labs/FLUX.1-schnell` のページを開き、\n  利用規約に同意してから再度実行してください。\n\n* **LoRA 読み込みエラー**\n\n  * LoRA のリポジトリ ID が正しいか (`hugovntr/flux-schnell-realism` など)。\n  * weight file 名が **完全一致** しているか（拡張子 `.safetensors` を含む）。\n  * その LoRA が FLUX.1-schnell 向けか、モデルカードを確認してください。\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraykitajima%2Fflux1testapp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fraykitajima%2Fflux1testapp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraykitajima%2Fflux1testapp/lists"}