使用图像生成模型
GPUStack支持部署和运行最先进的图像生成模型。这些模型允许您根据文本描述生成令人惊叹的图像,在设计、内容创作等领域实现应用。
在本指南中,我们将引导您完成在GPUStack中部署和使用图像生成模型的过程。
先决条件
在开始之前,请确保您已具备以下条件:
- 一块至少具有12GB显存的GPU。
- 访问Hugging Face以下载模型文件。
- gpustack已安装并正在运行。如果没有,请参考快速入门指南。
步骤1:部署Stable Diffusion模型
按照以下步骤从Hugging Face部署模型:
- 在GPUStack UI中导航至
Models
页面。 - 点击
Deploy Model
按钮。 - 在下拉菜单中,选择
Hugging Face
作为您的模型来源。 - 使用左上角的搜索栏搜索模型名称
gpustack/stable-diffusion-v3-5-medium-GGUF
。 - 在
Available Files
部分,选择stable-diffusion-v3-5-medium-Q4_0.gguf
文件。 - 保留所有默认设置,点击
Save
按钮部署模型。
部署完成后,您可以在Models
页面监控模型状态。
步骤2:使用模型进行图像生成
- 在GPUStack用户界面中导航至
Playground
>Image
页面。 - 确认已从右上角的
Model
下拉菜单中选择部署的模型。 - 输入描述您想要生成的图像的提示语。例如:
a female character with long, flowing hair that appears to be made of ethereal, swirling patterns resembling the Northern Lights or Aurora Borealis. The background is dominated by deep blues and purples, creating a mysterious and dramatic atmosphere. The character's face is serene, with pale skin and striking features. She wears a dark-colored outfit with subtle patterns. The overall style of the artwork is reminiscent of fantasy or supernatural genres.
- 在
Sampler
下拉菜单中选择euler
。 - 将
Sample Steps
设置为20
。 - 点击
Submit
按钮创建镜像。
生成的图像将在用户界面中显示。由于生成过程中涉及的种子和随机性因素,您得到的图像可能会有所不同。
结论
通过此设置,您可以从文本提示生成独特且视觉上引人注目的图像。尝试不同的提示和设置,以突破可能的界限。更多详情,请参阅Recommended Parameters for Image Generation Models