-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* share model * fix * Add SharedLoraLoader node (#154) * Add SharedLoraLoader node * poc of use js front end to get loras list (#156) * poc * refine * refine --------- Co-authored-by: FengWen <[email protected]> * fix SharedLoraLoader * Remove unused comments --------- Co-authored-by: Yao Chi <[email protected]> * refine message and add docs --------- Co-authored-by: dantegarden <[email protected]> Co-authored-by: FengWen <[email protected]> Co-authored-by: Yao Chi <[email protected]>
- Loading branch information
1 parent
ff1cff6
commit 48870fe
Showing
18 changed files
with
552 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# 分享自定义的 LoRA 模型 | ||
|
||
用户可以将已经上传的 BizyAir 模型设置为公开模式。这样可以直接让其他用户使用。 | ||
|
||
![](./imgs/usesharemodel03.png) | ||
|
||
## 将模型设置为公开 | ||
|
||
点击 “Model/Remote Folders” 菜单。 | ||
|
||
![](./imgs/share_model01.png) | ||
|
||
默认情况下,上传的模型都是非公开形式的,需要点击如图红圈所示的按钮,将模型设置为公开。 | ||
|
||
![](./imgs/share_model02.png) | ||
|
||
切换到 Public "Yes" 的标签栏,可以查看已经设置为公开的模型,点击如图所示的标志,可以取消公开该模型。 | ||
|
||
![](./imgs/share_model03.png) | ||
|
||
!!! note | ||
已经公开的模型是不能删除的,如果想删除公开的模型,需要先将其设置为非公开,再在非公开的标签页中删除该模型。 | ||
|
||
|
||
## 使用公开的自定义 LoRA 模型 | ||
|
||
使用 "☁️BizyAir Shared Lora Loader" 节点,即可显示指定 shareid 下的公开 LoRA。 | ||
|
||
|
||
![](./imgs/usesharemodel03.png) | ||
|
||
## 如何获取自己的 share id | ||
|
||
登陆 [cloud.siliconflow.cn](https://cloud.siliconflow.cn),点击右上角,可以查看并复制自己的 share id。 | ||
|
||
![](./imgs/usesharemodel01.png) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { api } from "../../../scripts/api.js"; | ||
import { app } from "../../scripts/app.js"; | ||
app.registerExtension({ | ||
name: "bizyair.siliconcloud.share.lora.loader", | ||
async beforeRegisterNodeDef(nodeType, nodeData, app) { | ||
if (nodeData.name === "BizyAir_SharedLoraLoader") { | ||
async function onTextChange(share_id, canvas, comfynode) { | ||
console.log("share_id:", share_id); | ||
const response = await api.fetchApi(`/bizyair/modelhost/${share_id}/models/files?type=bizyair/lora`, { | ||
method: "GET", | ||
headers: { | ||
"Content-Type": "application/json", | ||
}, | ||
}); | ||
|
||
const { data: loras_list } = await response.json(); | ||
const lora_name_widget = comfynode.widgets.find(widget => widget.name === "lora_name"); | ||
if (loras_list.length > 0) { | ||
lora_name_widget.value = loras_list[0]; | ||
lora_name_widget.options.values = loras_list; | ||
} else { | ||
console.log("No loras found in the response"); | ||
lora_name_widget.value = ""; | ||
lora_name_widget.options.values = []; | ||
} | ||
} | ||
|
||
function setWigetCallback(){ | ||
const shareid_widget = this.widgets.find(widget => widget.name === "share_id"); | ||
if (shareid_widget) { | ||
shareid_widget.callback = onTextChange; | ||
} else { | ||
console.log("share_id widget not found"); | ||
} | ||
} | ||
const onNodeCreated = nodeType.prototype.onNodeCreated | ||
nodeType.prototype.onNodeCreated = function () { | ||
onNodeCreated?.apply(this, arguments); | ||
setWigetCallback.call(this, arguments); | ||
}; | ||
} | ||
}, | ||
}) |
Oops, something went wrong.