这个是完整报错,下面只修改了自己的反向代理地址和密钥,其他功能是正常的就是不能跑图“/账户状态”和“#刷新Token”都是有反应的,唯独关于绘画功能无法使用,一开始以为是自己反向代理问题,检查了没问题,也测试过官方使用加速器和作者的反向代理都不行,加不进Q群只能来问问了
【nai-Plugin v0.0.1】 AxiosError: Request failed with status code 402
at settle (file:///C:/Users/Administrator/Desktop/bot/Yunzai-Bot/node_modules/.pnpm/[email protected]/node_modules/axios/lib/core/settle.js:19:12)
at IncomingMessage.handleStreamEnd (file:///C:/Users/Administrator/Desktop/bot/Yunzai-Bot/node_modules/.pnpm/[email protected]/node_modules/axios/lib/adapters/http.js:589:11)
at IncomingMessage.emit (node:events:530:35)
at endReadableNT (node:internal/streams/readable:1696:12)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
at Axios.request (file:///C:/Users/Administrator/Desktop/bot/Yunzai-Bot/node_modules/.pnpm/[email protected]/node_modules/axios/lib/core/Axios.js:45:41)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async getPicture (file:///C:/Users/Administrator/Desktop/bot/Yunzai-bot/plugins/nai-plugin/components/Core.js:30:16)
at async TaskQueue.processNextTask (file:///C:/Users/Administrator/Desktop/bot/Yunzai-bot/plugins/nai-plugin/components/Queue.js:58:27) {
code: 'ERR_BAD_REQUEST',
config: {
transitional: {
silentJSONParsing: true,
forcedJSONParsing: true,
clarifyTimeoutError: false
},
adapter: [ 'xhr', 'http' ],
transformRequest: [ [Function: transformRequest] ],
transformResponse: [ [Function: transformResponse] ],
timeout: 0,
xsrfCookieName: 'XSRF-TOKEN',
xsrfHeaderName: 'X-XSRF-TOKEN',
maxContentLength: -1,
maxBodyLength: -1,
env: { FormData: [Function], Blob: [class Blob] },
validateStatus: [Function: validateStatus],
headers: Object [AxiosHeaders] {
Accept: 'application/json, text/plain, */*',
'Content-Type': 'application/json',
authority: 'api.novelai.net',
Origin: 'https://novelai.net',
Referer: 'https://novelai.net',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 Edg/120.0.0.0',
Authorization: 'Bearer 密钥\',
'Content-Length': '733',
'Accept-Encoding': 'gzip, compress, deflate, br'
},
httpsAgent: null,
responseType: 'arraybuffer',
method: 'post',
url: 'https://自己反向代理/ai/generate-image',
data: '{"input":" 1","model":"nai-diffusion-3","action":"generate","parameters":{"width":832,"height":1216,"scale":5,"sampler":"k_euler","steps":28,"n_samples":1,"ucPreset":0,"qualityToggle":true,"reference_information_extracted":1,"reference_strength":0.6,"sm":false,"sm_dyn":false,"dynamic_thresholding":false,"controlnet_strength":1,"legacy":false,"legacy_v3_extend":false,"add_original_image":true,"uncond_scale":1,"cfg_rescale":0,"noise_schedule":"native","params_version":1,"seed":7315536396,"negative_prompt":"nsfw, lowres, {bad}, error, fewer, extra, missing, worst quality, jpeg artifacts, bad quality, watermark, unfinished, displeasing, chromatic aberration, signature, extra digits, artistic error, username, scan, [abstract]"}}'
},
request: <ref *1> ClientRequest {
_events: [Object: null prototype] {
abort: [Function (anonymous)],
aborted: [Function (anonymous)],
connect: [Function (anonymous)],
error: [Function (anonymous)],
socket: [Function (anonymous)],
timeout: [Function (anonymous)],
finish: [Function: requestOnFinish]
},
_eventsCount: 7,
_maxListeners: undefined,
outputData: [],
outputSize: 0,
writable: true,
destroyed: true,
_last: false,
chunkedEncoding: false,
shouldKeepAlive: true,
maxRequestsOnConnectionReached: false,
_defaultKeepAlive: true,
useChunkedEncodingByDefault: true,
sendDate: false,
_removedConnection: false,
_removedContLen: false,
_removedTE: false,
strictContentLength: false,
_contentLength: '733',
_hasBody: true,
_trailer: '',
finished: true,
_headerSent: true,
_closed: true,
socket: TLSSocket {
_tlsOptions: [Object],
_secureEstablished: true,
_securePending: false,
_newSessionPending: false,
_controlReleased: true,
secureConnecting: false,
_SNICallback: null,
servername: '自己反向代理',
alpnProtocol: false,
authorized: true,
authorizationError: null,
encrypted: true,
_events: [Object: null prototype],
_eventsCount: 9,
connecting: false,
_hadError: false,
_parent: null,
_host: '自己反向代理',
_closeAfterHandlingError: false,
_readableState: [ReadableState],
_writableState: [WritableState],
allowHalfOpen: false,
_maxListeners: undefined,
_sockname: null,
_pendingData: null,
_pendingEncoding: '',
server: undefined,
_server: null,
ssl: [TLSWrap],
_requestCert: true,
_rejectUnauthorized: true,
timeout: 5000,
parser: null,
_httpMessage: null,
[Symbol(alpncallback)]: null,
[Symbol(res)]: [TLSWrap],
[Symbol(verified)]: true,
[Symbol(pendingSession)]: null,
[Symbol(async_id_symbol)]: -1,
[Symbol(kHandle)]: [TLSWrap],
[Symbol(lastWriteQueueSize)]: 0,
[Symbol(timeout)]: Timeout {
_idleTimeout: 5000,
_idlePrev: [TimersList],
_idleNext: [Timeout],
_idleStart: 23182,
_onTimeout: [Function: bound ],
_timerArgs: undefined,
_repeat: null,
_destroyed: false,
[Symbol(refed)]: false,
[Symbol(kHasPrimitive)]: false,
[Symbol(asyncId)]: 4106,
[Symbol(triggerId)]: 4104
},
[Symbol(kBuffer)]: null,
[Symbol(kBufferCb)]: null,
[Symbol(kBufferGen)]: null,
[Symbol(shapeMode)]: true,
[Symbol(kCapture)]: false,
[Symbol(kSetNoDelay)]: false,
[Symbol(kSetKeepAlive)]: true,
[Symbol(kSetKeepAliveInitialDelay)]: 1,
[Symbol(kBytesRead)]: 0,
[Symbol(kBytesWritten)]: 0,
[Symbol(connect-options)]: [Object]
},
_header: 'POST /ai/generate-image HTTP/1.1\r\n' +
'Accept: application/json, text/plain, */*\r\n' +
'Content-Type: application/json\r\n' +
'authority: api.novelai.net\r\n' +
'Origin: https://novelai.net\r\n' +
'Referer: https://novelai.net\r\n' +
'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 Edg/120.0.0.0\r\n' +
'Authorization: Bearer 密钥\\r\n' +
'Content-Length: 733\r\n' +
'Accept-Encoding: gzip, compress, deflate, br\r\n' +
'Host: 自己反向代理\r\n' +
'Connection: keep-alive\r\n' +
'\r\n',
_keepAliveTimeout: 0,
_onPendingData: [Function: nop],
agent: Agent {
_events: [Object: null prototype],
_eventsCount: 2,
_maxListeners: undefined,
defaultPort: 443,
protocol: 'https:',
options: [Object: null prototype],
requests: [Object: null prototype] {},
sockets: [Object: null prototype] {},
freeSockets: [Object: null prototype],
keepAliveMsecs: 1000,
keepAlive: true,
maxSockets: Infinity,
maxFreeSockets: 256,
scheduling: 'lifo',
maxTotalSockets: Infinity,
totalSocketCount: 1,
maxCachedSessions: 100,
_sessionCache: [Object],
[Symbol(shapeMode)]: false,
[Symbol(kCapture)]: false
},
socketPath: undefined,
method: 'POST',
maxHeaderSize: undefined,
insecureHTTPParser: undefined,
joinDuplicateHeaders: undefined,
path: '/ai/generate-image',
_ended: true,
res: IncomingMessage {
_events: [Object],
_readableState: [ReadableState],
_maxListeners: undefined,
socket: null,
httpVersionMajor: 1,
httpVersionMinor: 1,
httpVersion: '1.1',
complete: true,
rawHeaders: [Array],
rawTrailers: [],
joinDuplicateHeaders: undefined,
aborted: false,
upgrade: false,
url: '',
method: null,
statusCode: 402,
statusMessage: 'Payment Required',
client: [TLSSocket],
_consuming: false,
_dumped: false,
req: [Circular *1],
_eventsCount: 4,
responseUrl: 'https://自己反向代理/ai/generate-image',
redirects: [],
[Symbol(shapeMode)]: true,
[Symbol(kCapture)]: false,
[Symbol(kHeaders)]: [Object],
[Symbol(kHeadersCount)]: 20,
[Symbol(kTrailers)]: null,
[Symbol(kTrailersCount)]: 0
},
aborted: false,
timeoutCb: null,
upgradeOrConnect: false,
parser: null,
maxHeadersCount: null,
reusedSocket: false,
host: '自己反向代理',
protocol: 'https:',
_redirectable: Writable {
_events: [Object],
_writableState: [WritableState],
_maxListeners: undefined,
_options: [Object],
_ended: true,
_ending: true,
_redirectCount: 0,
_redirects: [],
_requestBodyLength: 733,
_requestBodyBuffers: [],
_eventsCount: 3,
_onNativeResponse: [Function (anonymous)],
_currentRequest: [Circular *1],
_currentUrl: 'https://自己反向代理/ai/generate-image',
[Symbol(shapeMode)]: true,
[Symbol(kCapture)]: false
},
[Symbol(shapeMode)]: false,
[Symbol(kCapture)]: false,
[Symbol(kBytesWritten)]: 0,
[Symbol(kNeedDrain)]: false,
[Symbol(corked)]: 0,
[Symbol(kOutHeaders)]: [Object: null prototype] {
accept: [Array],
'content-type': [Array],
authority: [Array],
origin: [Array],
referer: [Array],
'user-agent': [Array],
authorization: [Array],
'content-length': [Array],
'accept-encoding': [Array],
host: [Array]
},
[Symbol(errored)]: null,
[Symbol(kHighWaterMark)]: 16384,
[Symbol(kRejectNonStandardBodyWrites)]: false,
[Symbol(kUniqueHeaders)]: null
},
response: {
status: 402,
statusText: 'Payment Required',
headers: Object [AxiosHeaders] {
server: 'nginx',
date: 'Thu, 09 May 2024 04:29:47 GMT',
'content-type': 'text/plain; charset=utf-8',
'content-length': '76',
connection: 'keep-alive',
'access-control-allow-origin': '*',
vary: 'Origin',
'x-content-type-options': 'nosniff',
'cf-cache-status': 'DYNAMIC',
'cf-ray': '880ef350cede0456-HKG'
},
config: {
transitional: [Object],
adapter: [Array],
transformRequest: [Array],
transformResponse: [Array],
timeout: 0,
xsrfCookieName: 'XSRF-TOKEN',
xsrfHeaderName: 'X-XSRF-TOKEN',
maxContentLength: -1,
maxBodyLength: -1,
env: [Object],
validateStatus: [Function: validateStatus],
headers: [Object [AxiosHeaders]],
httpsAgent: null,
responseType: 'arraybuffer',
method: 'post',
url: 'https://自己反向代理/ai/generate-image',
data: '{"input":" 1","model":"nai-diffusion-3","action":"generate","parameters":{"width":832,"height":1216,"scale":5,"sampler":"k_euler","steps":28,"n_samples":1,"ucPreset":0,"qualityToggle":true,"reference_information_extracted":1,"reference_strength":0.6,"sm":false,"sm_dyn":false,"dynamic_thresholding":false,"controlnet_strength":1,"legacy":false,"legacy_v3_extend":false,"add_original_image":true,"uncond_scale":1,"cfg_rescale":0,"noise_schedule":"native","params_version":1,"seed":7315536396,"negative_prompt":"nsfw, lowres, {bad}, error, fewer, extra, missing, worst quality, jpeg artifacts, bad quality, watermark, unfinished, displeasing, chromatic aberration, signature, extra digits, artistic error, username, scan, [abstract]"}}'
},
request: <ref *1> ClientRequest {
_events: [Object: null prototype],
_eventsCount: 7,
_maxListeners: undefined,
outputData: [],
outputSize: 0,
writable: true,
destroyed: true,
_last: false,
chunkedEncoding: false,
shouldKeepAlive: true,
maxRequestsOnConnectionReached: false,
_defaultKeepAlive: true,
useChunkedEncodingByDefault: true,
sendDate: false,
_removedConnection: false,
_removedContLen: false,
_removedTE: false,
strictContentLength: false,
_contentLength: '733',
_hasBody: true,
_trailer: '',
finished: true,
_headerSent: true,
_closed: true,
socket: [TLSSocket],
_header: 'POST /ai/generate-image HTTP/1.1\r\n' +
'Accept: application/json, text/plain, */*\r\n' +
'Content-Type: application/json\r\n' +
'authority: api.novelai.net\r\n' +
'Origin: https://novelai.net\r\n' +
'Referer: https://novelai.net\r\n' +
'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 Edg/120.0.0.0\r\n' +
'Authorization: Bearer 密钥\r\n' +
'Content-Length: 733\r\n' +
'Accept-Encoding: gzip, compress, deflate, br\r\n' +
'Host: 自己反向代理\r\n' +
'Connection: keep-alive\r\n' +
'\r\n',
_keepAliveTimeout: 0,
_onPendingData: [Function: nop],
agent: [Agent],
socketPath: undefined,
method: 'POST',
maxHeaderSize: undefined,
insecureHTTPParser: undefined,
joinDuplicateHeaders: undefined,
path: '/ai/generate-image',
_ended: true,
res: [IncomingMessage],
aborted: false,
timeoutCb: null,
upgradeOrConnect: false,
parser: null,
maxHeadersCount: null,
reusedSocket: false,
host: '自己反向代理',
protocol: 'https:',
_redirectable: [Writable],
[Symbol(shapeMode)]: false,
[Symbol(kCapture)]: false,
[Symbol(kBytesWritten)]: 0,
[Symbol(kNeedDrain)]: false,
[Symbol(corked)]: 0,
[Symbol(kOutHeaders)]: [Object: null prototype],
[Symbol(errored)]: null,
[Symbol(kHighWaterMark)]: 16384,
[Symbol(kRejectNonStandardBodyWrites)]: false,
[Symbol(kUniqueHeaders)]: null
},
data: <Buffer 7b 22 73 74 61 74 75 73 43 6f 64 65 22 3a 34 30 32 2c 22 6d 65 73 73 61 67 65 22 3a 22 4e 6f 74 20 65 6e 6f 75 67 68 20 41 6e 6c 61 73 2e 20 52 65 71 ... 26 more bytes>
}
}
[MiaoYz][12:29:47.297][INFO] [1394886625 => 833726631] 发送群消息:HTTP Error: 402
Error Message: Payment Required
发生未知错误,请联系网站管理员。
[MiaoYz][12:29:47.349][INFO] [1394886625 => 833726631] 发送群消息:出错啦,请联系开发者