🚀 Canopus-LoRA-Flux-Typography-ASCII
このモデルは、テキストを入力として画像を生成するLoRAモデルです。主にDiffusersライブラリを利用しており、特定のテキストプロンプトに基づいて、文字やASCIIアートを用いた独特な画像を生成します。
🚀 クイックスタート
このモデルはまだ学習段階にあり、最終バージョンではないため、アーティファクトが含まれる場合や性能が低い場合があります。
✨ 主な機能
- 特定のテキストプロンプトに基づいて、文字やASCIIアートを用いた画像を生成します。
- 学習パラメータを調整することで、生成される画像の品質やスタイルをコントロールできます。
📦 インストール
必要なライブラリのインポート
import torch
from pipelines import DiffusionPipeline
base_model = "black-forest-labs/FLUX.1-dev"
pipe = DiffusionPipeline.from_pretrained(base_model, torch_dtype=torch.bfloat16)
lora_repo = "prithivMLmods/Canopus-LoRA-Flux-Typography-ASCII"
trigger_word = "Realism"
pipe.load_lora_weights(lora_repo)
device = torch.device("cuda")
pipe.to(device)
app.pyの設定
import gradio as gr
gr.load("models/prithivMLmods/Canopus-LoRA-Flux-Typography-ASCII").launch()
pythonproject.pyの設定
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
import gradio as gr
def image_generator(prompt):
pass
interface = gr.Interface(fn=image_generator, inputs="text", outputs="image")
app = FastAPI()
app.add_middleware(
CORSMiddleware,
allow_origins=["*"],
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
app = gr.mount_gradio_app(app, interface, path="/")
💻 使用例
基本的な使用法
import torch
from pipelines import DiffusionPipeline
base_model = "black-forest-labs/FLUX.1-dev"
pipe = DiffusionPipeline.from_pretrained(base_model, torch_dtype=torch.bfloat16)
lora_repo = "prithivMLmods/Canopus-LoRA-Flux-Typography-ASCII"
trigger_word = "Realism"
pipe.load_lora_weights(lora_repo)
device = torch.device("cuda")
pipe.to(device)
prompt = "Typography, ASCII Art : A black and white monochrome photograph of a man's face. The man's head is covered in words, including \"Portrait by Ralph Ueltzhoeffer\" in the lower right corner of the frame. The background of the photograph is black, creating a stark contrast with the man's silhouette. The text is written in a crayon type type, adding a touch of depth to the image."
image = pipe(prompt).images[0]
image.show()
高度な使用法
prompt1 = "Typography, ASCII Art : A black and white monochrome photograph of a man's face. The man's head is covered in words, including \"Portrait by Ralph Ueltzhoeffer\" in the lower right corner of the frame. The background of the photograph is black, creating a stark contrast with the man's silhouette. The text is written in a crayon type type, adding a touch of depth to the image."
prompt2 = "Typography, ASCII Art: A grayscale, monochrome portrait of a woman’s face. The face is constructed entirely from delicate, hand-drawn lines of text. Phrases like \"Echoes of Silence\" appear throughout the image, with the text written in a rough, handwritten font style. The woman's expression is serene, while the background remains pitch black to amplify the contrast between the text and the face. The words fade in and out of her silhouette, blending seamlessly with the contours of her features, creating an almost ethereal, abstract effect."
prompts = [prompt1, prompt2]
images = pipe(prompts).images
for image in images:
image.show()
📚 詳細ドキュメント
モデルの説明
prithivMLmods/Canopus-LoRA-Flux-Typography-ASCII
属性 |
详情 |
モデルタイプ |
LoRA(Low-Rank Adaptation) |
ベースモデル |
black-forest-labs/FLUX.1-dev |
ラベリング |
wd-v1-4-vit-tagger-v2 |
学習に使用した画像数 |
30枚以上(高解像度) |
画像処理パラメータ
パラメータ |
値 |
LRスケジューラ |
constant |
オプティマイザ |
AdamW |
ネットワーク次元 |
64 |
ネットワークアルファ |
32 |
エポック数 |
15 |
ノイズオフセット |
0.03 |
マルチレゾリューションノイズ割引 |
0.1 |
マルチレゾリューションノイズ反復回数 |
10 |
繰り返しとステップ数 |
23 & 1K+ |
Nエポックごとに保存 |
1 |
トリガープロンプト
以下のようなトリガープロンプトを使用して画像生成をトリガーできます。
- Typography, ASCII Art : A black and white monochrome photograph of a man's face. The man's head is covered in words, including "Portrait by Ralph Ueltzhoeffer" in the lower right corner of the frame. The background of the photograph is black, creating a stark contrast with the man's silhouette. The text is written in a crayon type type, adding a touch of depth to the image.
- Typography, ASCII Art: A grayscale, monochrome portrait of a woman’s face. The face is constructed entirely from delicate, hand-drawn lines of text. Phrases like "Echoes of Silence" appear throughout the image, with the text written in a rough, handwritten font style. The woman's expression is serene, while the background remains pitch black to amplify the contrast between the text and the face. The words fade in and out of her silhouette, blending seamlessly with the contours of her features, creating an almost ethereal, abstract effect.
- Typography, ASCII Art: A black-and-white monochrome image of a man in profile, with his face outlined by intricately layered words. The words "Time Stands Still" and "Art by David Carson" are woven into the contours of his features. The text is styled in a distressed, stencil-like typeface, giving the piece a raw, edgy feel. The background is entirely black, making the white text stand out, with some words blending softly into the edges of the man's silhouette, creating a haunting, dreamlike effect. The typography adds texture, merging with the photograph to form a striking visual portrait.
トリガーパラメータ
パラメータ |
値 |
プロンプト |
Typography, ASCII Art : A black and white monochrome photograph of a man's face. The man's head is covered in words, including "Portrait by Ralph Ueltzhoeffer" in the lower right corner of the frame. The background of the photograph is black, creating a stark contrast with the man's silhouette. The text is written in a crayon type type, adding a touch of depth to the image. |
サンプラー |
euler |
トリガーワード
画像生成をトリガーするには、Typography
と ASCII Art
を使用する必要があります。
モデルのダウンロード
このモデルの重みはSafetensors形式で利用可能です。
ダウンロード は、Files & versionsタブから行えます。
📄 ライセンス
このモデルは、creativeml-openrail-mライセンスの下で提供されています。