-
Notifications
You must be signed in to change notification settings - Fork 208
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: Compatible with nai-diffusion-3 #213
Conversation
src/config.ts
Outdated
// emmmmm doesn't know why substituting curly brackets makes the picture ugly, so it's temporarily commented | ||
// input = input | ||
// .split('\\(').map(s => s.replace(/\(/g, '{')).join('\\(') | ||
// .split('\\)').map(s => s.replace(/\)/g, '}')).join('\\)') |
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.
What is going on with these lines, could you show me why isn't it working?
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.
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 think that is because NovelAI doesn't support vector multiplier, but using the {keyword}
and [keyword]
to strengthen or weaken the vectors.
So what you're writing is {solo:1.2}
rather than {{{{solo}}}}
, will it causing NovelAI failed to parse your prompt? Can you try these prompt on their website with the same parameters see whether you'd get the same result?
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.
src/index.ts
Outdated
@@ -379,6 +390,8 @@ export function apply(ctx: Context, config: Config) { | |||
const res = await ctx.http.axios(trimSlash(config.endpoint) + path, { | |||
method: 'POST', | |||
timeout: config.requestTimeout, | |||
// Since novelai's latest interface returns an application/x-zip-compressed, a responseType must be passed in | |||
responseType: getResponseType(), |
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.
Since there is only one exception here, you could just use the conditional expression here:
```suggestion
responseType: ['login', 'token'].include(config.type) ? 'arraybuffer' : 'json',
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 a neat and elegant suggestion, but I think writing a method will be more maintainable in the future.
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.
True, but in my thought this part would never goes complicated since there are only json
or arrabuffer
that we could handle here.
Co-authored-by: Shigma <[email protected]>
Also should we release a new version after merging this. |
No description provided.