mirror of
https://github.com/Comfy-Org/ComfyUI-Manager.git
synced 2026-01-29 23:40:16 +08:00
remove chiness
This commit is contained in:
parent
851ecb546f
commit
8ae7f40e16
@ -2126,12 +2126,9 @@ async def api_get_comfyworkflows_auth(request):
|
||||
return web.Response(status=404)
|
||||
return web.json_response({"comfyworkflows_sharekey" : comfyworkflows_auth})
|
||||
|
||||
# 跨域获得本地数据
|
||||
args.enable_cors_header = "*" # 或者可以是 '*'
|
||||
args.enable_cors_header = "*"
|
||||
if hasattr(server.PromptServer.instance, "app"):
|
||||
# 获取应用实例
|
||||
app = server.PromptServer.instance.app
|
||||
# 创建并添加 CORS 中间件
|
||||
cors_middleware = server.create_cors_middleware(args.enable_cors_header)
|
||||
app.middlewares.append(cors_middleware)
|
||||
|
||||
|
||||
@ -165,13 +165,11 @@ export function parseURLPath(urlPath) {
|
||||
|
||||
|
||||
export const shareToEsheep= () => {
|
||||
// 1、获得workflow和图片信息
|
||||
app.graphToPrompt()
|
||||
.then(prompt => {
|
||||
const nodes = app.graph._nodes
|
||||
const { potential_outputs, potential_output_nodes } = getPotentialOutputsAndOutputNodes(nodes);
|
||||
const workflow = prompt['workflow']
|
||||
// 2、把workflow和图片保存到本地
|
||||
api.fetchApi(`/manager/set_esheep_workflow_and_images`, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
@ -180,14 +178,10 @@ export const shareToEsheep= () => {
|
||||
images: potential_outputs
|
||||
})
|
||||
}).then(response => {
|
||||
// 获取域名(不包含子域)
|
||||
var domain = window.location.hostname;
|
||||
// 获取端口号
|
||||
var port = window.location.port;
|
||||
// 如果端口为空字符串,则可能是使用了标准端口(80 for http and 443 for https)
|
||||
port = port || (window.location.protocol === 'http:' ? '80' : window.location.protocol === 'https:' ? '443' : '');
|
||||
var full_domin = domain + ':' + port
|
||||
// 打开新tab
|
||||
window.open('https://www.esheep.com/app/workflow_upload?from_local='+ full_domin, '_blank');
|
||||
});
|
||||
})
|
||||
|
||||
Loading…
Reference in New Issue
Block a user