-
Notifications
You must be signed in to change notification settings - Fork 204
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat: list ckpt, lora, lyco, embedding, hypernetwork and inspect model details #206
base: main
Are you sure you want to change the base?
Conversation
Add a new option `-d` for adding default prompt to the user prompt. Allow user to generate images without input (in such case they must toggle the `default` option) Add a new short cut `default` for quick accessing default prompt without any user input.
Use respond prompt to replace the original prompt as feedback, because the prompt may be affected by some plugins (e.g. dynamic-prompts)
…ypernetwork models
lora endpoint already return lyco models so don't need to retrieve again
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 2 Unneccesary changes are marked at the below, you should apply format changes in a separated PR.
- Should use i18n API to construct the message rather than manually concatenate strings.
getLycoList
is defined but not got used, you missed it?
import { } from '@koishijs/translator' | ||
import { } from '@koishijs/plugin-help' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an unneccessary change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used eslint config from @koishijs/eslint-config
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but do it in the new PR, generally we should do one thing in a single PR.
} else if ( | ||
!config.defaultPromptSw | ||
&& session.user.authority < session.resolve(config.authLv) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unneccessary change.
src/utils.ts
Outdated
} | ||
return { | ||
img: fs.readFileSync(img), | ||
mime: path.extname(img) === '.jpg' ? 'image/jpg' : 'image/png', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JPEG's extname
can also be .jpeg
, besides, it should be image/jpeg
rather than image/jpg
.
So it would be better to do `path.extname(img) === '.png' ? 'image/png' : 'image/jpeg'.
|
||
export async function readModelInfo(modelName: string, modelPath: string): Promise<StableDiffusionWebUI.CivitaiModelInfo> { | ||
const dirname = path.dirname(modelPath) | ||
const modelInfoFile = path.join(dirname, `${modelName}.civitai.info`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{name}.civitai.info
is the info file from an extension of SD-WebUI right? Should it be mentioned in the document either?
I applied eslint config from
Fixed
In the testing, I found the lora endpoint already return lora and lyco, so I don't need to use getLycoList function anymore, I leave it there just in case |
@@ -485,6 +487,142 @@ export function apply(ctx: Context, config: Config) { | |||
} | |||
}) | |||
|
|||
const cmdLsEx = ctx.command('lsmd <modelName:text>') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The command should be novelai.listmodel
at first, and then add lsmd
as an alias.
.shortcut('lsckpt', { i18n: true, fuzzy: true, options: { ckpt: true } }) | ||
.shortcut('lslora', { i18n: true, fuzzy: true, options: { lora: true } }) | ||
.shortcut('lsemb', { i18n: true, fuzzy: true, options: { embedding: true } }) | ||
.shortcut('lshn', { i18n: true, fuzzy: true, options: { hypernetwork: true } }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally the short of hypernetwork should be hyp
, although it is not widely used.
|
||
lsmd: | ||
description: List all loaded models. | ||
usage: |- | ||
List all ckpt, lora, lyco,embedding, hypernetwork models when use without options. | ||
Use option to list specific type of models. | ||
Use option with model name or model index to get model description. | ||
|
||
options: | ||
ckpt: List ckpt models | ||
lora: List lora, lyco models | ||
embedding: List embedding models | ||
hypernetwork: list hypernetwork models | ||
|
||
shortcuts: | ||
lsckpt: lsckpt | ||
lslora: lslora | ||
lsemb: lsemb | ||
lshn: lshn | ||
|
||
messages: | ||
model: model | ||
model-name: model name | ||
trigger-word: trigger word | ||
description: description | ||
civitai-addr: CivitAI address | ||
filename: filename |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not add translation in an PR, it should be add from crowdin.
@@ -83,3 +83,30 @@ commands: | |||
expect-image: 请输入图片。 | |||
download-error: 图片解析失败。 | |||
unknown-error: 发生未知错误。 | |||
|
|||
lsmd: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be novelai.listmodel
as model.
Can you address these suggestions? |
Add a new command
lsmd
Solve #165