Open WebUI使用Ollama的Deepseek和ComfyUI的Flux进行图片生成

实现目标:使用DeepSeek+Flux生成质量较高的图片

环境:

1⃣️ 本教程已搭建Open WebUI、Ollama、ComfyUI环境

2⃣️ Ollama已安装Deepseek-r1:32B模型

ComfyUI已安装Flux模型

具体工作流如下

可保存为workflow.json

{
  "6": {
    "inputs": {
      "text": "A festive scene celebrating Laba Festival, featuring a steaming bowl of Laba porridge with colorful ingredients like red beans, rice, peanuts, and dried fruits. Traditional Chinese decorations in the background, such as red lanterns, paper cuttings, and calligraphy. The setting is a warm, cozy kitchen or dining table with wooden utensils, showcasing a family atmosphere. Soft, warm lighting enhances the festive and cultural vibes. Winter elements like snow or a frosty window in the background.",
      "clip": [
        "11",
        0
      ]
    },
    "class_type": "CLIPTextEncode",
    "_meta": {
      "title": "CLIP文本编码器"
    }
  },
  "8": {
    "inputs": {
      "samples": [
        "13",
        0
      ],
      "vae": [
        "10",
        0
      ]
    },
    "class_type": "VAEDecode",
    "_meta": {
      "title": "VAE解码"
    }
  },
  "9": {
    "inputs": {
      "filename_prefix": "ComfyUI",
      "images": [
        "8",
        0
      ]
    },
    "class_type": "SaveImage",
    "_meta": {
      "title": "保存图像"
    }
  },
  "10": {
    "inputs": {
      "vae_name": "ae.safetensors"
    },
    "class_type": "VAELoader",
    "_meta": {
      "title": "VAE加载器"
    }
  },
  "11": {
    "inputs": {
      "clip_name1": "t5xxl_fp16.safetensors",
      "clip_name2": "clip_l.safetensors",
      "type": "flux"
    },
    "class_type": "DualCLIPLoader",
    "_meta": {
      "title": "双CLIP加载器"
    }
  },
  "12": {
    "inputs": {
      "unet_name": "flux1-dev-fp8.safetensors",
      "weight_dtype": "default"
    },
    "class_type": "UNETLoader",
    "_meta": {
      "title": "UNET加载器"
    }
  },
  "13": {
    "inputs": {
      "noise": [
        "25",
        0
      ],
      "guider": [
        "22",
        0
      ],
      "sampler": [
        "16",
        0
      ],
      "sigmas": [
        "17",
        0
      ],
      "latent_image": [
        "27",
        0
      ]
    },
    "class_type": "SamplerCustomAdvanced",
    "_meta": {
      "title": "自定义采样器(高级)"
    }
  },
  "16": {
    "inputs": {
      "sampler_name": "euler"
    },
    "class_type": "KSamplerSelect",
    "_meta": {
      "title": "K采样器选择"
    }
  },
  "17": {
    "inputs": {
      "scheduler": "simple",
      "steps": 20,
      "denoise": 1,
      "model": [
        "30",
        0
      ]
    },
    "class_type": "BasicScheduler",
    "_meta": {
      "title": "基础调度器"
    }
  },
  "22": {
    "inputs": {
      "model": [
        "30",
        0
      ],
      "conditioning": [
        "26",
        0
      ]
    },
    "class_type": "BasicGuider",
    "_meta": {
      "title": "基础引导"
    }
  },
  "25": {
    "inputs": {
      "noise_seed": 487354807589876
    },
    "class_type": "RandomNoise",
    "_meta": {
      "title": "随机噪波"
    }
  },
  "26": {
    "inputs": {
      "guidance": 3.5,
      "conditioning": [
        "6",
        0
      ]
    },
    "class_type": "FluxGuidance",
    "_meta": {
      "title": "Flux引导"
    }
  },
  "27": {
    "inputs": {
      "width": 512,
      "height": 512,
      "batch_size": 1
    },
    "class_type": "EmptySD3LatentImage",
    "_meta": {
      "title": "空Latent_SD3"
    }
  },
  "30": {
    "inputs": {
      "max_shift": 1.15,
      "base_shift": 0.5,
      "width": 512,
      "height": 512,
      "model": [
        "12",
        0
      ]
    },
    "class_type": "ModelSamplingFlux",
    "_meta": {
      "title": "模型采样算法Flux"
    }
  }
}

Open WebUI配置情况如下,填写ComfyUI基础地址,再上传上述workflow.json,然后填写工作流节点

设置默认模型等

点击保存

点击工作空间

新建模型,参数如下

系统提示词:你只给出flux生成一张图片的提示词,要求提示词用英文,你的回答只需要给英文提示词,不需要其他多余的话

对话测试:

输入对话:画一张赛博朋克风格的城市图片

然后点击下图所示的“生成图片”图标

生成结果

猜你喜欢

转载自blog.csdn.net/m0_56011057/article/details/145857990
今日推荐