Keep code and docs up to date with provided services
There is a huge discrepancy between the documented models and the actual models provided by remote services. This script aims to keep code and docs 1-1 with provided models.
def tgpt
error = "Error: Value error, Style Epicrealism-xl not in frozenset({'Geometric Logo', 'Biomech', 'Professional', 'GPT4o', 'Embroidery tattoo', 'F Super Realism', 'F Anime Journey', 'F Jojoso', 'Emblem Logo', 'F Whimscape', 'Neo-traditional', 'Flux', 'Photographic', 'SDXL L', 'Cheyenne-xl', 'RevAnimated', '3D Logo', 'Epic Logo', 'Old school colored', 'Old School', 'F Dalle Mix', 'Grunge Logo', 'Trash Polka', 'Pony-xl', 'Kawaii', 'F Pixel', 'Realistic tattoo', 'Realistic-stock-xl', 'Graffiti', 'F Retrocomic', 'Medieval', 'Chicano', 'Combination Logo', 'Cinematic Art', 'F Midjorney', 'F Dreamscape', 'F Retro Anime', 'Low Poly', 'Flame design', 'Minimalistic Logo', 'On limbs black', 'Death metal', 'Surrealism', 'Gradient Logo', 'F Anime', 'Dreamshaper-xl', 'On limbs color', 'Abstract Logo', 'Futuristic Logo', 'F Realism', 'Katayama-mix-xl', 'No Style', 'Anything-xl', 'F Epic Realism', 'Cor-epica-xl', 'Elegant Logo', 'Anime tattoo', 'Monogram Logo', 'Yamers-realistic-xl', 'F Koda', 'Japanese_2', 'F Pro', 'F Pencil', 'Red and Black', 'Juggernaut-xl', 'Watercolor', 'F Miniature', 'High GPT4o', 'GPT4o Ghibli', 'Black Ink', 'Fantasy Art', 'Mini tattoo', 'Mascots Logo', 'Anima-pencil-xl', 'Hand-drawn Logo', 'F Face Realism', 'Playground-xl', 'F Dev', 'Dotwork', 'F Softserve', 'New School', 'F Real Anime', 'Vincent Van Gogh', 'SDXL 1.0'})" # TBD: Automatically get this from provider via HTTP
list = error.scan(/'(.*?)'/).map(&:first)
File.read(file = 'src/imagegen/arta/arta.go').sub(/(?<=var Styles = \[\]string\{\n).*?(?=\})/m) { list.map { "\t\"#{it}\",\n" }.join }.then { File.write(file, it) }
File.read(file = 'md/usage.md').sub(/(?<=Supported models:\n)[^\n]+/m) { list.join(', ') }.then { File.write(file, it) }
end
@aandrew-me: Your comments here?
I don't think its a big issue. They keep changing the list of models. And they do provide the full list, which you can just save somewhere
Is there a URL for fetching the list, except for asking for a non-existing model?
I don't know. I didn't find any url
Then guess best bet is just put the list in a config file that the help and others read from, and before each release just run a faux request, parse that into the config file and commit it.
Reopen/post here if you solve this in some way.