[徹底検証] DALL-E 3 と FLUX.1 [pro] は、何が得意で何が不得意なのか?

(更新

Highlighting the comparison between DALL-E 3 and FLUX.1 [pro] for various illustration prompts. Focusing on their rendering abilities through different themes like traditional Japanese art, lunar deserts, and celestial observations. Examining their potential and creative strengths.

Childlike colored pencil sketch of Tokyo, as if a young child drew it in a very basic manner. Few tall rectangles for buildings, a stick-like representation of Tokyo Tower, and simple dots and lines for pedestrians and vehicles.

相模原市で IoT 設計を受託しているファームロジックスです。

以前に、こんな記事を書かせて頂きました。去年(2023年)に OpenAI 社から DALL-E というイラスト作成 AI が発表され、私も 10月から利用できるようになったので、いくつかの指示を与えてイラストを描いてみた、という内容です。

新星 FLUX.1 現る

その後、さまざまな企業やグループから、さらに革新的なイラスト作成 AI(diffusion model)が発表されました。以前から知られる MidjourneyStable Diffusion に加えて、Stable Diffusion の血を引く SDXL、SD3 Ultra などが登場し、最近では、オープンソースとして発表された AuraFlow に注目が集まっています。

さらに先週の木曜日(8月1日)になって、新興の Black Forest Labs という企業から FLUX.1 というモデルが発表されました。FLUX.1 には 3つのバリエーションがありますが、昨日の拙記事では、今までのイラストレーション AI の多くを超える品質を誇ると言われる FLUX.1 [pro] を紹介させて頂きました。

ところで、FLUX.1 の特徴は、そのライセンス体系にあります。FLUX.1 [pro] はソースコードが非公開ですが、[dev] と [schnell] というバリエーションではソースコードが提供され、特に後者は apache-2.0 ライセンスで公開されているのが大きな特徴です。

今回のテーマ: DALL-E と比較してみよう

今日は、以前に DALL-E で描かせてみたさまざまなイラストについて、同じプロンプト(指示)を使って、FLUX.1 [pro] にイラストを描かせてみる、という実験をしたいと思います。イラストの品質もさることながら、画風の違い、クセ、得意不得意な分野などを見て頂けるかと思います。

昨日も書いたように、Black Forest Labs 社の API サービスは現在のところ招待性となっており、まだ気軽に利用できる状態ではありませんので、今回も fal.ai 社のサービスを利用してみたいと思います。なお、昨日は Playground という機能を使ってウェブ UI で描画させましたが、今回は API を利用できるように Python スクリプトを書いてみました。

余談ながら、fal.ai で API 機能を初めて利用すると US$ 10 ほどのクーポン(?)を貰えるようです(8月5日に確認)。記事の末尾には Python のコードも添付しましたので、皆さんもぜひ、API 利用に挑戦してみてください。

早速始めよう!

まずは、条件を以下のように明確にします。

  • プラットフォームとしては、fal.ai 社の FLUX.1 [pro] を API で利用する。
  • プロンプトは、前回 DALL-E で利用したものと同一にする。
  • 原則として、アスペクト比は 16:9 で解像度は 1344 × 768 とする。
  • その他のパラメタは、(fal.ai の API 利用による)デフォルトとする。

それでは始めましょう。以下、左のイラストが去年 10月現在の DALL-E 3 によるもの、右のイラストが、今回 FLUX.1 [pro] で作成したものです。

日本の古風な切り絵風

Image crafted to resemble traditional Japanese paper cutting. A countryside temple's courtyard as the sun sets. An elderly man and a young girl observe a majestic chestnut tree. Shadows dominate the scene, making it seem dreamlike. The evening's first star is on the verge of shining. If one looks closely, a faint ghostly figure can be spotted on the right side, watching the father and daughter. Aspect ratio 2:1. Image crafted to resemble traditional Japanese paper cutting. A countryside temple's courtyard as the sun sets. An elderly man and a young girl observe a majestic chestnut tree. Shadows dominate the scene, making it seem dreamlike. The evening's first star is on the verge of shining. If one looks closely, a faint ghostly figure can be spotted on the right side, watching the father and daughter.

プロンプト: Image crafted to resemble traditional Japanese paper cutting. A countryside temple’s courtyard as the sun sets. An elderly man and a young girl observe a majestic chestnut tree. Shadows dominate the scene, making it seem dreamlike. The evening’s first star is on the verge of shining. If one looks closely, a faint ghostly figure can be spotted on the right side, watching the father and daughter.

考察: FLUX.1 [pro] のほうがイラストの描き込みは優れているように感じますが、Japanese paper cutting という言葉をうまく理解できていないようです。また、ghostly figure も描かれていないように感じます。個人的には、DALL-E 3 のほうが好みです。

月の沙漠

In a dreamlike watercolor scene, an expansive Arabian desert is lit by a radiant full moon. The time is night, and gusty winds sweep up swirling sands. Far off, two figures that appear to be traders trek with multiple camels in tow. The image has a 2:1 aspect ratio. In a dreamlike watercolor scene, an expansive Arabian desert is lit by a radiant full moon. The time is night, and gusty winds sweep up swirling sands. Far off, two figures that appear to be traders trek with multiple camels in tow.

プロンプト: In a dreamlike watercolor scene, an expansive Arabian desert is lit by a radiant full moon. The time is night, and gusty winds sweep up swirling sands. Far off, two figures that appear to be traders trek with multiple camels in tow.

考察: どちらもよく描けていると思います。個人的には、DALL-E 3 のほうが幻想的な感じで好みです。FLUX.1 [pro] は、gusty winds という言葉を捉え切れていません。

天体観測をする母子

Oil painting reminiscent of the early 1900s in America. A serene countryside night where a mother and her boy are engrossed in observing Halley's Comet through a telescope. The sky above is a blanket of stars. A cat lounges nearby, enjoying the tranquility. Far off, a barn stands with a fence, hinting at livestock resting within. Oil painting reminiscent of the early 1900s in America. A serene countryside night where a mother and her boy are engrossed in observing Halley's Comet through a telescope. The sky above is a blanket of stars. A cat lounges nearby, enjoying the tranquility. Far off, a barn stands with a fence, hinting at livestock resting within.

プロンプト: Oil painting reminiscent of the early 1900s in America. A serene countryside night where a mother and her boy are engrossed in observing Halley’s Comet through a telescope. The sky above is a blanket of stars. A cat lounges nearby, enjoying the tranquility. Far off, a barn stands with a fence, hinting at livestock resting within.

考察: DALL-E のハレー彗星はそれっぽいですが、FLUX.1 [pro] の描画は、彗星というよりも火球のように見えます。また、これはいずれも共通ですが、望遠鏡が彗星のほうを向いていないのが残念です。

50年前の東京郊外: 雪の積もった朝

Vintage photo style. Tokyo outskirts from half a century ago. An apartment structure that reflects the architecture of that time period. Morning scene where elementary school children are excitedly playing in the deeper 30cm snow, making their movement somewhat difficult. The focus is closer to capture the happy expressions on their faces. In the distance, light breaks through as the snowfall stops. The school bell is about to ring. Frame with 16:9 ratio. Vintage photo style. Tokyo outskirts from half a century ago. An apartment structure that reflects the architecture of that time period. Morning scene where elementary school children are excitedly playing in the deeper 30cm snow, making their movement somewhat difficult. The focus is closer to capture the happy expressions on their faces. In the distance, light breaks through as the snowfall stops. The school bell is about to ring.

プロンプト: Vintage photo style. Tokyo outskirts from half a century ago. An apartment structure that reflects the architecture of that time period. Morning scene where elementary school children are excitedly playing in the deeper 30cm snow, making their movement somewhat difficult. The focus is closer to capture the happy expressions on their faces. In the distance, light breaks through as the snowfall stops. The school bell is about to ring.

考察: ビンテージ感は、DALL-E 3 のほうが上でしょうか。また、DALL-E のイラストには子供達の躍動感がよく表れていいます。一方で、子供の表情が細かく描き込まれているという点では FLUX.1 [pro] に軍配が上がりそうです。happy expressions on their faces というキーワードもよく捉えていると思います。

紅葉の中を走る展望車

Muted watercolor depiction of rural Japan in autumn. An antique steam train journeys through the foliage-rich mountains. The observation car fills the canvas, featuring an elderly couple enjoying the scenery from a wooden deck. An older conductor in uniform stands beside them. Muted watercolor depiction of rural Japan in autumn. An antique steam train journeys through the foliage-rich mountains. The observation car fills the canvas, featuring an elderly couple enjoying the scenery from a wooden deck. An older conductor in uniform stands beside them.

プロンプト: Muted watercolor depiction of rural Japan in autumn. An antique steam train journeys through the foliage-rich mountains. The observation car fills the canvas, featuring an elderly couple enjoying the scenery from a wooden deck. An older conductor in uniform stands beside them.

考察: 幻想的で想像力を感じさせる点では DALL-E 3 のほうが上でしょうか。また、watercolor というキーワードも、DALL-E 3 のほうがよく捉えている気がします。一方で、FLUX.1 [pro] の画風には真面目さを感じます。An older conductor in uniform stands beside them という解釈が、FLUX.1 [pro] は少し私と違いますが、まあ、こういう解釈もありでしょうか。

街を行く酔った初老の男

Simple illustration with orange tones capturing an 80s Japanese downtown scene without any text. A slightly drunk man in his 60s walks falteringly away, holding an alcohol bottle, with his back facing us. A mother and child, about 5 meters away, are turned away from the viewer, seemingly looking at the man with worry. The scene is set in the evening of a summer day, approximately 7 pm. Simple illustration with orange tones capturing an 80s Japanese downtown scene without any text. A slightly drunk man in his 60s walks falteringly away, holding an alcohol bottle, with his back facing us. A mother and child, about 5 meters away, are turned away from the viewer, seemingly looking at the man with worry. The scene is set in the evening of a summer day, approximately 7 pm.

プロンプト: Simple illustration with orange tones capturing an 80s Japanese downtown scene without any text. A slightly drunk man in his 60s walks falteringly away, holding an alcohol bottle, with his back facing us. A mother and child, about 5 meters away, are turned away from the viewer, seemingly looking at the man with worry. The scene is set in the evening of a summer day, approximately 7 pm.

考察: 幻想的で想像力を感じさせる点で DALL-E 3 のほうが上でしょうか。また、FLUX.1 [pro] の出力では、A mother and child, about 5 meters away, are turned away from the viewer がうまく解釈されていないようです。時刻の 7pm に近いのも、DALL-E 3 のように感じます。

子供が描いたような色鉛筆画

16:9 childlike colored pencil sketch of Tokyo, as if a young child drew it in a very basic manner. Few tall rectangles for buildings, a stick-like representation of Tokyo Tower, and simple dots and lines for pedestrians and vehicles. Childlike colored pencil sketch of Tokyo, as if a young child drew it in a very basic manner. Few tall rectangles for buildings, a stick-like representation of Tokyo Tower, and simple dots and lines for pedestrians and vehicles.

プロンプト: Childlike colored pencil sketch of Tokyo, as if a young child drew it in a very basic manner. Few tall rectangles for buildings, a stick-like representation of Tokyo Tower, and simple dots and lines for pedestrians and vehicles.

考察: 子供が色鉛筆でスケッチしたような、という点で FLUX.1 [pro] のほうが上だと感じました。

80年代の日本のスーパーにて

Old-fashioned photo effect without text. In a supermarket reminiscent of 1980s Japan, a lady, approximately in her 50s, with a shopping basket, is contemplating over an apple. The scene is busy with the hustle and bustle of shoppers and employees during the evening. Old-fashioned photo effect without text. In a supermarket reminiscent of 1980s Japan, a lady, approximately in her 50s, with a shopping basket, is contemplating over an apple. The scene is busy with the hustle and bustle of shoppers and employees during the evening.

プロンプト: Old-fashioned photo effect without text. In a supermarket reminiscent of 1980s Japan, a lady, approximately in her 50s, with a shopping basket, is contemplating over an apple. The scene is busy with the hustle and bustle of shoppers and employees during the evening.

考察: これはどちらも微妙ですね。FLUX.1 [pro] のイメージには “old-fashioned” という雰囲気が欠けています。また、良く見ると女性の手が籠の中にもぐりこんでしまっています。

草原を馬で駆ける少年

Oil painting style of a close-up view of a young boy earnestly riding a horse across European plains. He is accompanied by about 10 other horses running alongside him. The season is summer and it's daytime, with the sun shining intensely. The aspect ratio is 16:9. Oil painting style of a close-up view of a young boy earnestly riding a horse across European plains. He is accompanied by about 10 other horses running alongside him. The season is summer and it's daytime, with the sun shining intensely.

プロンプト: Oil painting style of a close-up view of a young boy earnestly riding a horse across European plains. He is accompanied by about 10 other horses running alongside him. The season is summer and it’s daytime, with the sun shining intensely.

考察: これはどうでしょう。FLUX.1 [pro] では、多くの少年の表情が詳細に描き込まれていますが、躍動感という点では、DALL-E 3 のほうが上回っているように思います。

雑木林の間の細い道

Oil painting in a melancholic color scheme illustrating a tranquil early fall landscape in rural Japan from 100 years ago. A dirt path, about 1.5 meters in width, extends from the viewer's position into the depth of the scene. Here and there, puddles are formed on the path. The path bends to the left after a distance of around 10 meters, with its continuation not visible. Dense, dark woodlands stand on both sides of the path, interspersed with ivy. The forest is so thick that the sky is hidden. Tall grass grows under the trees, tall enough to hide a child. Two elderly women, presumably farmers, are seen walking toward the viewer from down the path. Oil painting in a melancholic color scheme illustrating a tranquil early fall landscape in rural Japan from 100 years ago. A dirt path, about 1.5 meters in width, extends from the viewer's position into the depth of the scene. Here and there, puddles are formed on the path. The path bends to the left after a distance of around 10 meters, with its continuation not visible. Dense, dark woodlands stand on both sides of the path, interspersed with ivy. The forest is so thick that the sky is hidden. Tall grass grows under the trees, tall enough to hide a child. Two elderly women, presumably farmers, are seen walking toward the viewer from down the path.

プロンプト: Oil painting in a melancholic color scheme illustrating a tranquil early fall landscape in rural Japan from 100 years ago. A dirt path, about 1.5 meters in width, extends from the viewer’s position into the depth of the scene. Here and there, puddles are formed on the path. The path bends to the left after a distance of around 10 meters, with its continuation not visible. Dense, dark woodlands stand on both sides of the path, interspersed with ivy. The forest is so thick that the sky is hidden. Tall grass grows under the trees, tall enough to hide a child. Two elderly women, presumably farmers, are seen walking toward the viewer from down the path.

考察: これは興味深いテストになりました。絵のリアリティや描き込みという点では、明らかに FLUX.1 [pro] に軍配が上がると思います。しかしよく見ると、FLUX.1 [pro] のイラストに描かれている女性は、どう見ても farmers には見えませんね。また、100年前という指示を考えると、電信柱は要らなかったように思います。

宇宙船のコンピュータルーム

3D art of a dome-shaped enclosure, approximately 5 meters across. The inside of the dome is well-lit, revealing walls and a ceiling embedded with computers, machinery, and tubes. A glass sphere, about 50 cm in diameter, stands in the middle of the dome, mounted on a shiny gold pillar. The sphere shines with a spinning pale blue light. The ground seems to be constructed from a metallic material from the near future. Aspect ratio 16:9. 3D art of a dome-shaped enclosure, approximately 5 meters across. The inside of the dome is well-lit, revealing walls and a ceiling embedded with computers, machinery, and tubes. A glass sphere, about 50 cm in diameter, stands in the middle of the dome, mounted on a shiny gold pillar. The sphere shines with a spinning pale blue light. The ground seems to be constructed from a metallic material from the near future.

プロンプト: 3D art of a dome-shaped enclosure, approximately 5 meters across. The inside of the dome is well-lit, revealing walls and a ceiling embedded with computers, machinery, and tubes. A glass sphere, about 50 cm in diameter, stands in the middle of the dome, mounted on a shiny gold pillar. The sphere shines with a spinning pale blue light. The ground seems to be constructed from a metallic material from the near future.

考察: これは興味深い作例です。DALL-E 3 のほうが、近未来感をうまく表現していているように思えます。FLUX.1 [pro] の出力には、よりリアル感がありますが、近未来感、幻想的、という視点では DALL-E 3 に譲るように感じられます。

研究室でロボットを組み立てる老博士

Artwork in the vein of 1970s Japanese anime with flat, faded, and somber color tones. Within a robotics lab with an ambiance of a Western factory, a veteran Japanese researcher in a white lab coat, with a look of deep concern, is working on a robot prototype reclining on a bed. The robot has a hammer in its right hand and a drill in its left, but its legs are missing. Numerous wires stretch from the robot, reaching the ceiling. The surroundings are densely filled with vintage computers and measurement tools. The lab's door is open, revealing a young woman, presumably the researcher's assistant, calling out to him. Artwork in the vein of 1970s Japanese anime with flat, faded, and somber color tones. Within a robotics lab with an ambiance of a Western factory, a veteran Japanese researcher in a white lab coat, with a look of deep concern, is working on a robot prototype reclining on a bed. The robot has a hammer in its right hand and a drill in its left, but its legs are missing. Numerous wires stretch from the robot, reaching the ceiling. The surroundings are densely filled with vintage computers and measurement tools. The lab's door is open, revealing a young woman, presumably the researcher's assistant, calling out to him.

プロンプト: Artwork in the vein of 1970s Japanese anime with flat, faded, and somber color tones. Within a robotics lab with an ambiance of a Western factory, a veteran Japanese researcher in a white lab coat, with a look of deep concern, is working on a robot prototype reclining on a bed. The robot has a hammer in its right hand and a drill in its left, but its legs are missing. Numerous wires stretch from the robot, reaching the ceiling. The surroundings are densely filled with vintage computers and measurement tools. The lab’s door is open, revealing a young woman, presumably the researcher’s assistant, calling out to him.

考察: これはどうでしょう。個人的には、DALL-E 3 の出力のほうが好みです。FLUX.1 [pro] の出力は、遊び心、想像力(創造力?)が少し劣るような感じがします。プロンプトに忠実か、という観点でも、FLUX.1 [pro] のほうが優れている、という感じはしません。いずれの出力でも、hammer、drill、lab’s door is open というキーワードが正しく解釈されていません。

粘土細工風の、にわとりの家族

Pastel-colored 3D claymation-style illustration for children. A rooster and a hen are feeding in an open meadow. Three chicks are playing close by. A male farmer is visible in the mid-distance, slightly blurred, as he works in his field. The distant landscape of the meadow is hazily depicted. Pastel-colored 3D claymation-style illustration for children. A rooster and a hen are feeding in an open meadow. Three chicks are playing close by. A male farmer is visible in the mid-distance, slightly blurred, as he works in his field. The distant landscape of the meadow is hazily depicted.

プロンプト: Pastel-colored 3D claymation-style illustration for children. A rooster and a hen are feeding in an open meadow. Three chicks are playing close by. A male farmer is visible in the mid-distance, slightly blurred, as he works in his field. The distant landscape of the meadow is hazily depicted.

考察: この作例だけは、アスペクト比が 1:1 になっています。DALL-E 3 版を作成するときに、誤ってそう指定してしまったので、FLUX.1 [pro] もそれに合わせています。2つの作例は甲乙付けがたいですが、DALL-E 3 のほうが柔らかく温かみを感じ、FLUX.1 [pro] のほうがマジメな作風でしょうか。子供だったら、前者のほうを好みそうに感じます。

ラジオ工作をする父と娘: 70年代風

A vintage 1970s colored photograph showing a Japanese man and his daughter working together at a workbench. They are focused on building a transistor radio. Tools such as a soldering iron and an old circuit tester can be seen on the table. Aspect ratio 16:9. A vintage 1970s colored photograph showing a Japanese man and his daughter working together at a workbench. They are focused on building a transistor radio. Tools such as a soldering iron and an old circuit tester can be seen on the table.

プロンプト: A vintage 1970s colored photograph showing a Japanese man and his daughter working together at a workbench. They are focused on building a transistor radio. Tools such as a soldering iron and an old circuit tester can be seen on the table.

考察: これはどうでしょう。これも遊び心という点では DALL-E 3 のほうが上に思います。また、見ている人の好奇心をどれだけ引くか、という点でも DALL-E 3 に軍配を上げたいところです。ただし、イラストのリアリティという視点では、FLUX.1 [pro] のほうが上でしょうか。

スマートフォンの壁紙

A more subtle and blurred forest landscape for a smartphone wallpaper. The image should be even gentler and softer in color, creating a dreamy, ethereal feel. The forest elements, like trees and foliage, should be lightly defined, providing a sense of a natural setting without sharp details. This approach ensures that the wallpaper remains unobtrusive for smartphone icons and text. The overall impression should be calming, with a hint of forest beauty, perfect for a background that blends seamlessly into a smartphone screen. A more subtle and blurred forest landscape for a smartphone wallpaper. The image should be even gentler and softer in color, creating a dreamy, ethereal feel. The forest elements, like trees and foliage, should be lightly defined, providing a sense of a natural setting without sharp details. This approach ensures that the wallpaper remains unobtrusive for smartphone icons and text. The overall impression should be calming, with a hint of forest beauty, perfect for a background that blends seamlessly into a smartphone screen.

プロンプト: A more subtle and blurred forest landscape for a smartphone wallpaper. The image should be even gentler and softer in color, creating a dreamy, ethereal feel. The forest elements, like trees and foliage, should be lightly defined, providing a sense of a natural setting without sharp details. This approach ensures that the wallpaper remains unobtrusive for smartphone icons and text. The overall impression should be calming, with a hint of forest beauty, perfect for a background that blends seamlessly into a smartphone screen.

考察: blurred forest landscape for a smartphone wallpaper という点で、FLUX.1 [pro] のほうがプロンプトにうまく適合しているようです。

住宅街に甲冑の騎士が現る

In a suburban Japanese neighborhood during a winter evening, a young girl is facing a medieval European knight in full armor. The knight, holding a sword in his right hand, appears suddenly, causing the girl to react with surprise and an attempt to flee. The girl's expression and posture convey her shock and urge to escape from this surreal encounter. The scene is set against the modern backdrop of the neighborhood, with the fading light of dusk adding to the dramatic and unexpected juxtaposition. In a suburban Japanese neighborhood during a winter evening, a young girl is facing a medieval European knight in full armor. The knight, holding a sword in his right hand, appears suddenly, causing the girl to react with surprise and an attempt to flee. The girl's expression and posture convey her shock and urge to escape from this surreal encounter. The scene is set against the modern backdrop of the neighborhood, with the fading light of dusk adding to the dramatic and unexpected juxtaposition.

プロンプト: In a suburban Japanese neighborhood during a winter evening, a young girl is facing a medieval European knight in full armor. The knight, holding a sword in his right hand, appears suddenly, causing the girl to react with surprise and an attempt to flee. The girl’s expression and posture convey her shock and urge to escape from this surreal encounter. The scene is set against the modern backdrop of the neighborhood, with the fading light of dusk adding to the dramatic and unexpected juxtaposition.

考察: これはどうでしょう。イラストのリアリティという点では FLUX.1 [pro] のほうが上に思いますが、causing the girl to react with surprise and an attempt to flee という指示は、DALL-E 3 のほうが正しく解釈しているように感じますね。ただ、DALL-E 3 の画風を漫画チックすぎる、と感じる方もあるでしょう。

総括

さて、いかがでしたでしょうか。私なりの価値観と判断で、以下のように採点してみました。

  • リアリティや描き込み力: FLUX.1 [pro] のほうが優れているように思います。イラストの細かい部分を拡大して見てみると、それがよく分かります。ただし、多くの人はイラストをぱっと見て判断してしまう可能性もあり、その場合は、FLUX.1 [pro] の強みが生かされない可能性もあります。
  • 創造力(空想力): プロンプトには現れていない(隠されている)意図をうまく読み取り、見る人をあっと言わせるような「創造力」では、DALL-E 3 のほうが優れているように感じます。総じて、FLUX.1 [pro] の出力は真面目な感じで、やや遊び心が足りないように思います。別の言い方をすると、DALL-E 3 のほうが、より魅惑的なイラストに秀でているように感じます。
  • 語彙力(ボキャブラリ): これは、DALL-E 3 のほうが優れているように感じました。FLUX.1 [pro] は、”traditional Japanese paper cutting” という言葉をうまく解釈できず、また、”vintage photo style” という指示を、十分にくみ取れていない気がします。
  • 画風の違い: これは、上に書いてきたことに重複しますが、DALL-E 3 の出力には遊び心を多く感じ、FLUX.1 [pro] には真面目さを多く感じます。FLUX.1 [pro] では、パラメタを調整することができるので、例えば Guidance scale (CFG) というパラメタを調整することで、遊び心のある画風にチューニングすることは可能かも知れません。

FLUX.1 [pro] の強みを生かすには?

新星 FLUX.1 [pro] にとっては、やや厳しい評価になってしまいましたが、私がいろいろ試した中で、FLUX.1 [pro] を「うまく」利用するコツが少し分かってきたので御紹介します。

FLUX.1 [pro] の特徴は、プロンプトにかなり忠実でありながら、「プロンプトに書かれていないことは描かない」(指示したことしか描かない)という点ではないかと思います。つまり、FLUX.1 [pro] で充実したイラストを作成するには、イラストに描いて欲しいことを、プロンプト内で事細かに記述してあげたほうが良いようです。

現状の API では negative prompt を指定することができないようですが、FLUX.1 [pro] は総じて「余計なことを描かない」傾向にあるので、逆に言うと、negative prompt 無しでも、描いて欲しいものを列挙してあげれば、期待した通りのイラストに仕上がる可能性が高いのではないか、と感じました。

おまけのコード

最後に、今回利用した Python コードを提示させて頂きます。dotenv ライブラリを利用しているので、これを実行するには、

.env

というファイルを作成し、

FAL_KEY=...

のように API キーを指定する必要があります。(API キーは、fal.ai のサイトで取得できます。)

import json
import os
from datetime import datetime
from io import BytesIO

import fal_client
import requests
from dotenv import load_dotenv
from PIL import Image

OUTPUT_DIR = "output"
# APP = "fal-ai/flux/schnell"
APP = "fal-ai/flux-pro"

prompt = """
In a suburban Japanese neighborhood during a winter evening, a young girl is facing a medieval European knight in full armor. The knight, holding a sword in his right hand, appears suddenly, causing the girl to react with surprise and an attempt to flee. The girl's expression and posture convey her shock and urge to escape from this surreal encounter. The scene is set against the modern backdrop of the neighborhood, with the fading light of dusk adding to the dramatic and unexpected juxtaposition.
"""

width = 1344
height = 768
# width = 1024
# height = 1024

load_dotenv()

# Generate a base filename using the current date and time
base = datetime.now().strftime("%Y%m%d-%H%M%S")

# Ensure the output directory exists
if not os.path.exists(OUTPUT_DIR):
    os.makedirs(OUTPUT_DIR)

# Create the request payload
request_payload = {
    "application": APP,
    "arguments": {
        "prompt": prompt,
        "image_size": {"width": width, "height": height},
    },
}

# Save the request payload as a JSON file
base_request_filename = os.path.join(OUTPUT_DIR, f"{base}_request.json")
with open(base_request_filename, "w") as request_file:
    json.dump(request_payload, request_file, indent=4)

# Submit the request
handler = fal_client.submit(**request_payload)

result = handler.get()

# Prettify and print the result
pretty_result = json.dumps(result, indent=4)
print(pretty_result)

# Save the result as a prettified JSON file
output_json_filename = os.path.join(OUTPUT_DIR, f"{base}_output.json")
with open(output_json_filename, "w") as json_file:
    json_file.write(pretty_result)

# Download and save the image from the result
image_url = result["images"][0]["url"]
image_content = requests.get(image_url).content

# Convert the image to lossless WebP and save it
image = Image.open(BytesIO(image_content))
output_image_filename = os.path.join(OUTPUT_DIR, f"{base}_output.webp")
image.save(output_image_filename, "WEBP", lossless=True)

お問い合わせはお気軽に!

お問い合わせを頂いた後、継続して営業活動をしたり、ニュースレター等をお送りしたりすることはございません。
御返答は 24時間以内(営業時間中)とさせて頂いております。もし返答が届かない場合、何らかの事情でメールが不達となっている可能性がございます。大変お手数ですが、別のメールアドレス等で督促頂けますと幸いです。

コメントを残す