Saturday, December 31, 2022

ChatGPT rewrites The Masque of the Red Death

ChatGPT is pretty good at writing prose and, to a greater or lesser extent, can imitate different writing styles. So I wondered if it could write The Masque of the Red Death in a kind of modernist, stream-of-consciousness style. The answer is maybe, but not this time. 

The result is not too much like Woolf's or Joyce's prose, but it is very readable and is probably more accessible than the original, at least to the modern reader.

Note: ChatGPT can only generate a limited amount of text at a time, so to coax ChatGPT into writing the story in chunks, rather than trying to summarise it all at once, I had to prompt it with something like "Rewrite the following text from Poe's The Masque of the Red Death in the first person past tense from the point of view of a guardian knight, using a highly emotional, stream-of-consciousness style with interior monologue similar to that of Virginia Woolf and James Joyce. Be sure not to use any of the original sentences, and use evocative, painterly metaphors:" and "Continue the story from the perspective of the knight by rewriting the following text in the same vein. Be sure not to use any of the original sentences, and use evocative, painterly metaphors."

The Masque of the Red Death, in the style of Woolf and Joyce

 I was a guardian knight for the Prince Prospero, sworn to protect him at all costs. The Red Death had ravaged the land for months, leaving a trail of blood and despair in its wake. Its symptoms were brutal - sharp pains, dizziness, and then the inevitable bleeding from every pore, until death. The scarlet stains that marked its victims were a curse, condemning them to isolation and loneliness. The whole ordeal lasted just half an hour, but it was a lifetime of suffering.

But the prince was different. He was happy, fearless, and wise. As the plague decimated his kingdom, he called upon a thousand of his closest friends and knights, including myself, to join him in a secluded abbey. It was a grand and opulent structure, built to the prince's own unique taste, with high walls and iron gates. We all worked together to weld the gates shut, determined to keep out any impulses of despair or madness. The abbey was stocked with everything we needed to weather the storm - food, entertainment, wine, and beauty. The outside world could fend for itself, as long as we had each other and all the comforts within.

It was at the height of the plague, during the fifth or sixth month of our isolation, that the prince threw a masked ball of extraordinary splendor.

It was a luxurious masquerade, held in seven irregularly shaped rooms - an imperial suite. Most palaces have straight corridors with folding doors that slide open to reveal the full length of the suite, but not here. The prince had a taste for the bizarre, and each room was arranged in a way that only allowed a limited view at a time. There were sharp turns every twenty or thirty yards, each one revealing a new surprise. On either side of the walls, tall and narrow Gothic windows looked out onto a closed corridor that followed the twists and turns of the suite. The windows were made of stained glass, each one a different color corresponding to the hue of the room it opened into. The eastern room was blue, the second purple, the third green, the fourth orange, the fifth white, the sixth violet. The seventh room, however, was shrouded in black velvet tapestries that covered the ceiling and walls, falling in heavy folds onto a carpet of the same color. The windows in this room were scarlet, a deep blood color. None of the rooms had any lamps or candelabra, but in the corridors outside each window stood a heavy tripod with a brazier of fire that cast its rays through the tinted glass, brightly illuminating the rooms. This created a multitude of dazzling and fantastical appearances. But in the western, or black, room, the firelight streaming through the blood-tinted windows gave a ghastly appearance, causing many of the guests to avoid setting foot inside.

It was in the western room where a massive ebony clock stood against the wall. Its pendulum swung back and forth with a dull, heavy, monotonous clang, and when the minute hand completed a circuit of the face, the clock struck the hour with a clear, loud, deep, and extremely musical note that was so peculiar it caused the musicians in the orchestra to pause momentarily in their performance, and the waltzers to stop their dancing. The whole company was momentarily disconcerted, and even the giddiest of guests grew pale while the more mature ones passed their hands over their brows as if in confusion or contemplation. But as soon as the echoes had fully faded, light laughter filled the room as the musicians smiled at their own nervousness and made whispered vows to each other not to be affected by the next chime. Sixty minutes later, when the clock struck again, there was the same disconcert and hesitation among the guests.

Despite these moments of unease, it was a lavish and magnificent celebration. The prince had a unique taste for color and effects, disregarding the traditional decorations of fashion. His plans were bold and fiery, and his ideas glowed with a barbaric radiance. Some might have thought him mad, but those who knew him understood that he was not. It was necessary to see, hear, and touch him to be sure.
The prince had taken great care in decorating the seven rooms for the masquerade, and it was his own unique taste that gave character to the costumes of the guests. They were certainly bizarre, with mismatched limbs and extravagant adornments, delirious fancies, and a mix of the beautiful, wanton, and grotesque, with a hint of terror and disgust. The rooms were filled with a multitude of dreams that seemed to writhe and take on the hues of the rooms, and the wild music of the orchestra seemed like the echo of their steps. Suddenly, the ebony clock in the hall would strike, causing a moment of stillness and silence, as the dreams froze in place. But as the chimes faded, a light, half-subdued laughter followed them as they retreated. The music would swell again, and the dreams came back to life, writhing more merrily than before, taking on the colors of the tinted windows through which the light from the tripods streamed. But no one dared venture into the westernmost room, where the night was drawing to a close and a ruddier light shone through the blood-colored windows. The blackness of the sable drapery was intimidating, and the muffled peal of the nearby ebony clock, more solemn and emphatic than any of the other rooms, echoed through the chamber.

But while the western room was empty, the other rooms were densely crowded, pulsing with the energy of life. The revelry continued until midnight, when the music stopped and the dancing slowed, replaced by a tense stillness. The clock struck twelve times, and as the last echoes faded, many in the crowd found themselves noticing a masked figure that had not been there before. The rumor of this new presence spread quickly, and there was a whisper of disapproval and surprise, followed by fear, horror, and disgust. In a crowd of phantoms such as the ones at the masquerade, it would take a truly extraordinary appearance to stir such a reaction. The masker had gone beyond even the prince's loose standards of propriety, with a costume and bearing that showed no wit or propriety. The figure was tall and gaunt, dressed in the clothes of the grave and wearing a mask that so closely resembled a stiffened corpse that it took close scrutiny to see the deception. But the masker had gone even further, taking on the appearance of the Red Death itself. The costume was splattered with blood, and the broad forehead and features were sprinkled with the scarlet horror.

When the prince laid eyes on the ghostly figure, which moved slowly and solemnly among the waltzers as if to fully embrace its role, he was first overcome with terror or disgust, followed by anger. "Who dares to insult us with this blasphemous mockery?" he demanded hoarsely of the nearby courtiers. "Seize him and unmask him so we can hang him from the battlements at sunrise!" His words rang clearly through the seven rooms as he stood in the eastern room, the blue one. He was a bold and robust man, and the music had stopped at the wave of his hand.

The prince stood in the blue room with a group of pale courtiers by his side. As he spoke, the group began to move towards the intruder, who approached the prince with stately steps. But no one put forth a hand to seize him, out of fear of the madman's assumptions, and he passed within a yard of the prince's person. He made his way through the blue room to the purple, then to the green, orange, white, and violet, before anyone moved to stop him. The prince, filled with rage and shame at his own cowardice, rushed through the six rooms with a drawn dagger, pursuing the figure. He approached within a few feet of the retreating figure, but as he reached the end of the violet room, the figure turned and faced him. The prince let out a sharp cry and dropped the dagger as he fell to the ground, dead. The other revelers summoned the courage of despair and rushed into the black room, seizing the tall, motionless figure in the shadow of the ebony clock. But they were horrified to find the grave clothes and corpse-like mask were empty, with no tangible form inside.

The Red Death had arrived like a thief in the night, and one by one, the revelers fell to the ground, covered in blood, and died in despair. The life of the ebony clock went out with the last of the revelers, and the flames of the tripods extinguished. Darkness, decay, and the Red Death held sway over all.

Sunday, December 04, 2022

Virginia Woolf's The Waves with Stable Diffusion 2.0

Virginia Woolf’s writing is not only poetic, but also wonderfully visual. At times her masterly fusion of language and visual imagery transcends mere language to become an alchemy of ideas. Take this example in The Waves when Bernard has a sudden epiphany about time:
 

'And time,' said Bernard, 'lets fall its drop. The drop that has formed on the roof of the soul falls. On the roof of my mind time, forming, lets fall its drop. Last week, as I stood shaving, the drop fell. I, standing with my razor in my hand, became suddenly aware of the merely habitual nature of my action (this is the drop forming) and congratulated my hands, ironically, for keeping at it. Shave, shave, shave, I said. Go on shaving. The drop fell. All through the day's work, at intervals, my mind went to an empty place, saying, "What is lost? What is over?" And "Over and done with," I muttered, "over and done with," solacing myself with words. People noticed the vacuity of my face and the aimlessness of my conversation. The last words of my sentence tailed away. And as I buttoned on my coat to go home I said more dramatically, "I have lost my youth."

'It is curious how, at every crisis, some phrase which does not fit insists upon coming to the rescue--the penalty of living in an old civilization with a notebook. This drop falling has nothing to do with losing my youth. This drop falling is time tapering to a point. Time, which is a sunny pasture covered with a dancing light, time, which is widespread as a field at midday, becomes pendant. Time tapers to a point. As a drop falls from a glass heavy with some sediment, time falls. These are the true cycles, these are the true events. Then as if all the luminosity of the atmosphere were withdrawn I see to the bare bottom. I see what habit covers. - p. 157

The merest of notes has furnished Bernard with this image, enabling him to give voice to the realisation that his youth has passed. By stretching time beyond the “old civilisation” he finds himself in, all the way to geological time, the sense of loss in his own life becomes palpable “as a drop falls from a glass heavy with some sediment”.

The Waves is divided into sections that mark the passing of time. At the beginning of each section a short passage describes the movement of the sun at that time of day, with the first starting just before sunrise. It is written in beautiful, painterly language, and I wondered how a text-to-image AI like Stable Diffusion would fare with this language.

Below is my attempt to create accompanying visuals for the first section using Stable Diffusion 2.0. Some were cherry picked after multiple rounds, while others were generated on the first or second attempt, The exact prompts I used are at the end.

The sun had not yet risen. The sea was indistinguishable from the sky, except that the sea was slightly creased as if a cloth had wrinkles in it. 

 

Gradually as the sky whitened a dark line lay on the horizon dividing the sea from the sky and the grey cloth became barred with thick strokes moving, one after another, beneath the surface, following each other, pursuing each other, perpetually.

 

 

As they neared the shore each bar rose, heaped itself, broke and swept a thin veil of white water across the sand. The wave paused, and then drew out again, sighing like a sleeper whose breath comes and goes unconsciously. 

 

Gradually the dark bar on the horizon became clear as if the sediment in an old wine-bottle had sunk and left the glass green. Behind it, too, the sky cleared as if the white sediment there had sunk, or as if the arm of a woman couched beneath the horizon had raised a lamp and flat bars of white, green and yellow spread across the sky like the blades of a fan. Then she raised her lamp higher and the air seemed to become fibrous and to tear away from the green surface flickering and flaming in red and yellow fibres like the smoky fire that roars from a bonfire. 

 

Gradually the fibres of the burning bonfire were fused into one haze, one incandescence which lifted the weight of the woollen grey sky on top of it and turned it to a million atoms of soft blue. The surface of the sea slowly became transparent and lay rippling and sparkling until the dark stripes were almost rubbed out. Slowly the arm that held the lamp raised it higher and then higher until a broad flame became visible; an arc of fire burnt on the rim of the horizon, and all round it the sea blazed gold.

 

The light struck upon the trees in the garden, making one leaf transparent and then another. One bird chirped high up; there was a pause; another chirped lower down. 

 

The sun sharpened the walls of the house, and rested like the tip of a fan upon a white blind and made a blue finger-print of shadow under the leaf by the bedroom window. The blind stirred slightly, but all within was dim and unsubstantial. The birds sang their blank melody outside.

 

Prompts

1.

As the sky whitened a dark line lay on the horizon dividing the sea from the sky, by John Constable

2.

As the sky whitened a dark line lay on the horizon dividing the sea from the sky.
Monet, Ken Bushe, John Kensett


3.

Before dawn, As they neared the shore each bar rose, heaped itself, broke and swept a thin veil of white water across the sand. The wave paused, and then drew out again, sighing like a sleeper whose breath comes and goes unconsciously.
Monet, Ken Bushe, John Kensett


4.

At sunrise by the sea, the sky cleared as if the white sediment there had sunk, or as if the arm of a woman couched beneath the horizon had raised a lamp and flat bars of white, green and yellow spread across the sky like the blades of a fan. Then she raised her lamp higher.
Byron Pickering, Albert Bierstadt, Turner, Henry Moore


5.

The surface of the sea slowly became transparent and lay rippling and sparkling until the dark stripes were almost rubbed out.
Slowly the arm that held the lamp raised it higher and then higher until a broad flame became visible;
an arc of fire burnt on the rim of the horizon, and all round it the sea blazed gold.
Monet, Byron Pickering, Albert Bierstadt, Turner


6.

At sunrise, the light struck upon the trees in the garden, making one leaf transparent and then another.
One bird chirped high up; there was a pause; another chirped lower down.
The sun sharpened the walls of the house, and rested like the tip of a fan upon a white blind.
Edward Hopper, Claude Monet


7.

After sunrise in the garden, the sun sharpened the walls of the house, and rested like the tip of a fan upon a white blind and made a blue finger-print of shadow under the leaf by the bedroom window.
The blind stirred slightly, but all within was dim and unsubstantial.
Edouard Manet, John Constable, Henry Woods, Henry John Sylvester Stannard

Colab notebooks

Stable Diffusion 2.0 - Woctezuma

Stable Diffusion 2.0 - God of AI