Coder Social home page Coder Social logo

generative-art-node's People

Contributors

adnjoo avatar ayoubsousali avatar galaxyshub avatar grantreighard avatar haneenmahd avatar hashlips avatar moranil avatar philcon93 avatar stefan4d avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

generative-art-node's Issues

NPM install error??

When i try and run npm install under config.js in the terminal i get a bunch of err...

Same with npm init etc... I am on a mac. Anyone know the solution to this?

Getting this error - error Failed at the [email protected] build script.

Anyone have a fix for this? I validated and node, npm, etc are all installed correctly.

0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli 'C:\Program Files\nodejs\node.exe',
1 verbose cli 'C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'build'
1 verbose cli ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle [email protected]prebuild: [email protected]
6 info lifecycle [email protected]
build: [email protected]
7 verbose lifecycle [email protected]build: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]
build: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\Eric\NFT_Gen2\generative-art-node\node_modules.bin;C:\Users\Eric\AppData\Local\Programs\Python\Python39\Scripts;C:\Users\Eric\AppData\Local\Programs\Python\Python39;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Users\Eric\AppData\Local\Programs\Python\Python39;C:\Program Files\nodejs;C:\ProgramData\chocolatey\bin;C:\Program Files;C:\Winnt;C:\WINDOWS\System32\Wbem;C:\Winnt\System32;C:\Program Files (x86)\Nmap;C:\Users\Eric\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\Eric\AppData\Roaming\npm;C:\Users\Eric\AppData\Local\GitHubDesktop\bin
9 verbose lifecycle [email protected]build: CWD: C:\Users\Eric\NFT_Gen2\generative-art-node
10 silly lifecycle [email protected]
build: Args: [ '/d /s /c', 'node index.js' ]
11 silly lifecycle [email protected]build: Returned: code: 1 signal: null
12 info lifecycle [email protected]
build: Failed to exec build script
13 verbose stack Error: [email protected] build: node index.js
13 verbose stack Exit status 1
13 verbose stack at EventEmitter. (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:400:28)
13 verbose stack at ChildProcess. (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:400:28)
13 verbose stack at maybeClose (internal/child_process.js:1055:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
14 verbose pkgid [email protected]
15 verbose cwd C:\Users\Eric\NFT_Gen2\generative-art-node
16 verbose Windows_NT 10.0.19043
17 verbose argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "run" "build"
18 verbose node v14.17.6
19 verbose npm v6.14.15
20 error code ELIFECYCLE
21 error errno 1
22 error [email protected] build: node index.js
22 error Exit status 1
23 error Failed at the [email protected] build script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

10K editions

is it possible to create 10,000 without the program crashing?

Rarity constant not working

The rarity constant doesn't seem to be affecting the actual occurrence of outputs. Does anyone have a fix for this?

code ELIFECYCLE problem

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: node index.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

node index.js not found

help

debug issue

Whenever I try to run "node index.js" it states cannot find module and also my package.json has a debug issue at scripts anyone else run into this problem.

I can't seem to figure out what's the problem? (I'm relatively new to coding so any help would be great)

index.js issue

sorry for vagueness in title-
we have discovered this code through hustle millenial on youtube, we are very new to coding and have tried to follow this code line for line, however the code isn't visible in the video past around line 21. I had thought that possibly index.js and main.js are interchangeable, (since in the video, he had said he wrote it alongside hashlips), we were wondering if it is possible to see a copy of someone's index.js for reference on how to write it. ( Original copy of index.js and config.js were only 10 lines deep, as I said I am very new to coding so this may be a problem on how I extracted the file). Any and all help would be greatly appreciated, thank you in advance :) 👍
(https://user-images.githubusercontent.com/89998322/131891359-751a8bbd-bf94-4718-8a11-a9b4c3baa817.png)

config.js is not being recognized

I'm not very well versed in coding, but when I run the build it seems that no information from the config.js is being pulled. I've changed the format, the rarity, and the defaultEdition and it changes nothing. It still only gives me 5 editions. Also, when I rename a layer folder, it tells me that it is missing a directory even though I changed the directory name in the layersOrder. Any help with this? This code seems to be updated from the tutorial video with the addition of the config so any help would be greatly appreciated.

The rarity does not work for me

Is the rarity actually working? Im not good at coding especially Js but if I look through the code I cant see where the superrare is used?

Build script issue (on Imac)

Hi guys I am quite new to code and it gives me this error. I did npm install. After that I did npm run build. But nothing seems to work. Can someone help me out? The log is below v

0 info it worked if it ends with ok
1 verbose cli [ '/Users/rikhartgers/.nvm/versions/node/v11.5.0/bin/node',
1 verbose cli '/Users/rikhartgers/.nvm/versions/node/v11.5.0/bin/npm',
1 verbose cli 'run',
1 verbose cli 'build' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle [email protected]prebuild: [email protected]
6 info lifecycle [email protected]
build: [email protected]
7 verbose lifecycle [email protected]build: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]
build: PATH: /Users/rikhartgers/.nvm/versions/node/v11.5.0/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/rikhartgers/Desktop/generative-art-node-main/node_modules/.bin:/Users/rikhartgers/.nvm/versions/node/v11.5.0/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/share/dotnet:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Applications/Xamarin Workbooks.app/Contents/SharedSupport/path-bin:/Users/rikhartgers/.nvm/versions/node/v11.5.0/bin
9 verbose lifecycle [email protected]build: CWD: /Users/rikhartgers/Desktop/generative-art-node-main
10 silly lifecycle [email protected]
build: Args: [ '-c', 'node index.js' ]
11 silly lifecycle [email protected]build: Returned: code: 1 signal: null
12 info lifecycle [email protected]
build: Failed to exec build script
13 verbose stack Error: [email protected] build: node index.js
13 verbose stack Exit status 1
13 verbose stack at EventEmitter. (/Users/rikhartgers/.nvm/versions/node/v11.5.0/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
13 verbose stack at EventEmitter.emit (events.js:189:13)
13 verbose stack at ChildProcess. (/Users/rikhartgers/.nvm/versions/node/v11.5.0/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:189:13)
13 verbose stack at maybeClose (internal/child_process.js:978:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:265:5)
14 verbose pkgid [email protected]
15 verbose cwd /Users/rikhartgers/Desktop/generative-art-node-main
16 verbose Darwin 20.3.0
17 verbose argv "/Users/rikhartgers/.nvm/versions/node/v11.5.0/bin/node" "/Users/rikhartgers/.nvm/versions/node/v11.5.0/bin/npm" "run" "build"
18 verbose node v11.5.0
19 verbose npm v6.4.1
20 error code ELIFECYCLE
21 error errno 1
22 error [email protected] build: node index.js
22 error Exit status 1
23 error Failed at the [email protected] build script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

"This version of Node.js requires NODE_MODULE_VERSION 93"

Hello! I'm having this error pop up for me. I have tried several different ways to try and get around it, but it hasn't been successful. I've attempted to uninstall and reinstall both Node and VSC after downloading fresh installs from their websites, and restarting my computer. I've tried to rebuild with "npm rebuild bcrypt --update-binary" and while it worked for rebuilding dependencies, it did not seem to make a difference. I've also looked up a guide for using "./node_modules/.bin/electrion-rebuild" but that did not work either. I'm a little bit at a loss at what I should try next. Any advice or assistance is appreciated!

In case it is important, "npm rebuild" is not recognized but "npm install" works.

PS C:\Users[removed for privacy]\generative-art-opensource-main> node index.js
node:internal/modules/cjs/loader:1183
return process.dlopen(module, path.toNamespacedPath(filename));
^

Error: The module '\?\C:\Users[removed for privacy]\generative-art-opensource-main\node_modules\canvas\build\Release\canvas.node'
NODE_MODULE_VERSION 83. This version of Node.js requires
NODE_MODULE_VERSION 93. Please try re-compiling or re-installing
the module (for instance, using npm rebuild or npm install).
at Object.Module._extensions..node (node:internal/modules/cjs/loader:1183:18)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:94:18)
at Object. (C:\Users[removed for privacy]\generative-art-opensource-main\node_modules\canvas\lib\bindings.js:3:18)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12) {
code: 'ERR_DLOPEN_FAILED'
}

Unhandled promise rejection(s)

Miles and miles of errors with "unhandled promise rejections"

also, to add to the confusion i have generated a metadata file where it has selected the various layer/files, and stacked them together but then it doesn't generate any .png files

How do you set values for each rarity?

Ive been setting rarities with the code such as "_sr" it shows in the metadata but does not change the frequency of how often that image appears. i was wanting to know how to set values for how rare a thing should be. such as this hat is super rare so should only appear 1% of the time. how do i do this?

Module not found

keeps saying module not found after Ive typed in node index.js

Some time the same attributes

Hi all,

I have test with 250 and i have 16 files with the same attributes.
Check done with metadata.json.

How is it possible ?

Thanks for your help.

Have a good day

Customizing rarity issues

I noticed in the readme that there is an option to customize the rarity in the config file. Unfortunately, the documentation doesn't include the specific code required to customize the rarity. I want to customize the rarity of each layer/individual files to generate an NFT collection with corresponding rarity in the form of percentages. Any information regarding this subject would be greatly appreciated.

Generative Art in Games

Hello folks, thanks for this awesome example

I was wondering if you have experience using generative art with games, maybe using frameworks like PhaserJS and if you can share some tips about that

I want to create some examples in my Codepen collection: https://codepen.io/collection/AQWqbV

Best,
Juan

Im sorry if this is an obvious easy to fix problem but:

If i try npm run build it gives me this:

0 verbose cli [
0 verbose cli 'C:\Program Files\nodejs\node.exe',
0 verbose cli 'C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js',
0 verbose cli 'run',
0 verbose cli 'build'
0 verbose cli ]
1 info using [email protected]
2 info using [email protected]
3 timing npm:load:whichnode Completed in 0ms
4 timing config:load:defaults Completed in 1ms
5 timing config:load:file:C:\Program Files\nodejs\node_modules\npm\npmrc Completed in 3ms
6 timing config:load:builtin Completed in 3ms
7 timing config:load:cli Completed in 1ms
8 timing config:load:env Completed in 1ms
9 timing config:load:project Completed in 0ms
10 timing config:load:file:C:\Users\edgar.npmrc Completed in 0ms
11 timing config:load:user Completed in 0ms
12 timing config:load:file:C:\Users\edgar\AppData\Roaming\npm\etc\npmrc Completed in 0ms
13 timing config:load:global Completed in 0ms
14 timing config:load:validate Completed in 0ms
15 timing config:load:credentials Completed in 0ms
16 timing config:load:setEnvs Completed in 1ms
17 timing config:load Completed in 8ms
18 timing npm:load:configload Completed in 8ms
19 timing npm:load:setTitle Completed in 0ms
20 timing npm:load:setupLog Completed in 1ms
21 timing config:load:flatten Completed in 2ms
22 timing npm:load:cleanupLog Completed in 2ms
23 timing npm:load:configScope Completed in 0ms
24 timing npm:load:projectScope Completed in 0ms
25 timing npm:load Completed in 15ms
26 timing command:run-script Completed in 3ms
27 verbose stack Error: Missing script: "build"
27 verbose stack
27 verbose stack To see a list of scripts, run:
27 verbose stack npm run
27 verbose stack at RunScript.run (C:\Program Files\nodejs\node_modules\npm\lib\run-script.js:104:13)
28 verbose cwd C:\Users\edgar
29 verbose Windows_NT 10.0.19042
30 verbose argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "run" "build"
31 verbose node v16.8.0
32 verbose npm v7.21.0
33 error Missing script: "build"
33 error
33 error To see a list of scripts, run:
33 error npm run
34 verbose exit 1

thanks in advance

Rarities

Is there a way to create editions randomly rarity? I noticed rarity is in chronological order.

Installing Canvas Module

Hi all - thanks in advance for any help.

I get a failure 'Error: Cannot find module 'canvas''

Can anyone tell me how to get and install this module please?

The code doesnt seem to work well due to VS update? im new

I have been using the code for a while but today VS updated and the code no long works well. I run it (node index.js) and it creates the editions. However, after all the editions are created it takes ages for the terminal to return and i dont know why.

Here is an error code i got. Its to do with unhandledpromise rejection which have changed in the new visual studio. Can anyone help?

(node:4868) UnhandledPromiseRejectionWarning: Error: UNKNOWN: unknown error, open './output/8.png'
at Object.openSync (fs.js:498:3)
at Object.writeFileSync (fs.js:1524:35)
at saveLayer (C:\Users\samaf\Documents\generative-art-node-main\index.js:15:6)
at drawLayer (C:\Users\samaf\Documents\generative-art-node-main\index.js:58:3)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
(node:4868) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 3)
(node:4868) UnhandledPromiseRejectionWarning: Error: UNKNOWN: unknown error, open './output/8.png'
at Object.openSync (fs.js:498:3)
at Object.writeFileSync (fs.js:1524:35)
at saveLayer (C:\Users\samaf\Documents\generative-art-node-main\index.js:15:6)
at drawLayer (C:\Users\samaf\Documents\generative-art-node-main\index.js:58:3)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
(node:4868) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 4)

Super newb

Screen Shot 2021-09-09 at 7 32 53 PM

not sure is this worked properly
I ran the command npm install all

Screen Shot 2021-09-09 at 7 34 16 PM

Also this is all I have in my src/ config.js???

from what I thought this is not close to complete. I thought config.js was not suppose to be in "src folder " but in my input folder???

Layer folders not picked up in order

Changed folder names, updated new PNG files and when running node index.js it generates 3 files lets say if i set 3 as default. But it always picks last random file in last layer directory in config. It does not use any other folder above it
For ex
backgrounds',
'glasses',
'faces'

here only 1 image from faces is used and backgrounds and glasses are not used

Generated File Name

Is there a way to make the generated .png name a compilation of the layer names?

For example Layer1name_Layer2Name_Layer3Name.png

Thankyou!

Newb question

image

Getting the following error - followed instructions directly from readme. What am I missing?

Exporting Gif

Hey guys - If one of my layers is a gif, how could I generate the file output as a gif instead of a png? Appreciate any support.

Rarity Customization

How do you customize the rarity so that you can make a trait only appear 1 time out of 100 generated?

Customizing rarity in src/config.js

Hi all,

Any tips for how I customise rarity is src/config.js

Can I make it so that some layers only show 0.5% of the time, for example?

Also, what are the attributes for Original, Rare and SuperRare please and can they be changed or new categories added?

Thanks so much!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.