最近Stable Diffusionの派生形として、Kolorsというモデルが発表されたらしいです。ComfyUI拡張がリリースされてから一週間くらいたってるのでちょっと出遅れた感がありますが、試してみようと思います。
公式リポジトリは↓
Kolorsとは
公式から公開されている論文形式のレポートは↓
一言で説明してしまうとSDXLをベースに、Text EncoderだけGLM(具体的にはChatGLM3)に置き換えたモデルです。視覚的評価とプロンプト理解の2つの面で高い評価が得られたそうです。
UNetはそのままなので、画像生成に対する表現力は元のStable Diffusionと同じはずですが、視覚的評価についても高い評価になっている点は驚きを感じます。CLIPの言語理解能力がボトルネックになってたのでしょうか...?
加えて文字生成能力も備わっているようで、英語・中国語(ChatGLM3の対応言語)であれば短い単語を生成可能だそうです。Stable Diffusion 3でも文字生成能力が話題になっていたため、共通項を考えるとText Encoderの性能を上げて文章を理解できるようにすると文字生成しやすくなるのかもしれません。(とするとGLMではなくSD3で使用しているT5で十分なんじゃ??っていう疑惑も出てきます...)
Stable Diffusionについては↓で説明しているので、何が何やらって方は読んでみると理解が深まるかもしれません
ComfyUIでKolorsを試す手順
1. ComfyUIの導入
以下のどちらかの方法でComfyUIを導入します。
方法1:ComfyUIを直接導入する
初めての方はこちらで良いと思います。
Stable Diffusionの簡単インストールガイド:Windows、CLI、手動の各方法を徹底解説 - Otama's Playground
方法2:StabilityMatrix(統合環境)経由でインストールする
StabilityMatrixの導入方法:Stable Diffusion関連ツールを効率的に管理 - Otama's Playground
2. 拡張をインストール
Kolors用の拡張をComfyUIにインストールしてください。(Manager経由がラクです)
3. ワークフローのインポート
今回はexampleをそのまま貰ってきます。
4. モデルの設定
ChatGLM3モデルが結構VRAMを消費するので、下のテーブルを参考に選んでください。
Model | Size |
---|---|
fp16 | ~13 GB |
quant8 | ~8 GB |
quant4 | ~4 GB |
5. 生成する
モデルは初回生成時にダウンロードされます。
初回だけかなり時間を食うので、飯でも食いながら待ちましょう。
生成結果
生成結果1
文字生成を試してみます
プロンプト
A lively and cheerful anime-style character holding a piece of paper with the word 'love' written on it. The character is smiling brightly and is surrounded by vibrant, colorful backgrounds. The atmosphere is joyful and inviting, designed to attract and captivate viewers.
文字生成については、SD3同様に運ゲーです。
生成結果2
せっかくの高性能Text Encoderなので、”長め”のプロンプトを入れてみます。
A vibrant outdoor scene in a lively city park during a sunny day. The park is bustling with activity and full of cheerful people of all ages. In the foreground, a group of friends are having a picnic on a colorful blanket, laughing and enjoying various snacks and drinks. Nearby, children are playing games like tag and flying kites, their faces beaming with joy.
In the background, a beautiful fountain is surrounded by blooming flowers, adding to the lively ambiance. Couples are strolling hand-in-hand along the pathways, while others are riding bicycles and skateboards. Some people are sitting on benches, reading books or chatting animatedly with friends.
The trees are lush and green, casting dappled shadows on the ground, and birds are flying above or perched on branches. The sky is a bright blue with a few fluffy white clouds, and the sun is shining brightly, casting a warm and inviting glow over the entire scene.
Street performers are entertaining the crowd with music and dance, and a small ice cream cart is attracting a line of excited children. Signs with short words like 'Fun', 'Play', and 'Smile' are placed around the park. The ground has colorful chalk drawings with words like 'Joy' and 'Happy' written by children.
The overall atmosphere is one of happiness, energy, and community, making everyone feel welcome and engaged.
日本語訳
活気ある都市公園の賑やかなシーン。晴れた日で、年齢問わず楽しそうな人々でいっぱいです。前景では、友人たちがカラフルな毛布の上でピクニックを楽しんでおり、笑いながら様々なスナックや飲み物を味わっています。近くでは、子供たちが鬼ごっこや凧揚げをして遊び、喜びに満ちた顔をしています。
背景には、美しい噴水が咲き誇る花々に囲まれており、雰囲気を一層盛り上げています。カップルが手をつないで散歩したり、自転車やスケートボードに乗ったりする人々もいます。一部の人々はベンチに座って本を読んだり、友達と楽しく会話したりしています。
木々は青々と茂り、地面には斑入りの日陰を落とし、鳥たちが枝にとまったり飛んだりしています。空は明るい青色で、いくつかの白い雲が浮かび、太陽が輝いて暖かく心地よい光を全体に注いでいます。
ストリートパフォーマーが音楽やダンスで観客を楽しませており、小さなアイスクリームカートには興奮した子供たちが列を作っています。公園内には「楽しい」「遊ぶ」「笑顔」といった短い言葉の看板が設置されており、地面には子供たちが書いた「喜び」や「幸せ」といったカラフルなチョークの絵があります。
全体の雰囲気は、幸福、活気、そしてコミュニティの一体感に満ちており、誰もが歓迎され、楽しく過ごせる場所となっています。
詰め込みすぎるとさすがに全部は描写されないようです。
生成結果3
「吾輩は猫である」の最初2, 3段落ぐらいをそのまま食わせてみます(訳:ChatGPT)
I am a cat. I have no name yet. I have no idea where I was born. All I remember is crying "meow meow" in a damp and gloomy place. It was there that I first saw a human. Later, I learned that this human was the most vicious kind, known as a "student." It is said that students sometimes catch and boil us to eat. However, at that time, I had no particular thoughts and didn't find it frightening. When I was lifted up in his palm, I only felt a fluffy sensation. The first human face I ever saw was when I sat calmly in the palm and looked up. Even now, I remember thinking it was a strange thing. First, a face should be decorated with fur, but his was smooth like a kettle. Since then, I've met many cats, but I've never encountered such an odd one. Moreover, his face protruded too much in the middle, and from that hole, he occasionally blew smoke, which was quite choking. I later learned that this was something called a "tobacco" that humans smoke.
感情の描写などはさすがにできないようで、やさぐれた雰囲気と子猫、あとタバコ(煙)の要素だけが残りました
最後に
大規模言語モデルで必要VRAMが高くなってしまっているのが難点ですが、画像生成の性能は申し分なさそうです。文章理解能力を重視したい場合は選択肢としてアリなんじゃないかなと思います。
無料で試せるので気になった方はぜひ試してみてください。