安装
安装comfyui
- 下载ComfyUI
git clone https://github.com/comfyanonymous/ComfyUI.git
cd ComfyUI/
- 配置&下载模型
- 下载模型到
ComfyUI/models目录下 - 如果是已安装
Stable Diffusion Webui,可以直接配置Stable Diffusion Webui的目录,省的模型下载多次,毕竟模型还是挺大的。如下所示:
> cp extra_model_paths.yaml.example extra_model_paths.yaml
> vim extra_model_paths.yaml
extra_model_paths.yaml如下所示
#config for a1111 ui
#all you have to do is change the base_path to where yours is installed
a111:
base_path: path/to/stable-diffusion-webui/
checkpoints: models/Stable-diffusion
configs: models/Stable-diffusion
vae: models/VAE
loras: models/Lora
upscale_models: |
models/ESRGAN
models/SwinIR
embeddings: embeddings
hypernetworks: models/hypernetworks
controlnet: models/ControlNet
- 启动
> python3 main.py
启动成功后如下所示
...
Starting server
To see the GUI go to: http://127.0.0.1:8188
此时就可以在在浏览器中打开了。
如果想在内网中也可以访问的话,可以加载--listen参数,启动命令如下:
python3 main.py --listen 0.0.0.0
- 浏览器运行
安装gligen
- 下载gligen
> git clone https://github.com/mut-ex/gligen-gui.git
> cd gligen-gui/
> pip install flask
- 启动
flask --app 'gligen_gui:create_app(8188)' run --port 5000
- 8181表示comfyui启动的端口
- 5000表示gligen启动的端口
启动成功后如下所示
Go to: http://127.0.0.1:5000/port/8188
* Serving Flask app 'gligen_gui:create_app(8188)'
* Debug mode: off
WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
* Running on http://127.0.0.1:5000
Press CTRL+C to quit
3. 效果
总结
gligen可以将文本描述限制在指定的精确位置内,组合来控制图片区域内生成的元素,达到比较精准控制生成图片的能力。对于一些常见的元素限制的还可以,但是如果指定的元素对于模型比较陌生,最终生成的效果并不理想。