当前位置: 首页 > news >正文

fastGPT调用stable diffusion生成图片,本地模型使用ollama

ps:192.168.1.100换成你的ip

一、开器stable diffusion的api访问

Git上copy的项目,在启动web-ui.bat/sh时加上--api的启动参数.

/web-ui.bat --api

我这里使用的stabble-diffusion-docker构建的默认就开启了

http://192.168.1.100:7860/docs

二、FastGPT中调用stable diffusion

1、新建插件

2、修改http请求
①post请求地址
http://192.168.1.100:7860/sdapi/v1/txt2img
②body参数
{"prompt": "{{prompt}}","negative_prompt": "nsfw, paintings, cartoon, anime, sketches, worst quality, low quality, normal quality, lowres, watermark, monochrome, grayscale, ugly, blurry, Tan skin, dark skin, black skin, skin spots, skin blemishes, age spot, glans, disabled, bad anatomy, amputation, bad proportions, twins, missing body, fused body, extra head, poorly drawn face, bad eyes, deformed eye, unclear eyes, cross-eyed, long neck, malformed limbs, extra limbs, extra arms, missing arms, bad tongue, strange fingers, mutated hands, missing hands, poorly drawn hands, extra hands, fused hands, connected hand, bad hands, missing fingers, extra fingers, 4 fingers, 3 fingers, deformed hands, extra legs, bad legs, many legs, more than two legs, bad feet, extra feets, badhandv4, easynegative, FastNegativeV2, negative_hand-neg,ng_deepnegative_v1_75t, verybadimagenegative_v1.3","override_settings": {"sd_model_checkpoint": "dreamshaper_8.safetensors","sd_vae": "vae-ft-mse-840000-ema-pruned.safetensors"},"seed": -1,"subseed": -1,"subseed_strength": 0,"seed_resize_from_h": -1,"seed_resize_from_w": -1,"batch_size": 1,"n_iter": 1,"steps": 50,"cfg_scale": 7,"width": 512,"height": 512,"restore_faces": false,"tiling": false,"do_not_save_samples": false,"do_not_save_grid": false,"eta": 0,"denoising_strength": 0,"s_min_uncond": 0,"s_churn": 0,"s_tmax": 0,"s_tmin": 0,"s_noise": 0,"override_settings_restore_afterwards": true,"refiner_switch_at": 0,"disable_extra_networks": false,"comments": {},"enable_hr": false,"firstphase_width": 0,"firstphase_height": 0,"hr_scale": 2,"hr_second_pass_steps": 0,"hr_resize_x": 0,"hr_resize_y": 0,"hr_prompt": "","hr_negative_prompt": "","sampler_index": "Euler","script_args": [],"send_images": true,"save_images": true,"alwayson_scripts": {}
}

3、增加AI对话生成提示词

4、增加文本拼接和指定回复

5、总的流程图

注意:使用插件那个输出删除不掉,最好用流程

三、成功了

PS:调试接口(可以跳过)

1、使用apifox导入stable diffusion接口

项目设置->导入数据->新建数据源->立即导入

2、调试接口

{"prompt": "a little cute house","negative_prompt": "nsfw, paintings, cartoon, anime, sketches, worst quality, low quality, normal quality, lowres, watermark, monochrome, grayscale, ugly, blurry, Tan skin, dark skin, black skin, skin spots, skin blemishes, age spot, glans, disabled, bad anatomy, amputation, bad proportions, twins, missing body, fused body, extra head, poorly drawn face, bad eyes, deformed eye, unclear eyes, cross-eyed, long neck, malformed limbs, extra limbs, extra arms, missing arms, bad tongue, strange fingers, mutated hands, missing hands, poorly drawn hands, extra hands, fused hands, connected hand, bad hands, missing fingers, extra fingers, 4 fingers, 3 fingers, deformed hands, extra legs, bad legs, many legs, more than two legs, bad feet, extra feets, badhandv4, easynegative, FastNegativeV2, negative_hand-neg,ng_deepnegative_v1_75t, verybadimagenegative_v1.3","override_settings": {"sd_model_checkpoint": "dreamshaper_8.safetensors","sd_vae": "vae-ft-mse-840000-ema-pruned.safetensors"},"seed": -1,"subseed": -1,"subseed_strength": 0,"seed_resize_from_h": -1,"seed_resize_from_w": -1,"batch_size": 1,"n_iter": 1,"steps": 50,"cfg_scale": 7,"width": 512,"height": 512,"restore_faces": false,"tiling": false,"do_not_save_samples": false,"do_not_save_grid": false,"eta": 0,"denoising_strength": 0,"s_min_uncond": 0,"s_churn": 0,"s_tmax": 0,"s_tmin": 0,"s_noise": 0,"override_settings_restore_afterwards": true,"refiner_switch_at": 0,"disable_extra_networks": false,"comments": {},"enable_hr": false,"firstphase_width": 0,"firstphase_height": 0,"hr_scale": 2,"hr_second_pass_steps": 0,"hr_resize_x": 0,"hr_resize_y": 0,"hr_prompt": "","hr_negative_prompt": "","sampler_index": "Euler","script_args": [],"send_images": true,"save_images": true,"alwayson_scripts": {}
}

http://www.lryc.cn/news/479196.html

相关文章:

  • 【jmeter】jmeter的线程组功能的详细介绍
  • 高边坡安全监测系统的工作原理和应用领域
  • Java:多态的调用
  • A day a tweet(seventeen)——Visualize Convolution Neural Network!
  • 卡达掐发展史
  • UI界面设计入门:打造卓越用户体验
  • 【Linux:tcp三次握手和四次挥手】
  • 大数据Informatica面试题及参考答案
  • Gradient Boosting Regressor(GBDT)--- 论文实战
  • Python教程:python枚举类定义和使用
  • Java学习Day60:微服务总结!(有经处无火,无火处无经)
  • MySQL日期类型选择建议
  • 70B的模型做微调,使用A10*8的卡能够使用
  • 将vscode的终端改为cygwin terminal
  • 《ASP.Net Core技术内幕与项目实战》读书笔记_1
  • 【青牛科技】应用方案|D2587A高压大电流DC-DC
  • 【测试】【Debug】pytest运行后print没有输出
  • linux strace 查看程序异常问题总结
  • 8086汇编常见寄存器与指令
  • Group By、Having用法总结(常见踩雷点总结—SQL)
  • Redis持久化机制——针对实习面试
  • Windows系统服务器怎么设置远程连接?详细步骤
  • 【Rust设计模式之建造者模式】
  • 2024中国移动(南京)智算大会暨人工智能产业大会即将盛大启幕
  • 计算机毕业设计 | SpringBoot咖啡商城 购物采买平台 后台管理软件(附源码)
  • CosyVoice文本转语音:轻松创造个性化音频
  • 法语nous sommes
  • 《化学进展》
  • CNN和RCNN的关系和区别
  • Chromium 进程降权和提权模拟示例c++