]> git.cworth.org Git - zombocom-ai/log
zombocom-ai
2 years agoValidate numeric code before form is submitted
Carl Worth [Thu, 8 Dec 2022 16:45:43 +0000 (08:45 -0800)]
Validate numeric code before form is submitted

The image generation script will reject any non-numeric seed as well
as any value larger than 2**32-1. So enforcing this up front at the
form will give the user a better experience.

2 years agoLog the user name when generating an image
Carl Worth [Thu, 8 Dec 2022 16:35:36 +0000 (08:35 -0800)]
Log the user name when generating an image

So I can more easily track that all the boys are staying involved

2 years agoExpand the safety-prompt possibilities a bit
Carl Worth [Thu, 8 Dec 2022 16:33:04 +0000 (08:33 -0800)]
Expand the safety-prompt possibilities a bit

Just to keep the variety up

2 years agoDon't show any images until the user generates a new one
Carl Worth [Thu, 8 Dec 2022 16:22:20 +0000 (08:22 -0800)]
Don't show any images until the user generates a new one

This way, every new user will have a similar initial experience and
get forced to figure out the image-generation form before seeing
anything else on the page.

2 years agoAdd a reuse button
Carl Worth [Thu, 8 Dec 2022 08:51:10 +0000 (00:51 -0800)]
Add a reuse button

To allow for easily reusing cool prompts to make similar images.

2 years agoFix replay of comments by putting them after replay of images
Carl Worth [Thu, 8 Dec 2022 08:44:29 +0000 (00:44 -0800)]
Fix replay of comments by putting them after replay of images

Since the elements we want to append comments to are only created by
the images.

2 years agoFix some overloaded use of "name" variable
Carl Worth [Thu, 8 Dec 2022 08:37:08 +0000 (00:37 -0800)]
Fix some overloaded use of "name" variable

Which was causing some excess prompting for a user name.

2 years agoMake a separate comments section for each image
Carl Worth [Thu, 8 Dec 2022 08:27:57 +0000 (00:27 -0800)]
Make a separate comments section for each image

Rather than a global one. So these comments elements are created
dynamically, each with their own unique id.

2 years agoFix class of comments element
Carl Worth [Thu, 8 Dec 2022 07:56:10 +0000 (23:56 -0800)]
Fix class of comments element

So the new stlying actually works.

2 years agoRemove the cancel button from the profile dialog
Carl Worth [Thu, 8 Dec 2022 07:36:33 +0000 (23:36 -0800)]
Remove the cancel button from the profile dialog

Previously, both buttons were behaving identically, so there's really
no reason to have the cancel button.

2 years agoSend along the user's name with each comment made
Carl Worth [Thu, 8 Dec 2022 07:32:15 +0000 (23:32 -0800)]
Send along the user's name with each comment made

So we can actually tell who said what in the chat.

2 years agoAdd a new profile button that lives at the upper-right of the page
Carl Worth [Thu, 8 Dec 2022 07:20:38 +0000 (23:20 -0800)]
Add a new profile button that lives at the upper-right of the page

Specifically, to allow the user to change their name.

2 years agoAdd a save of the session object when name is set
Carl Worth [Thu, 8 Dec 2022 07:07:38 +0000 (23:07 -0800)]
Add a save of the session object when name is set

Also add some debugging prints for name messages.

2 years agoAdd dialog for setting the user's name
Carl Worth [Thu, 8 Dec 2022 07:00:15 +0000 (23:00 -0800)]
Add dialog for setting the user's name

And force it to be shown when clicking the comment field, (if the name
has not been set previously).

2 years agoAdd a new 'reset' event from server to client before replay
Carl Worth [Thu, 8 Dec 2022 06:28:19 +0000 (22:28 -0800)]
Add a new 'reset' event from server to client before replay

This handles the case of a client that persists across a server
restart, (or various other disconnect/reconnect scenarios).

Prior to this commit, the client could end up with multiple copies of
images through the following sequence:

1. A client is chugging along with the server and has a set of images

2. The server is stopped and restarted

3. When the server comes up again it sees the client connect and so it
   replays all images

Boom. The client now has multiple copies of any image it already had.

To fix this, the server now sends a 'reset' event prior to sending any
replay of images. When the client gets this, it clears out all images
it has.

2 years agoAdd infrastructure for doing proper sessions
Carl Worth [Thu, 8 Dec 2022 06:12:40 +0000 (22:12 -0800)]
Add infrastructure for doing proper sessions

The sessions are stored server-side and in a persistent file store.

2 years agoAdd dependencies on express-session and session-file-store
Carl Worth [Thu, 8 Dec 2022 05:46:42 +0000 (21:46 -0800)]
Add dependencies on express-session and session-file-store

Again, this auto-commit was created with:

npm install express-session
        npm install session-file-store

2 years agoMake the safety prompt dynamic
Carl Worth [Thu, 8 Dec 2022 01:46:13 +0000 (17:46 -0800)]
Make the safety prompt dynamic

And significantly more interesting, I think.

2 years agoFix bug in clearing the spinner after image generation is done
Carl Worth [Thu, 8 Dec 2022 01:11:47 +0000 (17:11 -0800)]
Fix bug in clearing the spinner after image generation is done

The function is clearTimeout, not cancelTimeout.

2 years agoAdd exception handling to execution of image generation script
Carl Worth [Thu, 8 Dec 2022 01:05:58 +0000 (17:05 -0800)]
Add exception handling to execution of image generation script

So that if the script fails for some reason, the server doesn't crash.

2 years agoTimeout on image generation after 60 seconds
Carl Worth [Thu, 8 Dec 2022 00:57:18 +0000 (16:57 -0800)]
Timeout on image generation after 60 seconds

If the image doesn't come back, just hide the spinner and bring back
the form so they can try again.

2 years agoDisplay spinner while image is being generated
Carl Worth [Thu, 8 Dec 2022 00:47:43 +0000 (16:47 -0800)]
Display spinner while image is being generated

And hide it again when that's over.

2 years agoPrepend images as they are generated
Carl Worth [Thu, 8 Dec 2022 00:37:13 +0000 (16:37 -0800)]
Prepend images as they are generated

So that the most-recently-generated image is always there at the top,
without requiring a big scroll to reach it.

2 years agoHide image-generation form while generation is happening
Carl Worth [Thu, 8 Dec 2022 00:35:49 +0000 (16:35 -0800)]
Hide image-generation form while generation is happening

Giving the user a queue that something is happening (and helping to
avoid queueing the generation of multiple identical images).

2 years agoPut the safety-prompt button up by the label of the textarea it controls
Carl Worth [Thu, 8 Dec 2022 00:25:32 +0000 (16:25 -0800)]
Put the safety-prompt button up by the label of the textarea it controls

Hopefully this is both more intuitive and lays out better.

2 years agoAllow user to zoom
Carl Worth [Thu, 8 Dec 2022 00:10:10 +0000 (16:10 -0800)]
Allow user to zoom

Which can be important to be able to see an image more clearly.

2 years agoLimit generated filename to something not crazy
Carl Worth [Wed, 7 Dec 2022 19:58:07 +0000 (11:58 -0800)]
Limit generated filename to something not crazy

Since otherwise, with a crazy-long prompt, we could exceed the limit
of the filesystem, (which I think is 255 characters for what I'm using
for the server currently). In this commit, we don't use more than 200
characters from the prompt itself, to which we could add 10 from the
seed and another handful for separators and a file extension, so that
should be good.

2 years agoSwitch to new 2.1 model of Stable Diffusion and also 768x768 pixels
Carl Worth [Wed, 7 Dec 2022 19:52:44 +0000 (11:52 -0800)]
Switch to new 2.1 model of Stable Diffusion and also 768x768 pixels

That's a slightly more expensive mode to run in, but should still give
up to 1000 images for only $10.

2 years agoGenerate new structure for images
Carl Worth [Wed, 7 Dec 2022 18:17:52 +0000 (10:17 -0800)]
Generate new structure for images

Using both a figure and a figcaption for each image. This allows for
more structured styling.

2 years agoFix a mix-up of "code" vs. "seed"
Carl Worth [Wed, 7 Dec 2022 09:35:04 +0000 (01:35 -0800)]
Fix a mix-up of "code" vs. "seed"

The UI at the top-level facing the users uses "code", but the API down
deep uses "seed" so there has to be a switch at some point, which
wasn't quite correct before this fix.

2 years agoFix DOM code so that prompt and code appear for each image
Carl Worth [Wed, 7 Dec 2022 09:31:43 +0000 (01:31 -0800)]
Fix DOM code so that prompt and code appear for each image

The DOM really does make things so painful!

2 years agoReplay previous images to a client when it first connects
Carl Worth [Wed, 7 Dec 2022 08:58:06 +0000 (00:58 -0800)]
Replay previous images to a client when it first connects

so that the images are just as persistent as the comments

2 years agoClient: Add received images to the DOM
Carl Worth [Wed, 7 Dec 2022 08:54:37 +0000 (00:54 -0800)]
Client: Add received images to the DOM

Nothing fancy here for stlying yet, but it should be functional at least.

2 years agoHook the server up to actually generate images
Carl Worth [Wed, 7 Dec 2022 08:31:56 +0000 (00:31 -0800)]
Hook the server up to actually generate images

And the images are even being sent back to the clients, (but they are
just ignoring those events for now).

2 years agoAdd generate_image.py script
Carl Worth [Wed, 7 Dec 2022 07:55:29 +0000 (23:55 -0800)]
Add generate_image.py script

Which uses the dreamstudio interface to Stable Diffusion to generate
images from a text prompt. This does require an API key and has non-zero
cost, but I'm willing to do this for now, (and fortunately, the Stable
Diffusion code itself is entirely open-source so I could switch to my
own hardware when I decide to).

2 years agoAdd code to submit image generation instructions to the server
Carl Worth [Wed, 7 Dec 2022 06:35:20 +0000 (22:35 -0800)]
Add code to submit image generation instructions to the server

Though the server is just printing them on the console for now, and not
actually doing any image generation yet.

2 years agoFix typo
Carl Worth [Wed, 7 Dec 2022 06:22:52 +0000 (22:22 -0800)]
Fix typo

Zombocom, not Zombcom

2 years agoShift flex layout down into a new div below form-row
Carl Worth [Wed, 7 Dec 2022 06:19:22 +0000 (22:19 -0800)]
Shift flex layout down into a new div below form-row

Since flex was interfering with the grid we had working before.

2 years agoDrop explicit size from numeric code text input
Carl Worth [Wed, 7 Dec 2022 06:14:13 +0000 (22:14 -0800)]
Drop explicit size from numeric code text input

We're using CSS and flex to let this grow instead.

2 years agoSimple reword of "Numeric code" placeholder text
Carl Worth [Wed, 7 Dec 2022 06:06:17 +0000 (22:06 -0800)]
Simple reword of "Numeric code" placeholder text

Trying to make it more clear (and ensure it fits).

2 years agoAnd now read in saved comments at server start
Carl Worth [Wed, 7 Dec 2022 06:02:26 +0000 (22:02 -0800)]
And now read in saved comments at server start

So we should now have persistent messages across server restarts.

2 years agoWrite comments out to disk when the server exits
Carl Worth [Wed, 7 Dec 2022 05:39:24 +0000 (21:39 -0800)]
Write comments out to disk when the server exits

Which is half of what we need for fully persistent messages, (will
need to also load them at startup).

2 years agoAdd peristence of comments
Carl Worth [Wed, 7 Dec 2022 05:21:29 +0000 (21:21 -0800)]
Add peristence of comments

The server saves every message it receives, and replays them to each
new client when it joins.

Note: The server is only holding messages in memory, so there's not
yet any persistence across server restarts.

2 years agoAdd the second half necessary for functional comments
Carl Worth [Wed, 7 Dec 2022 04:24:27 +0000 (20:24 -0800)]
Add the second half necessary for functional comments

The server emits the comment back to all clients and the client appends
to a <ul> item (through simple DOM manipulations).

2 years agoAdd a (half)-functional comment field
Carl Worth [Wed, 7 Dec 2022 04:18:59 +0000 (20:18 -0800)]
Add a (half)-functional comment field

This sends the comment from the client to the server (but not back again).

The server process simply prints the comment out on its console.

2 years agoMake a socket connection from client to server
Carl Worth [Wed, 7 Dec 2022 04:11:15 +0000 (20:11 -0800)]
Make a socket connection from client to server

Nothing useful yet, just a print on the server side to prove it's working.

2 years agoAdd socket.io as a dependency
Carl Worth [Wed, 7 Dec 2022 04:07:40 +0000 (20:07 -0800)]
Add socket.io as a dependency

This commit was made with:

npm install socket.io

2 years agoFloat the "safety prompt" button to the right.
Carl Worth [Wed, 7 Dec 2022 02:02:05 +0000 (18:02 -0800)]
Float the "safety prompt" button to the right.

Starting to get this form to look like what I want.

2 years agoAllow the generate button to get its own styling
Carl Worth [Wed, 7 Dec 2022 01:52:33 +0000 (17:52 -0800)]
Allow the generate button to get its own styling

This needs to the be the equivalent of a "big red button" (even if not red).

2 years agoRestrict code input field to 10 characters
Carl Worth [Wed, 7 Dec 2022 01:50:19 +0000 (17:50 -0800)]
Restrict code input field to 10 characters

It really shouldn't need to be longer than that.

2 years agoMake the prompt a textarea to fit more text into it.
Carl Worth [Wed, 7 Dec 2022 01:44:43 +0000 (17:44 -0800)]
Make the prompt a textarea to fit more text into it.

Helping to suggest that this can be a rather long input.

2 years agoMake the "Safety Prompt" button actually do something.
Carl Worth [Wed, 7 Dec 2022 01:28:20 +0000 (17:28 -0800)]
Make the "Safety Prompt" button actually do something.

Eventually it will be a bit more dynamic than this.

2 years agoMove some padding from every p to a new "content" div
Carl Worth [Wed, 7 Dec 2022 01:21:55 +0000 (17:21 -0800)]
Move some padding from every p to a new "content" div

Trying to bring sanity to this mess styling.

2 years agoAdd some labels to the form fields
Carl Worth [Wed, 7 Dec 2022 01:04:30 +0000 (17:04 -0800)]
Add some labels to the form fields

To make it a little more clear what is going on.

2 years agoFix the mute toggle
Carl Worth [Wed, 7 Dec 2022 01:00:07 +0000 (17:00 -0800)]
Fix the mute toggle

Which we broke by dropping its id in the previous commit.

2 years agoAdd a "volume" class to the volume button
Carl Worth [Wed, 7 Dec 2022 00:57:05 +0000 (16:57 -0800)]
Add a "volume" class to the volume button

Since we recently added other buttons that shouldbe styled differently.

2 years agoAdd a simple form to the main page
Carl Worth [Wed, 7 Dec 2022 00:53:47 +0000 (16:53 -0800)]
Add a simple form to the main page

To allow for submitting a prompt to generate, (not that it does anything yet).

2 years agoRewrite primary path as /index.html
Carl Worth [Wed, 7 Dec 2022 00:45:52 +0000 (16:45 -0800)]
Rewrite primary path as /index.html

Since that's what we have Apache configured to look for.

2 years agoAdd a simple express server
Carl Worth [Wed, 7 Dec 2022 00:36:53 +0000 (16:36 -0800)]
Add a simple express server

And an HTML file for it to serve, (copied in from the zombocom-static
repository I made earlier today).

2 years agoAdd express4 as a dependency
Carl Worth [Tue, 6 Dec 2022 23:38:31 +0000 (15:38 -0800)]
Add express4 as a dependency

The changes here were made by running:

npm install express@4

And then adding the package-locj.json file (containing frozen versions
of all dependencies) and also ignoring the node_modules directory.

2 years agoAdd initial packages.json
Carl Worth [Tue, 6 Dec 2022 23:35:55 +0000 (15:35 -0800)]
Add initial packages.json

Just declaring a name, version, and description for this package.

Note: This is from following the tutorial at:

    https://socket.io/get-started/chat