Sunday, August 6, 2023

Unstable Diffusion

Still messing around with AI, although it looks that -- PhotoShop's ad campaign to the contrary -- the tools really aren't up to automating the ugly parts of the process of making book cover art.

In a nutshell, the things that are a pain to do (like fixing bad blends, restoring textures) the AI messes up in various horrid and creative ways. And the things the AI does well (like really deep textures and complex lighting effects) are exactly the things you don't want back in the stages when you are still editing the thing.

Here's the imagined workflow; start with some stock art, change the clothing and pose. Add the right lighting and focus effects. Get everything balanced and properly composed. Now do a final clean-up and dazzle pass to fix tiny errors and add a little sparkle.

AI pretty much sucks as a partner for that workflow. At best, you can approximate by being extremely iterative. I've spent a bit too long in the inpainting stage. Select a shirt sleeve that looks wrong. Hand-paint over the worst of the problems. Run the AI a few dozen times -- twenty second a run really adds up here -- until you find one that seems to be in the right direction. Bounce that render back to the workspace, lather, rinse, repeat. Also dozens of times.

At the early stages it can be rather spectacular. But you are still dealing with the tragedy of the commons and how to speak search engine; you have to put it in terms the AI understands, and show it a picture that it can recognize. If you get it right...

Say you want to add a fresh apple to a table. Make a blob of red paint. I'm serious; the most primitive pen tool in the cheapest came-with-Windows paint program is plenty. Then emphasize the prompt terms, perhaps with specifics that will lead the AI to look in the right directions. And crop the selection carefully.

And if you get it right, a fully detailed photo-realistic apple will appear.

The ways in which it may go wrong are too many to list. The table turning into an apple is just one of them. The AI is also notorious about not parsing well; "Man in white shirt on the beach" returns, ninety percent of the time, a white sand beach. With or without a man in a shirt. It is basically like talking to the terrible search engines they have these days, which I am convinced are basically like those tempt-you shelves they build right in front of the checkout counter at the store. With any possible excuse they will send you towards what is popular with many people -- and profitable to them.

***

So I wanted to mess with my own model. Actually sort of got it working; threw in several photos of my own holocron and got the AI to render something that looked sort of like it when prompted.

But Dreambooth continues to bork. Here's the thing; these are largely labors of love by programmers and people in academia. Which means the current tools are largely by programmers written for an audience comfortable with at least basic python-tinkering. The installation of Automatic1111 is all "CD to the webui directory and pip the dll lfrom github...

And it is all multiple programs maintained by different people. Automatic1111 is a GUI -- a webui -- front-end to what would be a Python command line to the Stable Diffusion core, which depends in turn on a dozen different plug-ins like Coda and Torch to do the math, interface with the GPU for the computationally heavy work, etc. And then can host extensions like Dreambooth which may come with their own dependencies.

The current Automatic1111 expects xformers 1.18 or higher. The developer for xformers has already brought it up to 1.20, and in the BAT file for the Automatic1111 installation there's an automatic pip for the most recent version but, fortunately, it still works.

What doesn't work is Dreambooth, which requires under 1.18 -- which the developer no longer supports and isn't on github anymore -- but there is a 1.17dev function that will work if you edit several of the py files that point to it. And figure out how to force an unsupported version of xformers that can no longer be installed directly but has to be hacked in and possibly built manually in your own environment...

So basically my install keeps borking and throwing up "please install xformers!" and I'm just living with it. Any day now there will be a new version along and it will break everything again in some new and exciting way.

Meanwhile, I have writing to do.




Thursday, July 27, 2023

Won on the playing fields...

CC Alexander Williams


Huxley was at Eton.

I mean the character whose memoir sends Penny off to Paris on a sub-Dan Brown treasure hunt. I've been doing some pruning. You know; trim out some dead wood and open up things to allow air and light to circulate.

Which is to say; I decided the current draft of Sometimes a Fox is still a hard read. It is too unfocused, and yes part of the problem is not having a dynamic conflict at the heart of it. But it is also that it is too mosaic, too kaleidoscope, zigging and zagging like Matt Smith's Doctor at his worst.

I can't fix all of that, but Part II has many of the better scenes. And the reason is those are scenes that are focused mostly on one thing, and bring to bear mood and setting and a more direct narrative arc. The opening scene, for instance, is Penny goes for a morning run through the neighborhood of Montmartre.

And, oddly, the two big scenes at Pompidou. Sure, there's so much stuff about art history and techniques and politics, and an absolute ton of name-dropping of artists and works, but it is focused on a more-or-less singular subject and focused more-or-less on a point.

***

I was home sick, both feeling far too sick to go to work, and wanting to be careful because COVID is going around again and I had just run out of tests to confirm or deny. A bit of clear space to think again and I think I'm in a better space to finish the book now.

So started through from Page One, seeing where I could prune stuff out that wasn't advancing the thrust of that scene, and instead of leaving a hole, using the space to strengthen and re-iterate. Right down to the sentence level, recasting a sentence that was trying to say two different things, into two different sentences each of which was more focused.

And then I hit a bit where Penny remarks Jonathan Huxley is strewing his manuscript with the historical and classical allusions typical for a man of his time and education. "After all, he was a ___ graduate."

Oops. I'd thought about it. I'd done the research and I'd decided on a school. But...I'd been working on the book so long I forgot. And, no, I don't generally do character sheets so there was nowhere to look it up.

So that was a chunk of the evening. It mattered, because he'd described himself right on the title of his book; "A 'Tug' at the Laundry Boat."

It turned out to be one of those impossible search terms. I read multiple pages on slang and academic terms at Oxford and Cambridge and even poked around Canterbury. And turned up multiple descriptions of tug-of-war matches between various collegiate entities.

Finally I remembered I'd thought about sending him to one of the schools famed for turning out military men. And, yes...the King's Scholars at Eton get to wear a toga over their gowns. So they are known as Collegers, or colloquially, as 'tugs' -- spparently derived from the Latin Gens Togata.

And famed alumni from the King's Scholar list includes? Aldous Huxley.

Sunday, July 23, 2023

Coherence

Weekend is here and as usual I'm sleeping in, playing games, and basically just trying to recharge before the week starts again. Over a dozen people at the company and half of my own department caught the latest go-round of COVID and it is a little frightening even going outside at the moment.

Got through the first big chunk of the Galerie Viviene scene, at least. 

I feel like I am spinning wheels at work, too, and it is bugging me. There's a giant contract being negotiated right now and things may become very busy for us if it happens. But for now, I spent what felt like way too much time working on my laser.

Like I said, I got the thing to make some signs around the building. It sort of got more ambitious from there.

Machined a new mounting plate and the 20W head is on it (for diode lasers, there's only so much power you can shove through the die. So a 20W head is actually four diode lasers and a stack of optical glass to collimate the stuff into a single beam.) It is enough larger that the gantry no longer reaches the home stops. This model never had limit switches, though, so...

The air assist is also there. On the list; evacuation fans for the enclosure, along with a MERV-11 filter for all the burning that will be going on. I'm not too concerned about smoke as I don't intend to do production work on the machine. I'm not a charm bracelet shop at a boardwalk. I'm more concerned that the enclosure is still a work in progress.

Saturday, July 22, 2023

Not farming half as well as I know already

Annoying. I post a few answers about writing here and there on Quora. I'm one of those writers who thinks about how writing works. A lot. And this is an ongoing roundtable with people who have multiple traditionally-published books so...what I'm saying, what I think I know, isn't that far outside the norm.

Basically, I know how to write. I know how to construct a plot, build a story around it. How to keep the action moving and develop character and keep the pacing.

But I'm not doing it in the books I'm writing. Hell, my trunk novel -- Shirato -- did a better job of mechanically putting story together.

The Paris book is bringing the worst out of me. It is almost a thing I could have referenced inside the book; I recently finished the long chapter at the Centre Pompidou, with the HergĂ© exhibit. He seemed to get tired of the stock adventure plots, too, and his last two albums -- Catastifiore Emerald and Tintin and the Picaros are intentionally (HergĂ© said so himself in interviews) shaggy dog stories. Everyone runs around in the typical Tintin manner, and at the end of it, nothing is accomplished.

And, yes, I'm slipping in things that look like me talking about the writing process and my own art in specific. They aren't unintentional reveals, though. These are very much structured and planned. In the scene I'm working on now, when they enter Galarie Viviene Penny gives a quick overview of the passages of Paris in historical context.

And Amelia stops her with a "Do the people who watch your YouTube show really like that sort of thing?"

cc David Pendery
 

This is the setting for another parkour chase. I am still deciding whether to do the chase at the longer and more rambling Passage du Caire -- I might save that passage for the Egyptology stuff I'm thinking of getting into in Part III.

In any case, it feels too obviously like one event, followed by another event. I was reading a space opera I got free on Kindle earlier this week and I stopped at about half way through because while there was nothing wrong with it, there wasn't anything right, either. A thing happened. Then another thing. Some of the things were exciting, but there was no sense of an actual plot unfolding.

Well, if there is one thing I've been good at, it is seeding questions. I have always made sure to have something that the reader hopefully cares enough about to find out whether it will work, if they will succeed, where the artifact is, what she has been hinting about, etc.

But that's not the same thing as having a clear structure.

Travel adventure is bad because it turns so easily into travelogue. Scenes become an excuse to show off a new setting. But I find myself -- as in this Passage scene -- wondering what exactly the scene IS, if not a new place to show off while I move the mice of plot and character forward another space on the board.

Sigh. This one should have been easy to make it a strong plot. Unlike Penny's previous adventures, the plot starts right there in the prologue. She's got an old book with clues that lead to a treasure. What's more plot-like than that?

But then, this whole series is archaeology-adventure. Should have been plot from the word go. What went wrong?

Tuesday, July 18, 2023

Getting Malled

That was a nothing. I decided there had been far too much heavy lifting in the rest of the Pompidou chapter with name-dropping and philosophies of art and all that, so the brief parkour scene would do better to stick to raw emotional beats.

And that's done!

There was an event at my local cafe. PBS was coming in with a camera crew and they invited all their regulars to come by for free food. I brought my usual kit; iPhone, folding keyboard, collapsing phone stand I found on Thingiverse and printed up on my Ender 3. And I wrote the whole scene in one sitting.

Even got some of the peculiar philosophy of the first core group in there -- the group that named parkour, if I am remembering correctly. 

So in keeping with the "we've done enough Art History 101 for now," the next chapter is shopping at one of the remaining Passages of Paris. I'm still trying to pick which one. These are covered, pedestrian streets lined with shops and, often, highly decorated. Started in the mid 19th century -- more or less with the coming of gas lighting -- as a way for the growing upper-middle class to do their shopping and cafe hopping out of the rain and, even more importantly, out of the mud. They even had a lad stationed at the portal to brush the shit of the less-fancy streets outside off the shopper's boots.

The first shopping centers, like the famed Printemps, turned the economic tide, and Haussmann's bulldozing ran through where too many of the passages had been, too. There were barely a dozen left by the turn of the century.

In any case, this is more emotional-beats conversations; Amelia is picking up on hints from things Penny has said and is prodding her for more detail. Penny is trying to continue the argument about why it was necessary to know what Jonathan Huxley meant by his "lilies spin and spin" clue when it is so obvious the next clue is taking you to Opera Garnier anyhow.

And Jaques is showing up for a parkour rematch (Penny loses again -- I haven't decided what her latest injury should be.)

I might also use the space to talk a bit about dressing Parisian. That's a whole subject I'm not sure about opening up yet but I may need to begin the discussion here even though the bulk of it is happening in Part III. And that is, basically, masks.

The Japan book was all about masks and I don't really want to go there again, but there is some unfinished business. For the Passage sequence, the discussion is about dressing to fit in; on the one hand, being an obvious tourist gets you the wrong kind of attention; gouging by merchants and approaches by scam artists and thieves. And it is also impolite. They aren't Japanese, but the French prefer if everyone at least tries to keep the experience more Paris and less a Disney park.

On the other hand, you will never be mistaken for Parisian. And this is where the discussion starts; Amelia is who she is and feels it is dishonest to try to hide it. Penny is all about wading into the culture she is currently visiting.

Which isn't the same thing as donning a mask. That's something else Amelia, the comic book nerd, is getting into. Her laser-guided question, when she realizes Penny is always conscious that Penny, the archaeology student, is not Athena Fox, the world adventurer, is "Are you a Batman or a Superman?"

A question Penny completely misunderstands. She does eventually find the answer, and it is, really, just a slightly more nuanced version of what she discovered in Japan.

But where the previous "Rodin" chapter was sort of the thematic heart and turning-point of the novel, this could turn into the first clear phrasing of the problem at the heart of the character arc of this novel...

Sunday, July 16, 2023

A flower of precocious depravity


CCO, donated to Wikimedia Commons

One month now I've been working on the Rodin scene.

Almost not a scene, now. I'm at 3,500 words (my scenes average 1.5K)  But two fortunate things have happened; I've reached the end of the material I planned for the scene. And I looked up the details on Degas' ballerina sculpture.

Is there a lot going on with this sculpture, and even more, behind the scenes of this sculpture? Can we say, enough material for a ballet, a novel, a two-hour documentary and a stage musical?

Yeah. I thought Japan was bad. Doing a book in Paris alone is bad enough. Every street corner has history, and it is the kind of history that a lot of people know and care about. But doing one that is focused on the artist's colony of Montmartre in 1900? Ye gads.

The fortunate thing is that it became completely clear I can't go into the petit rats in this scene, not even in this part of the book. And that means the grisettes are off the table as well. Particularly for this scene, because Penny's new friend Amelia is being drawn into a romantic triangle between two artists of modern Montmartre, and half the Montmartre scenes are at a cafe named "La Boheme." So I'd rather not make it any more obvious than I have to what I am up to there.

I am still up in the air whether one of the chapter pull quotes in Part II is going to talk about the meat market at the foyer de la dance of the Paris Opera Ballet. Pretty much, I'm trying to push all that stuff into Part III, although I did have to talk about the "models and girlfriends" around the scene at Rodin's small country estate and studio in Meudon.


After finally getting off the phone and on the home computer, and seeing just how long that scene really was, I also figured out how to shift half a K of text about comic books out of the big Rodin scene and into the previous one on the grawlix-covered floor of the Pompidou center. A detail (from the 2006 Herge exhibition, not the later one) that I haven't seen mentioned or found photographs of so it remains a clue to the particularly well-informed reader.

I might go back and fill in later. I am planning to go back around after I've got a complete draft, to add more personal reactions to the art, some more philosophizing about art that isn't the somewhat cool and remote anthropological stuff I have now, and to dress up most of the "ate a croissant" stuff into a proper Symphony of Cheese. But for now, this scene does what it is supposed to.

Unfortunately, the final scene of this chapter -- and some key bits in the next -- is parkour.

Which means stopping again while I refresh my links on what turns out to be some pretty wacky philosophy that underlies this "jumping from roof to roof with a big flip in the middle" stuff.

Friday, July 14, 2023

Lasers, 8:00, day one



I got my own laser. A Longer diode laser (it isn't longer --although it is a nice 400mm x 400mm-- the company name is Longer). Diode laser is actually something to adjust to. I know lasers, but I was using CO2 (and one fiber). And it ain't just power that matters here, but frequency. Acrylic stops infrared so CO2 lasers plow right through the stuff. Diode lasers, however, are visible light. And wouldn't you know; the only pieces I had lying around were clear...and blue (several nanometers off from the diode frequency but still...)

And I've already went in a few hundred more for a Comgrow laser module. I wanted more power.



The air assist is coming next week (basically an aquarium pump -- 30 L/m and the Comgrow already has a blower head.) Unfortunately the base plate doesn't fit, so (possibly today) I'm machining a new one. The Longer is 12V, the Comgrow is 24V, but fortunately PWM is usually a 5V line. It works; I did a test fit just to see if everything was electrically compatible.




But what I really want is an eye-safe enclosure for it because eyeballs and twenty watts of visible-range light (well, any laser light) is a bad combination. The eye-safe limit is under 20mW. This laser is 20 watts.

I've put it through basic paces, and even on the original head I could cut 1/8" hardwood and 1/4" balsa, EVA foam, and black acrylic. And after a bit of work, engrave clear acrylic to make those edge-lit signs. When you see those things listed, the honest merchants call them "Engraving" lasers, not cutting lasers, because basically you want to go with CO2 (infrared range) or fiber and a bit more power to be serious about cutting.

And really, I got this thing to engrave. Specifically, to blast the anodizing off aluminium to make some signage for work. I was contemplating that or a baby CNC router just capable of cutting through the top layer of dual-color acrylic (the common thing for low-end awards plaques and the like). Just started reading up on lasers, saw how affordable they were, and got caught in the Jeff Goldblum trap.