AI画图 Ubuntu 20.04.5 LTS x86_64 Docker stable diffusion webui 及 http api接口

news2024/10/7 2:30:43

资源

Docker镜像

docker pull darkroot1234/ayanami:latest

参考地址:

docker一键运行stable diffusion webui,常用插件和功能完备,获得镜像后可打包带走 - 哔哩哔哩

nvidia cuda 驱动

​​​​​​​Linux x64 (AMD64/EM64T) Display Driver | 525.116.04 | Linux 64-bit | NVIDIA

lora模型下载

热门Civitai LoRA模型下载第一批合集 Stable Diffusion WebUI - openAI

启动

docker run --gpus all -it -p 8888:8888 -p 7860:7860 -p 6666:22 --name ayanami --ipc=host darkroot1234/ayanami:latest

注意:启动时会访问公网,如果网络不通,会导致启动失败,注意看docker日志输出

docker cp 拷贝模型文件到容器/workspace/models/Stable-diffusion/目录下:chilloutmix_Ni.safetensors 

重启docker

docker restart ayanami

等待加载资源,打开浏览器,访问 http://127.0.0.1:7860

左上角选择放入的模型,采用该容器自带的参数,生成绫波丽

 

 修改参数,去掉CAD,机器人等信息

((masterpiece)), ((best quality)),((extremely detailed)),Ayanami Rei,beautiful face,Blue hair,Beautiful red eyes,

http api

请求

通过观察浏览器请求,发现首次触发生成时,第一条请求predict/卡在pending状态,当渲染结束后,该请求响应出了图片地址

 复制出来的curl指令

curl 'http://127.0.0.1:7860/run/predict/' \
  -H 'Accept: */*' \
  -H 'Accept-Language: zh,en-US;q=0.9,en;q=0.8' \
  -H 'Connection: keep-alive' \
  -H 'Content-Type: application/json' \
  -H 'Cookie: _ga=GA1.1.1067480164.1660637226' \
  -H 'Origin: http://127.0.0.1:7860' \
  -H 'Referer: http://127.0.0.1:7860/' \
  -H 'Sec-Fetch-Dest: empty' \
  -H 'Sec-Fetch-Mode: cors' \
  -H 'Sec-Fetch-Site: same-origin' \
  -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36' \
  -H 'sec-ch-ua: "Google Chrome";v="113", "Chromium";v="113", "Not-A.Brand";v="24"' \
  -H 'sec-ch-ua-mobile: ?0' \
  -H 'sec-ch-ua-platform: "Linux"' \
  --data-raw $'{"fn_index":102,"data":["((masterpiece)), ((best quality)),((extremely detailed)),Ayanami Rei,beautiful face,Blue hair,Beautiful red eyes,","","None","None",50,"Euler a",false,false,1,1,11,2083545561,-1,0,0,0,false,704,1024,false,0.7,0,0,"None",false,false,false,false,"","Seed","","Nothing","",true,false,false,null,"{\\"prompt\\": \\"((masterpiece)), ((best quality)),((extremely detailed)),Ayanami Rei,beautiful face,Blue hair,Beautiful red eyes,\\", \\"all_prompts\\": [\\"((masterpiece)), ((best quality)),((extremely detailed)),Ayanami Rei,beautiful face,Blue hair,Beautiful red eyes,\\"], \\"negative_prompt\\": \\"\\", \\"all_negative_prompts\\": [\\"\\"], \\"seed\\": 2083545561, \\"all_seeds\\": [2083545561], \\"subseed\\": 1093441852, \\"all_subseeds\\": [1093441852], \\"subseed_strength\\": 0, \\"width\\": 1024, \\"height\\": 704, \\"sampler_name\\": \\"Euler a\\", \\"cfg_scale\\": 11, \\"steps\\": 50, \\"batch_size\\": 1, \\"restore_faces\\": false, \\"face_restoration_model\\": null, \\"sd_model_hash\\": \\"8c3b86ce\\", \\"seed_resize_from_w\\": 0, \\"seed_resize_from_h\\": 0, \\"denoising_strength\\": null, \\"extra_generation_params\\": {}, \\"index_of_first_image\\": 0, \\"infotexts\\": [\\"((masterpiece)), ((best quality)),((extremely detailed)),Ayanami Rei,beautiful face,Blue hair,Beautiful red eyes,\\\\nSteps: 50, Sampler: Euler a, CFG scale: 11, Seed: 2083545561, Size: 1024x704, Model hash: 8c3b86ce, Clip skip: 2\\"], \\"styles\\": [\\"None\\", \\"None\\"], \\"job_timestamp\\": \\"20230511015740\\", \\"clip_skip\\": 2, \\"is_using_inpainting_conditioning\\": false}","<p>((masterpiece)), ((best quality)),((extremely detailed)),Ayanami Rei,beautiful face,Blue hair,Beautiful red eyes,<br>\\nSteps: 50, Sampler: Euler a, CFG scale: 11, Seed: 2083545561, Size: 1024x704, Model hash: 8c3b86ce, Clip skip: 2</p><div class=\'performance\'><p class=\'time\'>Time taken: <wbr>24.71s</p><p class=\'vram\'>Torch active/reserved: 3573/4222 MiB, <wbr>Sys VRAM: 5882/5924 MiB (99.29%)</p></div>"],"session_hash":"t3m95wa7oj"}' \
  --compressed

其中我们填写的参数在data数组的第一段字符串参数内,即

((masterpiece)), ((best quality)),((extremely detailed)),Ayanami Rei,beautiful face,Blue hair,Beautiful red eyes,

第二个参数标识第二个输入框,我们没有输入。

响应

该请求会阻塞,直到渲染结束

{"data":[[{"name":"outputs/txt2img-images/00054-2083545561-((masterpiece)), ((best quality)),((extremely detailed)),Ayanami Rei,beautiful face,Blue hair,Beautiful red eyes,.png","data":null,"is_file":true}],"{\"prompt\": \"((masterpiece)), ((best quality)),((extremely detailed)),Ayanami Rei,beautiful face,Blue hair,Beautiful red eyes,\", \"all_prompts\": [\"((masterpiece)), ((best quality)),((extremely detailed)),Ayanami Rei,beautiful face,Blue hair,Beautiful red eyes,\"], \"negative_prompt\": \"\", \"all_negative_prompts\": [\"\"], \"seed\": 2083545561, \"all_seeds\": [2083545561], \"subseed\": 881369708, \"all_subseeds\": [881369708], \"subseed_strength\": 0, \"width\": 1024, \"height\": 704, \"sampler_name\": \"Euler a\", \"cfg_scale\": 11, \"steps\": 50, \"batch_size\": 1, \"restore_faces\": false, \"face_restoration_model\": null, \"sd_model_hash\": \"8c3b86ce\", \"seed_resize_from_w\": 0, \"seed_resize_from_h\": 0, \"denoising_strength\": null, \"extra_generation_params\": {}, \"index_of_first_image\": 0, \"infotexts\": [\"((masterpiece)), ((best quality)),((extremely detailed)),Ayanami Rei,beautiful face,Blue hair,Beautiful red eyes,\\nSteps: 50, Sampler: Euler a, CFG scale: 11, Seed: 2083545561, Size: 1024x704, Model hash: 8c3b86ce, Clip skip: 2\"], \"styles\": [\"None\", \"None\"], \"job_timestamp\": \"20230511015814\", \"clip_skip\": 2, \"is_using_inpainting_conditioning\": false}","<p>((masterpiece)), ((best quality)),((extremely detailed)),Ayanami Rei,beautiful face,Blue hair,Beautiful red eyes,<br>\nSteps: 50, Sampler: Euler a, CFG scale: 11, Seed: 2083545561, Size: 1024x704, Model hash: 8c3b86ce, Clip skip: 2</p><div class='performance'><p class='time'>Time taken: <wbr>24.88s</p><p class='vram'>Torch active/reserved: 3573/3980 MiB, <wbr>Sys VRAM: 5665/5924 MiB (95.63%)</p></div>"],"is_generating":false,"duration":24.88272213935852,"average_duration":34.33394391720112}

其中name字段为生成图片的文件名,访问方式

http://127.0.0.1:7860/file=outputs/txt2img-images/00054-2083545561-((masterpiece)),%20((best%20quality)),((extremely%20detailed)),Ayanami%20Rei,beautiful%20face,Blue%20hair,Beautiful%20red%20eyes,.png

即:固定url前段

http://127.0.0.1:7860/file=

拼接上文件名,注意:文件名应当采用urlencode编码

效果

 该文件位于容器路径

/workspace/outputs/txt2img-images/ 

注意:该路径不会自动清理,如果大量生成,需要自行考虑把该目录挂载到分布式存储上,如glasterfs,需要自行设计清理程序。

进度查询

curl 'http://127.0.0.1:7860/run/predict/' \
  -H 'sec-ch-ua: "Google Chrome";v="113", "Chromium";v="113", "Not-A.Brand";v="24"' \
  -H 'sec-ch-ua-platform: "Linux"' \
  -H 'Referer: http://127.0.0.1:7860/' \
  -H 'sec-ch-ua-mobile: ?0' \
  -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36' \
  -H 'Content-Type: application/json' \
  --data-raw '{"fn_index":88,"data":[],"session_hash":"t3m95wa7oj"}' \
  --compressed

响应

进行中

{"data":["<span id='txt2img_progress_span' style='display: none'>1683771458.0030112</span><p><div class='progressDiv'><div class='progress' style=\"overflow:visible;width:98.0%;white-space:nowrap;\">&nbsp;&nbsp;98% ETA: 00s</div></div></p>",{"visible":false,"__type__":"update"},{"visible":false,"__type__":"update"},{"visible":false,"__type__":"update"}],"is_generating":false,"duration":0.0002410411834716797,"average_duration":0.0002521400164840813}

完成

{"data":["",{"visible":false,"__type__":"update"},{"visible":false,"__type__":"update"},{"visible":false,"__type__":"update"}],"is_generating":false,"duration":0.0005140304565429688,"average_duration":0.0002525332453730586}

api差异说明

fn_indexdatasession_hash
生成api102必填必填
查询api88留空必填(保持与生成api一致)

http api调佣测试

主要参数修改为

((masterpiece)), ((best quality)),((extremely detailed)),beautiful face,Beautiful eyes,

完整curl指令

curl 'http://127.0.0.1:7860/run/predict/' \
  -H 'Accept: */*' \
  -H 'Accept-Language: zh,en-US;q=0.9,en;q=0.8' \
  -H 'Connection: keep-alive' \
  -H 'Content-Type: application/json' \
  -H 'Cookie: _ga=GA1.1.1067480164.1660637226' \
  -H 'Origin: http://127.0.0.1:7860' \
  -H 'Referer: http://127.0.0.1:7860/' \
  -H 'Sec-Fetch-Dest: empty' \
  -H 'Sec-Fetch-Mode: cors' \
  -H 'Sec-Fetch-Site: same-origin' \
  -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36' \
  -H 'sec-ch-ua: "Google Chrome";v="113", "Chromium";v="113", "Not-A.Brand";v="24"' \
  -H 'sec-ch-ua-mobile: ?0' \
  -H 'sec-ch-ua-platform: "Linux"' \
  --data-raw $'{"fn_index":102,"data":["((masterpiece)), ((best quality)),((extremely detailed)),beautiful face,Beautiful eyes,","","None","None",50,"Euler a",false,false,1,1,11,2083545561,-1,0,0,0,false,704,1024,false,0.7,0,0,"None",false,false,false,false,"","Seed","","Nothing","",true,false,false,null,"{\\"prompt\\": \\"((masterpiece)), ((best quality)),((extremely detailed)),Ayanami Rei,beautiful face,Blue hair,Beautiful red eyes,\\", \\"all_prompts\\": [\\"((masterpiece)), ((best quality)),((extremely detailed)),Ayanami Rei,beautiful face,Blue hair,Beautiful red eyes,\\"], \\"negative_prompt\\": \\"\\", \\"all_negative_prompts\\": [\\"\\"], \\"seed\\": 2083545561, \\"all_seeds\\": [2083545561], \\"subseed\\": 1093441852, \\"all_subseeds\\": [1093441852], \\"subseed_strength\\": 0, \\"width\\": 1024, \\"height\\": 704, \\"sampler_name\\": \\"Euler a\\", \\"cfg_scale\\": 11, \\"steps\\": 50, \\"batch_size\\": 1, \\"restore_faces\\": false, \\"face_restoration_model\\": null, \\"sd_model_hash\\": \\"8c3b86ce\\", \\"seed_resize_from_w\\": 0, \\"seed_resize_from_h\\": 0, \\"denoising_strength\\": null, \\"extra_generation_params\\": {}, \\"index_of_first_image\\": 0, \\"infotexts\\": [\\"((masterpiece)), ((best quality)),((extremely detailed)),Ayanami Rei,beautiful face,Blue hair,Beautiful red eyes,\\\\nSteps: 50, Sampler: Euler a, CFG scale: 11, Seed: 2083545561, Size: 1024x704, Model hash: 8c3b86ce, Clip skip: 2\\"], \\"styles\\": [\\"None\\", \\"None\\"], \\"job_timestamp\\": \\"20230511015740\\", \\"clip_skip\\": 2, \\"is_using_inpainting_conditioning\\": false}","<p>((masterpiece)), ((best quality)),((extremely detailed)),Ayanami Rei,beautiful face,Blue hair,Beautiful red eyes,<br>\\nSteps: 50, Sampler: Euler a, CFG scale: 11, Seed: 2083545561, Size: 1024x704, Model hash: 8c3b86ce, Clip skip: 2</p><div class=\'performance\'><p class=\'time\'>Time taken: <wbr>24.71s</p><p class=\'vram\'>Torch active/reserved: 3573/4222 MiB, <wbr>Sys VRAM: 5882/5924 MiB (99.29%)</p></div>"],"session_hash":"t3m95wa7oj"}' \
  --compressed

响应(约15秒)

{"data":[[{"name":"outputs/txt2img-images/00055-2083545561-((masterpiece)), ((best quality)),((extremely detailed)),beautiful face,Beautiful eyes,.png","data":null,"is_file":true}],"{\"prompt\": \"((masterpiece)), ((best quality)),((extremely detailed)),beautiful face,Beautiful eyes,\", \"all_prompts\": [\"((masterpiece)), ((best quality)),((extremely detailed)),beautiful face,Beautiful eyes,\"], \"negative_prompt\": \"\", \"all_negative_prompts\": [\"\"], \"seed\": 2083545561, \"all_seeds\": [2083545561], \"subseed\": 501878245, \"all_subseeds\": [501878245], \"subseed_strength\": 0, \"width\": 1024, \"height\": 704, \"sampler_name\": \"Euler a\", \"cfg_scale\": 11, \"steps\": 50, \"batch_size\": 1, \"restore_faces\": false, \"face_restoration_model\": null, \"sd_model_hash\": \"8c3b86ce\", \"seed_resize_from_w\": 0, \"seed_resize_from_h\": 0, \"denoising_strength\": null, \"extra_generation_params\": {}, \"index_of_first_image\": 0, \"infotexts\": [\"((masterpiece)), ((best quality)),((extremely detailed)),beautiful face,Beautiful eyes,\\nSteps: 50, Sampler: Euler a, CFG scale: 11, Seed: 2083545561, Size: 1024x704, Model hash: 8c3b86ce, Clip skip: 2\"], \"styles\": [\"None\", \"None\"], \"job_timestamp\": \"20230511021329\", \"clip_skip\": 2, \"is_using_inpainting_conditioning\": false}","<p>((masterpiece)), ((best quality)),((extremely detailed)),beautiful face,Beautiful eyes,<br>\nSteps: 50, Sampler: Euler a, CFG scale: 11, Seed: 2083545561, Size: 1024x704, Model hash: 8c3b86ce, Clip skip: 2</p><div class='performance'><p class='time'>Time taken: <wbr>24.41s</p><p class='vram'>Torch active/reserved: 3573/4222 MiB, <wbr>Sys VRAM: 5853/5924 MiB (98.8%)</p></div>"],"is_generating":false,"duration":24.41366720199585,"average_duration":33.62535272325788}

拼接出图片地址

http://127.0.0.1:7860/file=outputs/txt2img-images/00055-2083545561-((masterpiece)),%20((best%20quality)),((extremely%20detailed)),beautiful%20face,Beautiful%20eyes,.png

访问

处理时,gpu负载

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/514151.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

numpy中reshape(1,-1) 和 reshape(-1,1) 的理解

我们都知道**reshape()方法**的作用是将数据按照指定的维度重新组织并返回。也就是reshape&#xff08;行&#xff0c;列&#xff09;可以根据指定的数值将数据转换为特定的行数和列数&#xff0c;就是转换。 但我们经常在大佬的代码中&#xff0c;或者报错提示中发现&#xf…

什么是虚拟机?

我们都知道在 Windows 系统上一个软件包装包是 exe 后缀的&#xff0c;而这个软件包在苹果的 Mac OSX 系统上是无法安装的。类似地&#xff0c;Mac OSX 系统上软件安装包则是 dmg 后缀&#xff0c;同样无法在 Windows 系统上安装。 为什么不同系统上的软件无法安装&#xff0c…

常见4种风险定量分析法

常见的风险定量分析方法主要有&#xff1a; 一、 敏感性分析法 用于确定哪些风险对项目影响最大&#xff0c;将其它不确定因素固定在基准值&#xff0c;再考察某个因素的变化会对目标产生多大的影响。 在这一分析中&#xff0c;检查每一个项目成分的不确定性对所检查项目目标的…

提示工程L1:关键原则

提示工程指南&#xff1a;关键原则 一、 环境配置 chatgpt使用有诸多限制&#xff0c;所以采用国产模型来代替&#xff0c;加载开源的chatGLM模型&#xff0c;使用ChatGLM-6b的INT8版本。 chatGLM6b在LLM匿名竞技场中的排名&#xff1a; import os import torch import war…

大学生找工作防坑指南,收藏10000+

2023年就业季即将抵达&#xff0c;你害怕了吗&#xff1f; 据数据统计&#xff0c;今年的应届生人数再创新高&#xff0c;将达到1158万人&#xff0c;相信同学们看到这串数字已经感到毛骨悚然。然而大学生要面临的挑战不仅这些&#xff0c;最残酷的考验还在最后。 作为初出茅庐…

某些科技外企结束在中国市场直接运营,你如何看?

在新的竞争态势下&#xff0c; 向左走&#xff0c;还是向右走…… 【全球存储观察 &#xff5c; 热点关注】前些天&#xff0c;我发了一篇文章《你如何看LinkedIn“领英职场”将于8月9日起停止中国服务&#xff1f;》引发了业内朋友的热议&#xff0c;大家一致认为&#xff0c…

const和int const 理解笔记(图、代码、讲解)

本文参考了 》C 中的 const & &#xff08;常引用&#xff09;参数 - 知乎 因为博文写的很详细&#xff0c;所以博主按着自己的理解写了demo&#xff0c; 和一些方便自己理解的备注。 自学的时候看到了下面这个代码&#xff0c;所以 const&是啥 首先&#xff0c;一句…

C++中继承的语法和使用

C入门必看 继承的定义及概念概念定义 基类和派生类对象赋值转换继承后的作用域派生类默认的6个成员函数该何去何从&#xff1f; 多继承 面向对象语言3大特性&#xff1a;封装、继承、多态。 继承的定义及概念 概念 继承(inheritance)机制是面向对象程序设计使代码可以复用的最…

Dubbo接口测试没你想的那么高大上

主题&#xff1a;Dubbo接口测试没你想的那么高大上 一、Dubbo是什么&#xff1f; Dubbo是阿里巴巴公司开源的一个高性能优秀的服务框架一款分布式服务框架、高性能和透明化的RPC远程服务调用方案、SOA服务治理方案下图是阿里巴巴技术解决方案演变图&#xff0c;从单应用->…

卡特兰数三个通项公式的推导

前提条件&#xff1a; 有两种操作&#xff0c;一种操作的次数不能超过另外一个&#xff0c;或者是不能有交集这些操作的合法方案数&#xff0c;通常是卡特兰数 情景&#xff1a; 1&#xff09;n个0和n个1构成的字串&#xff0c;所有的前缀子串1的个数不超过0的个数&#xff…

月薪低于5千元必看,省钱购物攻略,本人亲测有效

作为资深的网购用户&#xff0c;我不允许我的姐妹们还不知道&#xff0c;网上购物如何省钱&#xff1f;如果你是学生党&#xff0c;或者月薪低于5千元&#xff0c;一定要看一看&#xff01;学会了不但能提升生活品质&#xff0c;还能帮你省下好多钱~ 同样的东西&#xff0c;我…

云渲染动画价格一般多少?

云渲染是什么&#xff1f; 云渲染就是通过互联网将用户本地需要渲染的文件上传到云端服务器中&#xff0c;再通过云端庞大的计算机集群资源进行运算操作&#xff0c;帮助用户在云端完成渲染工作后&#xff0c;用户再下载到本地的过程&#xff0c;整个过程操作十分简便。 云渲染…

解释一下泛型擦除?为什么java必须强制?

一、概述&#xff1a; 在解释什么是泛型擦除之前我们得先了解什么是Java泛型。所谓的泛型就是参数化的类型。这就意思着我们可以具体的类型作为一个参数传递给方法、类、接口。 为什么我们需要泛型呢&#xff1f;首先我们都知道在java里&#xff0c;Object就是对象的父类。Ob…

2023 年10款「会议管理」软件对比

在这篇文章中&#xff0c;我们将介绍2023年你可以尝试的10个会议管理软件。我们还将介绍会议管理的基础知识&#xff0c;涉及的步骤&#xff0c;以及如何创建会议议程。 2023 年 10 款会议管理软件对比 会议管理软件解决方案是一种数字工具&#xff0c;可以让个人和团队计划、…

一、【Pytorch笔记】pytorch简介,开发环境安装,搭建

一、下载Anaconda Anaconda包括Conda、Python以及一大堆安装好的工具包&#xff08;其他深度学习里用到的东西&#xff09;&#xff0c;比如&#xff1a;numpy、pandas等。所以下了Anaconda就不用下载Python进入Anaconda官网&#xff1a;https://www.anaconda.com/download/下…

【数字 IC】从底层重新认识 D 触发器、建立时间和保持时间

目录 1. NMOS 和 PMOS 2. MOS 管搭建逻辑门 3. 锁存器和触发器 3.1 交叉耦合反相器 3.2 SR 锁存器 3.3 D 锁存器 3.4 D 触发器 4. D 触发器的建立、保持时间 1. NMOS 和 PMOS MOSFET&#xff08;金属氧化物半导体场效应晶体管&#xff09;或 IGFET&#xff08;绝缘栅场…

Web3中文|又一巨头入局?亚马逊或将正式进军NFT领域

行业的风向总随着巨头公司而动。 自从亚马逊公司推出 NFT 市场的消息传出后&#xff0c;大众的目光就锁定在了亚马逊的身上&#xff0c;作为科技巨头的亚马逊入局 NFT 对整个行业都有着举足轻重的意义。 受 FTX 的崩溃的影响&#xff0c;亚马逊 NFT 市场的推出几经波折&#xf…

InnoDB和MySAM有什么区别?

首先&#xff0c;MySAM和InnoDB都是mysql里面的两个存储引擎&#xff0c;mysql5.5版本之前的存储引擎默认是MySAM&#xff0c;mysql5.5版本以后的存储引擎默认是InnoDB,它们底层数据结构都是基于B树的。 Mylsam存储引擎&#xff1a; Mylsam索引是非聚簇索引&#xff0c;Mylsa…

旅游景点剧本杀小程序

旅游景点剧本杀小程序是一种基于微信、支付宝等平台的应用程序&#xff0c;其主要功能包括以下几个方面&#xff1a; 游戏规则和背景介绍&#xff1a;小程序可以提供游戏规则和背景介绍&#xff0c;让玩家更好地了解游戏内容和任务。 队伍组建和角色选择&#xff1a;在…

API网关简介|TaobaoAPI接入

API网关是什么 在日常工作中&#xff0c;不同的场合下&#xff0c;我们可能听说过很多次网关这个名称&#xff0c;这里说的网关特指API网关&#xff08;API Gataway&#xff09;。字面意思是指将所有API的调用统一接入API网关层&#xff0c;由网关层负责接入和输出。 那么在什…