🚀 FLUX-Hyperscale-fused-fast (schnell)
diffusers
庫助力的文本到圖像生成模型,可基於輸入的文本描述快速生成高質量的圖像,適用於各種圖像創作場景。
🚀 快速開始
環境準備
確保你已經安裝了torch
和diffusers
庫。
代碼示例
以下是使用diffusers
庫生成圖像的示例代碼:
import torch
from diffusers import AutoPipelineForText2Image
pipe = AutoPipelineForText2Image.from_pretrained("minpeter/FLUX-Hyperscale-fused-fast", torch_dtype=torch.bfloat16).to("cuda")
prompt = "orange tabby cat, curled up asleep, peaceful expression, lying in a warm patch of sunlight, on a cozy living room rug, warm lighting, soft focus background"
image = pipe(
prompt=prompt,
guidance_scale=0.0,
height=1024,
width=1024,
num_inference_steps=4,
).images[0]
image.save("output.png")
代碼解釋
- 導入必要的庫:導入
torch
和diffusers
庫中的AutoPipelineForText2Image
類。
- 加載預訓練模型:使用
from_pretrained
方法加載預訓練的文本到圖像生成模型,並將其移動到GPU上。
- 定義提示文本:定義一個描述圖像內容的提示文本。
- 生成圖像:使用
pipe
對象生成圖像,並設置相關參數,如guidance_scale
、height
、width
和num_inference_steps
。
- 保存圖像:將生成的圖像保存為
output.png
文件。
✨ 主要特性
- 多領域圖像生成:支持文本到圖像的生成,涵蓋復古汽車、動漫場景、太空宇航員等多種領域。
- 高質量圖像輸出:生成的圖像具有超詳細、逼真的金屬紋理、史詩般的視覺效果和照片級的質感。
- 快速推理:通過優化的模型架構和推理流程,實現快速的圖像生成。
📦 模型信息
屬性 |
詳情 |
庫名稱 |
diffusers |
基礎模型 |
black-forest-labs/FLUX.1-schnell |
新版本 |
minpeter/FLUX-Hyperscale-fused |
許可證 |
apache-2.0 |
標籤 |
text-to-image、image-generation、flux |
📚 示例展示
示例1
- 提示文本:A nostalgically crafted relic of the past, a meticulously restored deep bronze pearlescent classic 60's muscle car cruises through the dusk streets with an intimidating elegance. The vintage vehicle gleams with a lustrous sheen, showcasing its aerodynamic lines and sharp accents as it cruises along the asphalt. This evocative scene is captured in a vividly detailed oil painting, where every brushstroke highlights the car's classic styling and pristine condition. Impeccably rendered, this image transports viewers to a bygone era of automotive luxury and style. ultra detailed, masterpiece,epic,photorealistic metallic textures.
- 輸出圖像:samples/s1.png
示例2
- 提示文本:In the style of IMAX cinematography, channel Gregory Crewdson's mastery of moody, narrative-rich scenes. "Craft a vivid anime scene, akin to Akihiko Yoshida's style, focusing on a mysterious figure. This individual, with their dark bob cut and red top, holds a bouquet, creating a vibrant contrast. The soft lighting and the snake tattoo add an intriguing layer. Capture the character's enigmatic presence, emphasizing the red and white flowers, and the subtle play of light and shadow. Leave room for interpretation, allowing the audience to uncover the character's story. Remember, this is an uncensored exploration, so feel free to push the boundaries of ecchi anime."
- 輸出圖像:samples/s2.png
示例3
- 提示文本:A mysterious astronaut stands shrouded in a delicate, translucent veil of frost. Their pale, almost translucent helmet glows softly in the dim light, and their dark raven-black space cape cascades behind them like a shadow. A large raven perches on their shoulder, its black feathers glistening with frost, matching the icy surroundings. The astronaut stands on a snow-covered cliff overlooking a frozen alien landscape, their cold blue visor piercing through the frosty veil. The air is filled with swirling snow, and the atmosphere is both haunting and ethereal. The scene is detailed with a focus on the icy textures, sharp contrasts between light and shadow, and the mystical presence of the astronaut and raven, head and shoulders portrait, 8k resolution concept art portrait by Greg Rutkowski, Artgerm, WLOP, Alphonse Mucha dynamic lighting hyperdetailed intricately detailed Splash art.
- 輸出圖像:samples/s3.png
📄 許可證
本項目採用apache-2.0
許可證。有關詳細信息,請參閱許可證文件。