Jump to content

100+ new AI generated portraits


Recommended Posts

Using DALL-E openai, I was able to create quite a few portraits that have a Baldur's Gate type look and feel.

https://ahungry.com/img/ahungry-portraits/

Since I'm cheap, I won't have more credits until I get more freeby credits next month, but from what I've read, there is no official copyright on the tool's produced works (unless you anger the company via some abuse of their system and they revoke your rights to the images).

I wrote a small shell script to do the conversion of their png size/format into a BG compatible one.

Is there a good existing package (a portrait pack, or maybe portraits-portraits-everywhere?) that would want to incorporate these?  (I see PPE is already pretty loosy-goosy regarding copyright, since it has shots that are clearly from other games/media), or would it be worthwhile to wrap this in a tp2 setup file for an installable package and add to my github? (currently the tarball of all images is on my link, or someone can save as they like and add to their own save game "portraits/" directory).

Link to comment


 

      4  realistic painting of a baldur's gate portrait of an evil villain with a hood
      4  realistic painting of a baldur's gate portrait hero, paladin full helmet
      4  realistic painting of a baldur's gate portrait hero, lady thief
      4  realistic painting of a baldur's gate portrait hero, lady, stylized for a video game, vibrant
      4  realistic painting of a baldur's gate portrait hero, lady, stylized for a video game, dark lighting
      4  realistic painting of a baldur's gate portrait hero, lady, stylized for a video game
      4  realistic painting of a baldur's gate portrait hero, lady
      4  realistic painting of a baldur's gate portrait hero, evil lady thief
      4  realistic painting of a baldur's gate portrait hero, evil knight full helmet
      4  realistic painting of a baldur's gate portrait hero
      4  evil lady thief stylized like baldur's gate videogame oil painting
      4  baldur's gate villain with a hood photorealistic painting
      4  baldur's gate portraits female
      4  baldur's gate portrait photorealistic painting insane assassin
      4  baldur's gate portrait photorealistic painting fully armored warrior
      4  baldur's gate portrait photorealistic painting dwarf knight, evil and angry
      4  baldur's gate portrait photorealistic painting dwarf knight
      4  baldur's gate portrait photorealistic painting demonic female witch
      4  baldur's gate portrait photorealistic painting cute female wizard
      4  baldur's gate portrait photorealistic painting cute female witch
      4  baldur's gate portrait photorealistic painting cute female warrior
      4  baldur's gate portrait photorealistic painting cute female rogue
      4  baldur's gate portrait photorealistic painting
      4  baldur's gate game portraits female oil painting
      3  evil lady thief stylized like baldur's gate videogame digital art painting
      3  baldur's gate portrait photorealistic painting seductress
      3  baldur's gate portrait photorealistic painting pretty female witch
      3  baldur's gate portrait photorealistic painting fully armored demon
      3  baldur's gate portrait photorealistic painting demonic knight
      2  realistic painting of a baldur's gate portrait hero, paladin
      1  realistic cartoon of a baldur's gate portrait
      1  portrait of a baldur's gate hero on a dark background cute girl
      1  evil lady thief stylized like baldur's gate videogame digital art
      1  an oil painting portrait of a baldur's gate hero on a dark background

If anyone else has an openapi account and wants to continue where I left off, those were the prompts I used

Link to comment

The relevant conversion script (again, if anyone found it of interest):

#!/bin/zsh

set -ex

if [[ -z $1 ]]; then
    echo "Please target a directory for processing"
fi

dir=$1
cd $dir
outdir=/tmp/$(pwgen -1 8)

mkdir -p $outdir
cp *.png $outdir/
cd $outdir

for f in *.png; do
    name=$(pwgen -1 8).bmp
    convert -alpha off -resize 266 $f $name
    mogrify -gravity Center -crop 169x266+0+0 $name
done

rm $outdir/*.png

echo $outdir contains all the finalized images

 

Link to comment

Yea, I thought that was funny re: elves - and not a single prompt mentioned "elf" or "elves" either!  (when I prompted for dwarf they were spot on though)

The demon prompt was intentional, and it was cool to see - they block some generations based on keywords though (succubus is not allowed, but seductress is, lol)

Link to comment

lmao, think this poor guy had a couple of too many ales...or perhaps something else

eef4uoNg.bmp.jpg

Although pretty different from the BG1/2 art styles (stylistically speaking, they remind me more of NWN1 than anything else - generally more natural looking lighting and colors than NWN1 would offer, though, which helps them fit in more with BG), they are quite neat.

Edited by Bartimaeus
Link to comment
20 hours ago, ahungry said:

Is there a good existing package (a portrait pack, or maybe portraits-portraits-everywhere?) that would want to incorporate these?  ...

I'm a (very secondary) co-author of PPE.  I'll think about this, and if this technique can be conveniently used to create more portraits, which, in fact, could be used for NPCs

edit: I was thinking about BG style AI-generated portraits for a while actually. My main issue is that the style they are generated in is generic Deviant-Art-mostly-fantasy-character-art, which is often "branded" as resembling / being inspired by baldur's gate portraits or is mentioned in some context in conjunction with the term "Baldur's Gate", but the style is not really the one of BG

Edited by bob_veng
Link to comment
1 hour ago, subtledoctor said:

Can you explain what this does, and what we are supposed to do with the resulting files?

Like, is it as simple as:

  1. run that shell script on a directory  full of image files
  2. drop the resulting image files into /portraits?

?

Yup!  Spot on - it's what I used to turn the dall-e output into BG compatible files (the BG files need 24 bit, aka no alpha channel bitmaps, with filenames 8 chars or fewer).

It targets a directory of png files (that's the output of dall-e - it'd be easy to make this any type though), and copies all the files into a randomly named output directory in your /tmp dir (this script is assuming a *nix/POSIX type system).  For each image in there, it resizes to the appropriate image size, converts to bitmap with alpha off, and then runs a command to crop it to the proper width, while trying to crop so the center of picture is in the output.

The script requires zsh (the shebang at top) - that's for file iteration (using a for loop on ls output can have problems with space separated filenames) - it could be done in bash using "shopt -s globstar" option. 

It requires pwgen (a CLI password generator) for making the random file names (you could use $RANDOM in the shell, but they'd be pure numeric names then).

It requires ImageMagick suite (convert/mogrify commands) for the image manipulations (this is, to me, easier than doing each file by hand or by batch in gimp or photoshop).

When all is said and done, your /tmp/<random name> will have a bmp of each png, that should be usable in your "portraits/" directory.

Link to comment

Respect the script, I think you can remove a dependency, and make it safer to use, if you replaced pwgen with mktemp. I don't shell-script much, but I think that would be needed. I'm not sure how to remove the zsh dependency (I think that would require using quoting or `find` instead).

And thanks for the portraits of course. :)

Link to comment
1 hour ago, subtledoctor said:

Oh wait  - so, for the ones you have available for download, have you already done this conversion?

Yup!  It's just if anyone else wants to sign up for DALL-e/openai and make another set of images (it just requires email + phone) to add to the pile here.

The thumbnails on my link are jpg (they are 1/10th the size of the bmp and I was getting slammed with bandwidth after posting on reddit + here, about 2k unique visitors to the images so far, lots of lurkers I suppose), however the link they go to when opened up are already prepared bmp for use in game (and the tarball file is, of course, all the images in the prepared bmp format).

@suygood idea on mktemp - I think zsh can swap to bash with the shopt I mentioned (a quick one liner test seemed to show that worked - find had an issue because the exec I fed it only ran the pwgen output once, which caused all files to end up with the same random name, due to the shell expansion working on the inner most call up to the outermost call).

Can mktemp do file names (length constrained), not just directory?  If so, that's an easy update, maybe I'll post a bash alternative, I love fiddling with shells :D

Link to comment

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...