Reference

Unique Phrases

This article collects some unique nonbiblcal phrases that are used in the Book of Mormon, that seem unique to Mormonism, but actually predate JS Jr.'s publication of the book.

Tabernacles of Clay

Book of Mormon

Mosiah 3:5:

... the Lord Omnipotent ... shall come down from heaven among the children of men, and shall dwell in a tabernacle of clay

Moroni 9:6:

... we have a labor to perform whilst in this tabernacle of clay, that we may conquer the enemy of all righteousness, and rest our souls in the kingdom of God.

The seemingly uniquely-Mormon phrase “tabernacles of clay” (above) is a strange beast. The three-word phrase is not found in the King James Version (KJV) of the English translation of the Bible. The phrase mixes the Old Testament concept of the “tabernacle” (the Jewish predecessor to the temple of Solomon which the children of Israel carried with them in the wilderness to worship the Lord) and especially Paul's reference to the mortal body as “our earthly house of this tabernacle” in 2 Cor. 5:1—with Old and New Testament phraseology about people metaphorically being or dwelling in earthen vessels, jars of clay, potter's vessels, etc. to express metaphorically that the human spirit dwells in a very temporary and flawed and breakable, mortal house of clay, especially in comparison to The Maker, The Potter, e.g. God. (This “tabernacle = temple” concept also reminds us also of the phrase “the body is a temple.”)

2 Cor. 5:1:

For we know that if our earthly house of this tabernacle were dissolved, we have a building of God, an house not made with hands, eternal in the heavens.

Old Testament

Jeremiah 18:4:

And the vessel that he made of clay was marred in the hand of the potter: so he made it again another vessel, as seemed good to the potter to make it.

Isa. 45:9:

Woe unto him that striveth with his Maker! Let the potsherd strive with the potsherds of the earth. Shall the clay say to him that fashioneth it (other translations, say to the potter), What makest thou? or thy work (say to the potter, e.g. God), He hath no hands?

Job 4:19:

How much less in them that dwell in houses of clay, whose foundation is in the dust, which are crushed before the moth?

Job 13:12:

Your remembrances are like unto ashes, your bodies to bodies of clay.

New Testament

Romans 9:21 (reference Isa. above):

Nay but, O man, who art thou that repliest against God? Shall the thing formed say to him that formed it, Why hast thou made me thus? Hath not the potter power over the clay, of the same lump to make one vessel unto honour, and another unto dishonour?

2 Corinthians 4:7–11:

But we have this treasure in earthen vessels (also alternately translated jars of clay), ... Always bearing about in the body the dying of the Lord Jesus, that the life also of Jesus might be made manifest in our body. For we which live are alway delivered unto death for Jesus' sake, that the life also of Jesus might be made manifest in our mortal flesh.

2 Cor. 5:1 (again):

For we know that if our earthly house of this tabernacle were dissolved, we have a building of God, an house not made with hands, eternal in the heavens.

1 Thess. 4:4:

That every one of you should know how to possess his vessel (translated body in NIV, ESV, etc.) in sanctification and honour.

2 Timothy 2:20:

But in a great house there are not only vessels of gold and of silver, but also of wood and of earth; and some to honour, and some to dishonour.

Rev. 2:27

And he shall rule them with a rod of iron; as the vessels of a potter shall they be broken to shivers (dashed to pieces like a potter's vessels, NKJV).

18th- & 19th-Century Preachers

The exact phrase, rendered into English in those three words, can be found in various sermons from the late 18th and early 19th centuries, showing that the phrase was in the religious zeitgeist at and around the time of the publication of the Book of Mormon:

The Critical Review: Or, Annals of Literature, Tobias Smollett, 1763, p.427:

Relate their peculiar gifts and graces, while dwelling in tabernacles of clay, they passed their mortal pilgrimage, in sacred love and pious ardour; imitating the bright example of their Saviour.

The Whole Works of the Late Rev. Mr. Ebenezer Erskine, 1798, p. 347:

Sirs, think upon it now; no sooner hath death dislodged you from these tabernacles of clay, and the eyes of your bodies shut, but that very moment you will find your souls sifted (“fifted” using obsolete typeset long s) before the awful tribunal of an infinite God, in order to have your eternal state determined.

The Whole Works of the Rev. William Bates, Vol 2, 1815, p. 297:

It is promised, “that God will dwell in us, and walk in us;” whose gracious presence is heaven upon earth. Strange condescension! that the God of glory should dwell in tabernacles of clay; far greater than if a king should dwell in a cottage with one of his poort subjects.

Joseph Hall, 1837, p.78, referencing 2 Cor. 5:1:

Let it not overgrieve us, to leave these tabernacles of stone, since we must shortly lay down these tabernacles of clay, and enter into tabernacles not made with hands, eternal in the heavens. Till then, farewell, my Dear Brethren, farewell in the Lord.

This should suffice to begin a reasonable discussion on the origin of this unique phrase in Joseph Smith's earliest scriptural production, in Mosiah 3:5 and Moroni 9:6, mentioned at the top.

Beggars Before God

Another concept from King Benjamin's address, Beggars Before God (Mosiah 4:16–26), also has precedent in a sermon of Dr. Hugh Latimer, 1824, p.72:

And here we be admonished of our estate and condition, what we be, namely beggars. For we ask bread [when we pray]; of whom? Marry, of God. What are we then? Marry, beggars: the greatest lords and ladies in England [presumably up through King George IV, as also King Benjamin] are but beggars afore God. Seeing then that we all are but beggars, why should we then disdain and despise poor men? Let us therefore consider that we [are] but beggars: let us pull down our stomachs; for if we consider the matter well, we are like as they be afore [sic] God: for St. Paul saith, Quid habes quod non accepisti? “What has thou that thou hast not received of God?” (1 Cor. 4.) Thou are but a beggar whatsoever thou art: and though there be some very rich, and have great abundance, of whom have they it? of God. What saith he, that rich man? He saith, “Our Father, which art in heaven; Give us this day our daily bread:” then he is a beggar afore God, as well as the poorest man.

I found this sermon with a less than a minute of using Google Book search. I'm sure more extensive research has been done on King Benjamin's revival sermon, but it doesn't really matter. With a total of perhaps 15 minutes of poking around, I found plausible sources for supposedly unique phrases and ideas in King Benjamin's sermon. I don't care if we can prove that Joseph had access to this sermon between 1824 and 1829 when he dictated it back to his scribes, we have stacks of other verified books and sermons and arguments from the early 19th century (and earlier) bursting through the seams of the Book of Mormon. Even if there is no discoverable direct link from this sermon to JS Jr. in upstate NY, if we accept the faithful perspective, we are asked to believe that God saw it fit to canonize the work of a Protestant preacher from the 1820s by sending this sermon back in time to King Benjamin, so ancient prophets could engrave it on metal plates multiple times, for centuries, abridge it, carry it thousands(?) of miles, bury it, come back from the dead, all to bring it back to the 19th century from whence it came. Who needs Ockham's razor when you have time travel?

This is not to criticize the content of the sermon in Mosiah 4. These verses are some of the most Christian and charitable verses in all of the scriptures of any religion. It should be required reading for the leaders of all Churches. It should be canonized. However, it should also be credited to the source.

Succor them that perish, that thyself perish not

I read the ending of Mosiah 4 and thought, the phrase “perish not” from John 11:50 seems unique enough for Benjamin to quote, worded “Remember, and perish not,” that I also decided to search for it, and found this mid-17th century gem (1651, written in nearly unreadable blackface), quoting the ancient Roman Seneca, headinged Precepts and Counsels:

  • Give no vain and unmeet gifts, as armor to women, books to fools, or nets to a student.
  • Give to the needy pearls that thou need not thyself.
  • Succor them that perish, yet so that thou thyself perish not thereby [(Mosiah 4:16 uses the word succor twice in the same context, Mosiah 4:30 says “remember and perish not”)].
  • If thou bestowest a beneft keep it secret, but if thou receivest any publish it abroad.
  • Speak not to him that will not hear, for so thou shalt vex him.
  • Give at the first asking, for it is not freely given, that is often craved.
  • Boast not thyself of that which is another man's.
  • Blame not nature, for she doeth for every man alike.
  • If thou wilt praise any man because he is a gentleman, praise his parents also; if thou praise him for his riches, that appertaineth to fortune, if for his strength, remember that sickness will make him weak; if for swiftness of foot, remember that age will take it away; if for his beauty, it will soon vanish. But if thou wilt praise him for manners and learning, then praise thou him as much as appertaineth to man, for that is his own, which neither cometh by heritage, nor altereth with fortune or age, but is always one.

Unholy Temples

The non-biblical phrase is used twice in the Book of Mormon (Alma 7:21, Helaman 4:24), and more often in JS Jr.'s later revelations, and throughout later Mormon discourse. However the phrase does predate the Book of Mormon, showing that it was used out in the broader world of Christian thought:

Henry Lee, The Scripture, Doctrine of the Atonement, 1752, p. 223:

But, otherwise, what would Christ, as an example only, avail us? He had the fullness of the Godhead dwelling in him: but does he dwell in sinners out of Christ? if he does, you must have more gods than one to suit your shceme; and you must say, they dwell in unholy temples of flesh, unless then you own our union with Christ; that he dwelleth in us, and we in him; (for being many we are one body in Christ) are also the temple of God, 1 Cor. 3:16,17,19, 2 Cor. 6:16.

Charles Lucas, in Joseph a Religious Poem, 1810, Book 24, p. 331:

  • Unknown of men, God sees and knows and [sic]
  • And are there no good Kings? Yes, there are they,
  • Who grind to dust the Serpent, spurn the Calves,
  • Destory the Groves of sin, throw down the Altars,
  • Scatter the Idols, slay the Worshippers,
  • And crush the unholy Temples to the ground,
  • So that no more the abominations rise.

Sing Redeeming Love

In Alma 5:9, Alma 5:26, Alma 26:13, another non-biblical phrase, refers to a hymn, “Lord's Day Morning” from 1816, 1821, 1826:

  • All hail, auspicious Morn, On which the Saviour rose;
  • Victorious over sin and death, And all our hellish foes.
  • The triumphs of this day, Demand a cheerful song;
  • Vast as the sacred name we sing, From all the ransom'd throng.
  • Then let my soul arise,
  • Nor longer sluggish lie,
  • Loud hallelujahs shall ascend, And reach the lofty skies.
  • Adieu, ye joys of sense, Be banish'd from my mind ;
  • This soul would find no room for you, Her joy is more refin'd.
  • My ransom'd soul would sit, And sing redeeming love;
  • Till Death should terminate my song, And she ascend above,
  • To see her risen Lord, In all his glory shine;
  • Mix with the millions round the throne, And join the theme divine.
  • Nor Sin, nor Death, nor Hell,
  • Nor grief, nor fear, nor pains,
  • Shall e'er molest that happy place,
  • There Christ triumphant reigns.

Land Bountiful

A Bountiful land amidst a sea of Arabian desert, with fruits, along a religious pilgrimage route

“Bountiful” is used as a place name in the Book of Mormon (and adopted later for the same purpose in Colorado and Utah), the term appears twice in the Old Testament—Proverbs 22:9: “He that hath a bountiful eye shall be blessed; for he giveth of his bread to the poor.” Isa. 32:5: “The vile person shall be no more called liberal, nor the churl said to be bountiful.”

The term is also used in Christian hymns from the 1820s: “Thou bountiful giver of mercy and grace,” (1822) and “Thou bountiful giver of glory and grace,” (1826) or “Which they hand hath conducted me through; What blessings bestow'd by a bountiful God.” (1823) etc.

The use of Bountiful as a proper name in English apparently dates to 1707 in the comedy The Beaux' Stratagem by George Farquhar (Lady Bountiful, Sir Charles Bountiful). This use of Lady Bountiful as a rich and generous woman entered the English lexicon.

As I kept searching for the phrase “bountiful land” in English literature throught 1828, I was trying to find Christian contexts (hymns, sermons), so I was ignoring the results that only referenced places in Arabia, before I realized that this is exactly how it is used in the Book of Mormon (1 Nephi 17): to refer to the place on the Arabic peninsula where they arrived, after a long journey across a harsh desert wilderness, before they crossed the Indian and Pacific oceans(!), in 600 BCE, aboard a ship made by amateurs, to the New World. Specifically, Arabia, by Josiah Conder, 1825, p. 289 states:

The whole of this tract is a real desert, containing no river, and only a few inconsiderable springs, no arable land, and scarcely a garden throughout the territory. Mekka and Djidda are the only towns: the other inhabited spots are little else than miserable villages, composed of barracks and tents established near a well or spring. Medinah and Tayif are represented as situated “on a bountiful land, with plenty of water, and covered with gardens and plantations.”

The asterisk here quotes Conder's own reference (Niebuhr):

Tayif, Niebuhr says, “is situate[d] upon a lofty mountain, in so agreeable a country, that the Arabs compare its environs to those of Damascus and Sanaa. This city supplies Djidda and Mekka with excellent fruits, particularly raisins, and carries on a considerable trade in almonds, which grow in great plenty in its territory.” He was told, also, of “a charming valley,” called Wady Fatima, somewhere between Mekka and Medinah, which Mohammed is said to have bestowed as a dowry on his daughter Fatima. It occurs in the western hadji route [(the hadj is one of the pillars of Islam, a pilgimage to the Holy Mecca)], one day's journey from Mekka.

Note that in this part of the Book of Mormon, the land Bountiful is a sort of desert oasis waypoint that also occurs along the route of a religious pilgrimage.

Any one of these points of connection could be dismissed as a coincidence, but to find four in the space of a single page of a book available in English in 1826 really marks this as a potential bullseye.

Every time I think, OK, this one weird angular phrase might be unique to the Book of Mormon, it keeps turning on its head and revealing that any imposter (not JS Jr.) could have written a so-called ancient narrative and included this detail by simply reading material available in their own time, without the need for revelation or ancient records. Luckily no one else attempted to do such a dishonest thing.

Book of Mormon names and places from an antiquities dictionary

Specifically Charles Anthon's A Classical Dictionary, sixth edition 1827. Yes that Charles Anthon (cf. early D&C section and 2 Nephi 27: I cannot read it (a sealed book)).

Helorum

A silver bullet, bullseye, right on target. Anthon 1827, p.334, a town of Sicily.

Moron

From Ancient Greek μωρόν. Attested in 18th and 19th century works:

  • 1823, a Spanish place name (also listed in 1815 as a town of Seville hit by the Pestilential Fever)
  • Also, the character Moron in Moliere's play “The Princess of Elis,” one English translation dates to 1748.

Martin Luther, 1537: Melchizedek a High Priest like unto Jesus Christ

The direct references to Melchizedek in the Bible are fairly slim.

Gen 14:18–19:

And Melchizedek king of Salem brought forth bread and wine: and he was the priest of the most high God. And he blessed him, and said, Blessed be Abram of the most high God, possessor of heaven and earth: 14:20 And blessed be the most high God, which hath delivered thine enemies into thy hand. And he gave him tithes of all.

Psalm 110:4:

The Lord hath sworn, and will not repent, Thou art a priest for ever after the order of Melchizedek.

In the New Testament, Melchizedek is not mentioned directly, but Hebrews 2:17–3:2 interprets the idea of Christ being a High Priest thus:

Wherefore in all things it behoved him to be made like unto his brethren, that he might be a merciful and faithful high priest in things pertaining to God, to make reconciliation for the sins of the people. For in that he himself hath suffered being tempted, he is able to succour them that are tempted. Wherefore, holy brethren, partakers of the heavenly calling, consider the Apostle and High Priest of our profession, Christ Jesus; Who was faithful to him that appointed him, as also Moses was faithful in all his house.

Martin Luther and later preachers explained to the Protestant Christian world for hundreds of years this idea that Melchizedek was an archetype of Jesus. For example, 1788, translated from Martin Luther (1483–1546) into Dutch, Lutheran Small Catechism translated from German by J. A. Cramer (3rd edition), p.204–205:

Jezus Christus wordt in de Schrift een Hoogepriester genoemd, en wel miet alleen als Aäron, maar ook als Melchizedek, welke zyne voorbeelden waren. Hy was een Hoogepriester, ais Aäron, dewyl hy de menfchen aangaande Gods wil onderricht, hen met zyn lyden, als de eenige waare offerande voor de zonde, van alle de ellende derzelve verlost beeft, en voor hen bidt, gelyk als Aäron en zyne navolgers in het Toodfche Hoogepriester om de Jooden van Gods wille moesten onderrichten, voor hen offeren, en voor hen bidden. Hy was een Hoogepriester, als Melchizedek, dewyl hy ook een Heer aller menfchen is, en zich van zyne magt en heerfchappye bedient, om hen zalig te maaken, gelyk als Melchizedek, die een Koning te Salem was, den geloovigen Abraham zegende, zynen onderdaanen den vrede bezorgde en hen gelukkig maakte. Wegens alle deeze werken wordt onze Heiland ook de Middelaar tusfchen God en de menfchen genoemd.

Google Translate, into English:

Jesus Christ is called a High Priest in Scripture, not only as Aaron, but also as Melchizedek, who were his examples. He was a High Priest, like Aaron, because he taught people about God's will, redeemed them from all its misery by his suffering, as the only true sacrifice for sin, and interceded for them, just as Aaron and his followers in the Holy High Priesthood were required to teach the Jews about God's will, sacrifice for them, and pray for them. He was a High Priest, like Melchizedek, because he is also Lord of all people, and uses his power and dominion to save them, just as Melchizedek, who was King in Salem, blessed faithful Abraham, brought peace to his subjects, and made them happy. Because of all these works, our Savior is also called the Mediator between God and mankind.

From 1537, The 110th Pslam: Saith the Lord. Preached and Expounded through Dr. Martin Luther, p.228–231. (Google Translate, cleaned up and bold emphasis added):

Now this Story has carefully examined the Epistle to the Hebrews and interpreted from it this text (You are a priest after the way of Melchizedek) and shown the difference between the priesthood of the New Testament and the Old Testament and concluded that this priesthood of Christ (which was formed through Melchizedek) must be much higher and better than the Levite. Firstly, because this priest Melchizedek blesses the patriarch Abraham and takes tithes from him. For since he is thus blessed, he is lesser and less than he who blesses, and not the greater to the lesser, but the one who gives tithes to the greater, must therefore be greater and greater than Abraham. But if he [(Melchizedek)] is greater than Abraham, he must also be greater before Aaron. Abraham is indeed the highest man among all those the Jews can praise. As the deity and source or stem and root of the entire people, and indeed greater than Levi and Aaron, who were born of his blood and flesh. Therefore, all who can come from him (including Levi with his priesthood) must be under this Melchizedek who blesses their patriarch and priest and takes the tithes from him. Yes, they themselves are forsaken in Abraham (says the same epistle) when they were still in his loins and not born.

Secondly, the same epistle also noted that this priest, Melchizedek, is remembered so: briefly, and nothing is said about him, where he came from or where he stayed, but neither the beginning nor the end of his lineage is reported. Yet everything about Aaron is written clearly, and his entire lineage from Abraham is clearly distinguished, including how he was called to the priesthood and, indeed, how he died, and [from whom] he inherited the priesthood. This holy prophet also considered this and added the word (Eternal Priest) to it. That, just as one finds this Melchizedek no father and mother, beginning and end, it is not that he had no father and mother, but that nothing is written about it. Therefore, Christ (who was formed through him) is truly a such a priest, who has neither a beginning nor an end, but is from eternity and remains forever.

If the Jews had opened their eyes and read the Scriptures properly, they would have realized that their priesthood, the Levite one, and the Aaronic one, which came after, would not be the true permanent priesthood, but [they] would wait for another priest and priesthood, which would be higher and better than the temporal kingdom and priesthood that all their forefathers had been. For with this (which he calls Christ, a priest forever after the order of Melchizedek) he lifts up all of them and casts them under the feet. The Word (a priest after the order of Melchizedek) which was swept through Abraham, sets it (as said) over Abraham and all his people, also over King David. But the Word, forever, does not raise him as only over Abraham and David, but over all kings and kingdoms, yes, over Israel and earth. For it shows and proves that he must not only be a true man (which the word, priest, brings with it), but must also be a true God, because he is without beginning and end and existed before both Abraham and David. As he which he also named his father above, before he was ordained.

Now this is said of the person of this priest [(Melchizedek)]: that he is a different man than Aaron, Abraham, and the entire Jewish people. But we must also consider the difference in office between Aaron's and Christ's Priesthood. This is also shown by the words (according to the way Melchizedek, that is, also as it is written and read by Melchizedek) For thus it is written there (as said in) Genesis 14, when Abraham came from the slaughter which he had won from the five kings, this Melchizedek brought bread and wine before him, and as he was a priest of God, he swept Abraham with a beautiful, glorious blessing.

To summarize the point here, as Wikipedia explain about Melchizedek in Protestanism: “Traditional Protestant Christian denominations, following Luther [(who died in 1546)], teach that Melchizedek was a historical figure and an archetype of Christ. Tremper Longman III notes that a popular understanding of the relationship between Melchizedek and Jesus is that Melchizedek is an Old Testament Christophany – in other words, that Melchizedek is Jesus, or at the very least, is a close resemblance of Jesus.” Martin Luthers's interpretation for essentially all of Protestantism is not something that developed after Christians read the Book of Mormon, rather it predates the Book of Mormon intrepretation by nearly 300 years. Though grabbing a few quotes in German (1537) and Dutch (1788) does not show exactly how the idea made its way from 16th century European German to early 19th century English (1826), the point is that the idea is old (but newer and more fleshed out than in the New Testament, and well over a thousand years after Moroni buried the plates) and not original to JS Jr., and did not need to be delivered by revelation because it was already widely circulated in print for three hundred years.


Programming

More from Less

Too much has been written already about AI Art and how it is killing puppies.

But even people like me who enjoy playing with generative AI tools still don't like finding AI-art-based images mixed in with images made by humans the old-fashioned ways—by hand (analog art or digital painting, or pixel art), by camera, or by CGI. When I'm looking at photos, I don't want to see some random fake non-photo mixed in there. When I'm looking at art made by humans, I want to see art made by humans. Perhaps just share AI art in places where AI art is shared, with a prominent label. If we don't cross the streams, perhaps fewer people will get cranky.

Given that starting place, this article documents the tail-end of a long multi-year process of human-machine hybrid image creation. (I won't call it art because it makes the anti-AI knee-jerk brigade come out of the woodwork.) But assuming the reader is not some sort of Luddite, he may follow along.

And this article is not about the images themselves, per se, or if this is good or bad for artists or for society as a whole, or even about AI itself, it's about what one programmer figured out how to do with certain tools available today. This is actually a programming journey.

What Are We Even Talking About?

My goal has gradually crystalized into this: overcoming the resolution limits of image generation tools and create appealing super-high-resolution poster-sized images, up to 8k or in the 30 Megapixel to 60 Megapixel range (example 1, 2), with increasing level of detail in places that make sense.

An example image

For the purposes of this article, assume the subject is portraiture/figurative and the max level of detail on the image is at the face. The background would naturally have less detail, as in an oil painting or a photograph with a depth of field effect. This artfully tells the viewer where the gaze should return to. This requirement of actually having detail when zoomed way in (for at least some part of the image) precludes simply depending on Topaz Gigapixel AI to turn an image of 1.5 Megapixels (or as low as 0.25 Megapixels) into anything nearly big enough. Gigapixel upscaling can achieve a lot, but without the newer generative features, it can't achieve miracles. But my process can.

Original, Painfully Slow, Too-Manual Process

My initial process involved using Wombo AI art online (from an iPad) to generate an image, then cropping the image repeatedly and doing Image-to-Image to create successively more detailed areas of the image (two nested crops of the original image, the third image generated from a crop of the second). The sad part was trying to take these assets, all the same size, say three images 1080 wide by 1920 tall, and combining them into a single image without upscaling artifacts. Naively upscaling using Bilinear, Bicubic, or even Lanczos will result in "screen-door" artifacts on the "zoomed out" parts (less detailed parts) of the image. (This also create problems for the final "free" 2x upscale in Gigapixel AI—again no miracles are possible once these big jaggies are introduced.)

Necessary Evil: Manual Scaling & Alignment on my Mac

So I began using Topaz Gigapixel AI and a lot of manual calculation and nudging and scaling to get the three images (for this one very simple example) into a shared pixel space without artifacts. It can be easily done but requires this very manual, very error-prone, very boring, very mechanical step before the images can even be masked to make a single image. But Gigapixel charges $2,000 for API access (on my own machine, offline!) so I cannot automate this painful step. (... or can I? ...)

The Fun Part: Masking and Manual Painting on iPad Affinity Photo

For me, the fun part is to take the PSD file (or in my case, Affinity Photo layers document) from my Mac (the only place where Gigapixel runs) back to my iPad (where I generated the images using an online image service such as Wombo AI Art) so I can manually mask the layers together, fix problems with actual manual digital painting, and apply final adjustments such as levels, white balance, manual local dodging and burning, etc.

Enter Mochi Diffusion

In 2024, less than a year ago, I got my hands on an Apple Silicon Mac—in this case the oldest 2020 M1 MacBook Air, the cheapest Mac laptop you can buy used, a device with no fan and 20-hour battery life. Apple has shipped Apple Silicon devices with Neural Engine cores on mobile devices such as iPhone and iPad for many years now, and getting this technology on a laptop opened up some really amazing avenues. Apple ported Stable Diffusion to run on CoreML, meaning it can use GPU cores or lower-power Neural Engine cores to run SD at an almost respectable speed on commodity mobile hardware. What I mean is that you don't need a $2,000 Nvidia GPU inside a massive box with huge loud fans and a 1,000 W power supply, you can play with this technology on a device with no fan, running on battery power.

Some amazing enthusiasts have pushed this forward, in terms of native Mac UI, in the form of an open-source project called Mochi Diffusion. Getting the code for this and compiling it allows a tinkerer like the author to add many crazy new features, to begin glimpsing what people have been doing for years on dedicated kilowatt hardware using A1111.

The first feature I added was the ability to favorite images as Mac-native Finder color tags. This got accepted into Mochi Diffusion and is shipping right now.

The Latest Process

My latest process is quite convoluted, but produces the highest quality and quantity of amazing results I can muster. Think controlled chaos, with a certain amount of manual control, leaving room for wonderful surprises.

Batching Prompts & Madlib-style Canned Faces

The first feature required to get piles of useful starting places is the ability to batch run dozens or hundreds of prompts from a text file. (This was simple enough to add to my experimental branch of Mochi Diffusion and is obvious. A1111 has had this for a while now too, obviously.)

In order to get good results for portraiture/figurative images, it helps to have a pile of "canned faces" filtered from an even bigger pile of "blended faces." I won't go into detail but imagine a simple madlib Python script with a long list of pieces of text prompts which when combined generate stable, deterministic results that are unique and repeatable. These result faces vary widely but a good madlib generator might produce perhaps 25% keepers and 75% ugly faces. Generate a giant text file, run this overnight using batching, then comb through the results and favorite the best ones using the feature I added to Mochi Diffusion. Since the color tag is stored in the file system resource fork, you can just copy or move PNG files around in various folders (on Apple OSes). So your folder of copies of best PNGs is actually also a list of the best "canned face" prompts, for the next step. (You also need a command-line prompt puller Shell/Python script that can use the open source Exiv2 library to turn a folder of PNGs back into a text file).

Rows and Columns

The next trick is to use the text file of canned high quality faces prompts as rows in an even more complicated x-y batching mode (yet another feature I added to my experimental development branch). The columns are more complicated, but they involve a folder full of collected-up images with an index text file of prompt templates and strength values for those images (with a wildcard to leave a spot for the row prompt “face” in there). X-Y batching begins by shuffling all rows and runs over N random columns per row, where N is set in the UI as the Number of Images field. Columns can be thought of as poses or compositions or outfits, and the inner prompt "canned face" gets spliced into the larger column's prompt template. This batch can be run for hours or overnight to get hundreds of low-res starter images which can be curated down to dozens of great starting point images, which can be upscaled with my complicated process, below.

Columns & Cross-painting

Creating the images in the columns folder and related prompts is its own art form, and requires a lot of patience and experimentation. But this is also a huge part of how to get top notch results, building on years of collecting up awesome intermediate images, usually improved by cross-painting (manual inpainting of several nearly identical low-res images into a single optimized image) and correcting all of this messy output. Then the process can create endless variations with different faces using these poses and compositions as starting places.

Project Mode

I added an easy-to-use (but complicated-under-the-hood) Project pane to Mochi Diffusion that can help automate my fiddly upscaling process without relying on Gigapixel AI. Instead it uses the wonderful open source RealESRGAN upscaler, which is "good enough" to glue the whole process together, especially since it can all be automated.

Project Mode begins with a single low-res 512x512 PNG generated on my limited machine using just Neural Engine cores, using SD1.5 models. A single keyboard shortcut copies the prompt from the image to the UI, then the remaining parameters can be set by the user (notably Strength, which means Text Strength). The magic values that seem to work for this part of the process range from 0.25 but 0.3 but other values may work, depending on the SD CoreML model file you are using. (0.25 means 75% like the image, so details are added but mostly this is like a generative upscale at every step).


The user selects an image in Mochi Diffusion and enters Project Mode, which opens the starter PNG file (captioned "1.", a full, zoomed out composition) and creates a new unique folder where a pile of 512x512 images will be written to disk. First my code uses Apple's built-in Computer Vision tools for face and pose detection, along with tons of heuristics, (captioned "2.") to create a tree of complicated nested rectangles with explicit coordinates in the starter/original image space, all in a split second. Before doing the automated complicated process (below), the user gets to see how small the smallest rectangle is (face usually), relative to the starter image, with a scale number. For a typical figure this could be anywhere from 6x to 12x, but generally around 8x or 9x. This multiplier will set the scale for the final layered set of images and is very important in making the whole thing work without artifacts.

Project Mode has an Enqueue button so batching can be used yet again (for the third time?) after perhaps dozens of great starter images have been found. Enlarging a low-res image from 0.25 Megapixels into perhaps 20 Megapixels (so 80x for just the upscaled input image, and hundreds of times the number of total pixels, counting all the layers) takes about five minutes per project, so batching allows everything to run in succession in a fully automated fashion, perhaps overnight.

PSD for the Win

What is the output of each Project? Each project folder fills up with 512x512 images, which the Project collects location information about so it can create a giant layered PSD file at the end. Each image is first Crop/scaled from a 512x512 image before running SD Img2Img Generate on it. ("Crop/scale" is just "crop some part but scale back to 512x512" before Img2Img). In this manner, final images will have decent quality for their size, but cannot be combined into a coherent whole without first being intelligently uspcaled into the same pixel space (using RealESRGAN and not bilinear or bicubic or whatever). The final step just combines everything in the following manner: first, scale the widest image to the max scale (say, 8.5x), then next scale subsequent images in the stack of images less and less, until the final tiny face images which are like 1.25x and 1x. These images are added to a PSD document and written out to disk as a giant file, perhaps 100 MB to 500 MB depending on the full resolution. (Affinity Photo documents losslessly compress this to about 3x or 4x smaller, in practice, and PSD files themselves can be compressed more than my PSDWriter library supports.)

An example image

Here is an example of the automated PSD output of the process (captioned "3.") for one original low-res starter image, 512x512. Again this process is dependent on the fact that the "canned face" is known to look good as we zoom in. The prompt already has this information and can control the face. It's like cheating and knowing the future. The whole process is very dependent on this part of the prompt, to get controlled results, instead of requiring luck for those details. It's kind of like rendering a fractal at more and more zoomed in scales, where the formula is deterministic and simple but more detail is revealed with further computation. Similarly, we have mined the SD model for each fully structured 3-D face model "formula" that can be represented with a few hundred bytes of text, and given enough computation, can be revealed at any scale, lighting, pose, etc.


The PSD file for this is available as a ZIP here, 150 MB unzipping to 250 MB, if you want to see what the layers look like, and try turning them on and off, and imagine masking all this mess together into one beautiful image. Another reason this process works is that there is so much redundant information that the human manual masker (see below) has enough valid data to reject some of the often bizarre results that will inevitably creep into the PSD file. Those layers can simply be deleted.

I am not opposed to uspcaling a finished, adjusted image one final time, manually, using Topaz Gigapixel AI, to get the final 8k image (7680x7680), available here, 59 Mpix @ 8 MB. I think these kinds of results are stunning, and I can create several fully realized images in a day once I have the PSD files in hand, which again, is pretty easy, given all this batching and curating that goes into getting a handful of great starting point images.

Major Caveat: Manual Masking Required

This whole process is heavily dependent on manual human masking of the PSD layers at the end, as many as one or two dozen layers. The results of masking for this example are captioned "4." above, before final adjustments. I've tried to automate this using Inpainting ControlNets but the version in MochiDiffusion is unusably slow and produces very poor quality results. But I find this masking a mostly pleasant process, like knitting or whatever, which is very low-key and amendable to music or podcast listening. Take the highly portable iPad anywhere with decent seating, sit down, lean back with the iPad in one hand and Apple Pencil in the other, and mask away. Also, some manual digital painting may be required, and some adjustments at the end can help put things over the finish line (captioned "5." above). Another example of running through this entire proces is show here:

An example image

Another caveat: this requires a SD CoreML model file that matches your style / prompt requirements (oil painting style or pastel painting style is particularly difficult to achieve). This adds another layer of complication with token count limits, in my case 75 positive and 75 negative tokens! In fact this example uses three different SD CoreML model files, which are automatically switched at different crop levels, developed heuristically for my needs.

Recap & Conclusion


I can create very-high-resolution results on very-low-end hardware. This even runs on battery, with no fan. I can overcome signiciant technical and creative barriers using human ingenuity and patience, instead of relying on luck or beefy hardware. It's an interesting challenge to create a bespoke process for one narrow type of image generation.

The code for this is in my Mochi Diffusion more-customizations branch but is very unsupported, and very experimental. An exercise for the reader, if ever there was one. You're on your own. Here Be Dragons.


Humor

True Wisdom

He may live without books,
what is knowledge but grieving?
he may live without hope,
what is hope but deceiving?
he may live without love,
what is passion but pining?
but where is the man that can
live without dining?

Robert Bulwer, Earl of Lytton


Reference

When Anything Can Happen, Nothing Matters

Film theory: an explanation for why so many overproduced movies are emotionally unsatisfying

If you've ever watched a movie where the climax was approaching and the story just started getting too big for its britches, and the filmmakers kept adding ridiculous twists and turns, and upping the ante, and instead of feeling like the movie was getting more interesting, instead it became harder to suspend disbelief and the story started to feel disconnecting, or you began wondering how much longer the movie will take, how much more climactic this already hyped-up scene will get... congratulations, you have experienced what I term,

"When Anything Can Happen, Nothing Matters."

When done right, the action in a story feels personal to individual characters, and when we know the stakes (and the stakes are not just "lots of empty emotionless buildings will get smashed, the whole city is under threat!") then we can feel empathy for specific characters, and we are drawn into the narrative. When the film-makers keep "pulling back" and doing a lot of what Brad Bird called "God shots" with the camera where we are looking down on the action from above, because the spectacle is so vast we have to take the mile-high view, literally, when the focus shifts to spectacle over character, then we are at risk of losing track of why we should care.

A list of movies that suffer somewhat from this problem:

  • Incredibles 2 (literally trying to save the city)
  • Despicable Me 3 (really fun movie with a trumped up, silly, even boring ending)
  • Minions (story gets too big, literally)
  • Penguins of Madagascar (save the city, save everyone)
  • Home (2015 DreamWorks film) - save the planet
  • The Hobbit (fun story, fun story, war campaign, fun story, fun story)
  • The Avengers (2012 film - save the city, punch a building, nuclear threats, endless outsized horrors, and expanding good-guy powers to counter the horrors)

There are many other examples.

An example of a franchise that makes clear rules, in order to avoid this problem, is the Harry Potter books and films. The rules are there to make sure that the writer and reader know that the rules cannot just change at the drop of a hat. Something is at stake. We will not feel emotionally manipulated: "Oh no! Oh no! It's about to get terrible! ... just kidding, the good guys had this, the whole time!" No one wants that.

Note that when this rule is knowingly broken, and when new rules or weird backstories are introduced, but the writers dig in, and explore the ramifications, it can create tension and fun stories, for example the series Adventure Time, and Rick and Morty, which are truly bananas at times, but the stories explore that craziness instead of pouring it on thick and then magically erasing the craziness a few minutes later.

Note also that superhero stories can feel connecting when individual characters are vulnerable, and we can relate to them and imagine ourselves in their shoes. Spider-man and Batman are two examples. Spider-man allows us to wonder what we would do with new powers. And he is always getting banged up and hurt. He struggles even to understand his powers at times. That aspect of a superhero story is relatable and very human. Batman is even better, because he is the ultimate self-made superhero. He created his own superpowers with his intelligence, his gadgets, his study of combat. And he is still very vulnerable. We worry about his fate because he is so human (he is literally not superhuman like Thor or Superman). The opposite is very disconnecting, the struggles of titanic forces against each other: evil gods and good gods fighting at an inhumanely large scale.

Archive