Skip to content

Commit

Permalink
revert to 0.0.26, release 0.0.29
Browse files Browse the repository at this point in the history
  • Loading branch information
OhYee committed Jul 14, 2023
1 parent e8de45a commit bc7aa25
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 112 deletions.
55 changes: 2 additions & 53 deletions publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Type: Application
Name: fc-stable-diffusion
Provider:
- 阿里云
Version: 0.0.28
Version: 0.0.29
Description: 使用serverless devs将stable-diffusion部署到阿里云函数计算上
HomePage: https://github.com/OhYee/fc-stable-diffuson
Tags: #标签详情
Expand All @@ -16,9 +16,6 @@ Parameters:
- serviceName
- functionName
- type
- nasEnabled
- webuiEnabled
- apiEnabled
properties:
region:
title: 地域
Expand All @@ -34,13 +31,11 @@ Parameters:
title: 服务名
type: string
default: fc-stable-diffusion
pattern: "^[a-zA-Z_][a-zA-Z0-9-_:/.]{0,127}$"
description: 您可以根据需要设置不同的服务名,同一个服务会共享部分第三方云产品资源
functionName:
title: 函数名
type: string
default: sd
pattern: "^[a-zA-Z_][a-zA-Z0-9-_:/.]{0,127}$"
description: 您可以根据需要多次创建该应用,通过函数名来区分出不同的镜像地址
type:
title: 绘图类型
Expand All @@ -55,50 +50,4 @@ Parameters:
enum:
- SD1.5
- 动漫风格
- 真人风格

nasEnabled:
title: 启用 NAS
type: boolean
default: false
description: |+
启用 NAS 将允许您上传自定义的模型、插件,提升 Stable Diffusion 自由度及可定制性。
启用 NAS 后将会为您自动创建 NAS 实例,并挂载至 /mnt/auto 目录,这可能会导致额外的费用。
与函数计算 Serverless 模式不同,NAS 属于存储产品,即使未读取仍然需要收取文件存储费用,建议搭配 NAS 资源包使用。
webuiEnabled:
title: 启用 WebUI 模式
type: boolean
default: true
description: |+
将开启 webui 页面,您可以通过网页生成图片
webuiAuth:
title: WebUI 鉴权
type: string
pattern: "^([^:,]+:[^:,]+(,[^:,]+:[^:,]+)*)*$"
description: |+
WebUI 鉴权,访问页面时需要进行鉴权操作,只有通过鉴权后才能进入界面,避免链接泄漏后导致额外费用。格式:“用户名:密码”,多个用户使用英文逗号分隔。留空不开启鉴权
apiEnabled:
title: 启用 API 模式
type: boolean
default: true
description: |+
将开启 api 模式,可在 /docs 目录查看所有接口文档,并通过接口生成图片。
apiAuth:
title: API 鉴权
type: string
pattern: "^([^:,]+:[^:,]+(,[^:,]+:[^:,]+)*)*$"
description: |+
API 鉴权,只有通过鉴权才能调用接口,避免链接泄漏后导致额外费用。格式:“用户名:密码”,多个用户使用英文逗号分隔。留空不开启鉴权
extraArgs:
title: Stable Diffusion 参数
type: string
description: |+
您可以根据需要添加额外的 Stable Diffusion 参数。全部参数见 https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Command-Line-Arguments-and-Settings
filemgrToken:
title: "FC 文件管理器密钥"
type: string
description: 用于管理 NAS 文件的文件管理器,配置密钥可以避免被恶意访问。留空则不进行鉴权。'
- 真人风格
63 changes: 4 additions & 59 deletions src/s.yaml
Original file line number Diff line number Diff line change
@@ -1,25 +1,18 @@
edition: 1.0.0 # 命令行YAML规范版本,遵循语义化版本(Semantic Versioning)规范
edition: 1.0.0
name: fc-stable-diffusion
access: default
vars:
region: "{{ region }}"
serviceName: "{{ serviceName }}"
functionName: "{{ functionName }}"
imageUrl: "registry.{{region}}.aliyuncs.com/aliyun-fc/fc-stable-diffusion:{{ if type === '动漫风格' }}anime-v2{{ else if type === '真人风格'}}realman-v2{{ else }}sd1.5-v2{{/if}}"
filemgrToken: "{{ filemgrToken || '' }}"
extraArgs: "{{ extraArgs || '' }}{{ if webuiEnabled === false }} --nowebui{{/if}}{{ if webuiAuth !== '' && webuiAuth !== undefined }} --gradio-auth {{webuiAuth}}{{/if}}{{ if apiEnabled }} --api{{/if}}{{ if apiAuth !== '' && apiAuth !== undefined }} --api-auth {{apiAuth}}{{/if}}"
imageUrl: "registry.{{region}}.aliyuncs.com/aliyun-fc/fc-stable-diffusion:{{ if type === '动漫风格' }}anime-v1{{ else if type === '真人风格'}}realman-v1{{ else }}sd1.5-v1{{/if}}"
service:
name: ${vars.serviceName}
description: 'stable-diffusion 部署到函数计算'
description: 'stable-diffusion部署到函数计算'
internetAccess: true
{{ if nasEnabled === true }}nasConfig: auto{{/if}}

services:
stable-diffusion:
component: fc
actions:
post-deploy:
- component: fc ondemand put --qualifier LATEST --max 1
props:
region: ${vars.region}
service: ${vars.service}
Expand All @@ -42,10 +35,9 @@ services:
webServerMode: true
instanceConcurrency: 100
memorySize: 32768
environmentVariables: {}
gpuMemorySize: 16384
asyncConfiguration: {}
environmentVariables:
EXTRA_ARGS: ${vars.extraArgs}
triggers:
- name: defaultTrigger
description: ''
Expand All @@ -59,53 +51,6 @@ services:
- DELETE
authType: anonymous
disableURLInternet: false
customDomains:
- domainName: auto
protocol: HTTP
routeConfigs:
- path: /*

filemgr:
component: fc
actions:
post-deploy:
- component: fc ondemand put --qualifier LATEST --max 1
props:
region: ${vars.region}
service: ${vars.service}
function:
name: "admin"
description: 'FC 文件管理器'
codeUri: './code/filemgr'
runtime: custom
timeout: 7200
memorySize: 3072
cpu: 2.0
diskSize: 512
instanceConcurrency: 16
caPort: 9000
customRuntimeConfig:
command:
- ./server
environmentVariables:
TOKEN: ${vars.filemgrToken}
SD_VERSION: ""
SD_FUNCTION_NAME: ${stable-diffusion.props.function.name}
SD_DOMAIN: ${stable-diffusion.output.url.custom_domain[0].domain}
layers:
- "acs:fc:${vars.region}:official:layers/ServerlessDevs/versions/1"
triggers:
- name: httpTrigger
type: http
config:
authType: anonymous
methods:
- GET
- POST
- PUT
- DELETE
- HEAD
- OPTIONS
customDomains:
- domainName: auto
protocol: HTTP
Expand Down

0 comments on commit bc7aa25

Please sign in to comment.