Skip to content
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

long prompts with commas #8

Open
daleyhuddle opened this issue Sep 30, 2023 · 2 comments
Open

long prompts with commas #8

daleyhuddle opened this issue Sep 30, 2023 · 2 comments

Comments

@daleyhuddle
Copy link

daleyhuddle commented Sep 30, 2023

This works well for simple prompts. But if i give it a long prompt it dies bad (Windows 10). If i give it a prompt with commas it seems to choke pretty bad on the save file also.
I tried moving the path to the c:\tmp
and even chopping down the length but its not having it.

I actually have a good 30+ prompts already made that are quite long with many commas, was hoping to feed it. It would be nice to get the accurate folder name but not imperative, just cant get the save to work.
Any suggestions thanks?

console log - very long prompt no commas
C:\Users\Chris\Documents\apps\Bimg-0.1.5>node scriptdebug.js
Prompt Data:
[
'Black and white pencil sketch of annoyed English bus driver with moustache sitting in the bus driver seat. one hand on his forehead. camera view from left passenger side door entrance. reminiscent of a pencil sketch with a touch of cartoonish charm.The theme is dark and eerie. with strong shadows and crosshatching. '
]
Sending request...
https://www.bing.com/images/create?

Redirected to https://www.bing.com/images/create?
Waiting for results...
. { end: '', flush: true }
. { end: '', flush: true }
. { end: '', flush: true }
. { end: '', flush: true }

Downloading images...
An error occurred: Error: ENOENT: no such file or directory, mkdir '/tmp/Black and white pencil sketch of annoyed English bus driver with moustache sitting in the bus driver seat. one hand on his forehead. camera view from left passenger side door entrance. reminiscent of a pencil sketch with a touch of cartoonish charm.The theme is dark and eerie. with strong shadows and crosshatching. '
at Object.mkdirSync (node:fs:1398:3)
at saveImages (file:///C:/Users/Chris/Documents/apps/Bimg-0.1.5/node_modules/bimg/dist/imgen.js:104:12)
at generateImageFiles (file:///C:/Users/Chris/Documents/apps/Bimg-0.1.5/node_modules/bimg/dist/imgen.js:153:11)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async createImages (file:///C:/Users/Chris/Documents/apps/Bimg-0.1.5/scriptdebug.js:28:32) {
errno: -4058,
syscall: 'mkdir',
code: 'ENOENT',
path: '/tmp/. '

Console log - with COMMAS

Prompt Data:
[
'Black and white pencil , \r'
]
Sending request...
https://www.bing.com/images/create?
Redirected to https://www.bing.com/images/create?
Waiting for results...
. { end: '', flush: true }
. { end: '', flush: true }
. { end: '', flush: true }
. { end: '', flush: true }

Downloading images...
An error occurred: Error: ENOENT: no such file or directory, mkdir '/tmp/Black and white pencil sketch of annoyed English bus driver wi'h moustache sitting in the bus driver seat, one hand on his forehead. camera view from left passenger side door entrance,
at Object.mkdirSync (node:fs:1398:3)
at saveImages (file:///C:/Users/Chris/Documents/apps/Bimg-0.1.5/node_modules/bimg/dist/imgen.js:104:12)
at generateImageFiles (file:///C:/Users/Chris/Documents/apps/Bimg-0.1.5/node_modules/bimg/dist/imgen.js:153:11)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async createImages (file:///C:/Users/Chris/Documents/apps/Bimg-0.1.5/scriptdebug.js:28:32) {
errno: -4058,
syscall: 'mkdir',
code: 'ENOENT',
path: '/tmp/Black and white pencil \r'
}

@c1t1zen1
Copy link

c1t1zen1 commented Oct 1, 2023

Windows probably doesn't want to create folders that end in periods or commas. I run my prompts through a sanitizer script to remove any punctuation and make sure it ends on a letter not a space. I limit the length to 225 characters but even that can be too long for some cloud servers like Gdrive I've found.

@daleyhuddle
Copy link
Author

If there's a way to get a second parameter that is just for the output path , the prompt can still be anything, but the file path would be a variation (e.g first 220 characters and sanitized). I couldn't get that second parameter working though.

I did get the script to sanitize and parse new lines with multiple prompts from the text input file but many prompts are very long and can go up to maybe 500 chars on some of them. If that output path parameter gets added in would gladly donate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants