Stylized glyphs using generative AI
A method includes receiving an input including a target style and a glyph. The method further includes masking the glyph. The method further includes generating a stylized glyph by a glyph generative model using the masked glyph. The method further includes rendering the stylized glyph as a unicode stylized glyph.
1 . A method comprising:
receiving a string of natural language text describing a target style and a glyph;
masking the received glyph;
inputting the string of natural language text describing the target style and the glyph into a glyph generative model;
generating, by the glyph generative model, a stylized glyph using the string of natural language text describing the target style and the glyph via diffusion;
and
rendering the stylized glyph as a unicode stylized glyph.
2 . The method of claim 1 , further comprising:
obtaining an image based on the target style; and
applying the image to the received glyph.
3 . The method of claim 2 , wherein obtaining the image based on the target style includes at least one of:
generating the image based on the target style using an image generation machine learning model, or
retrieving the image based on the target style using an image catalog.
4 . The method of claim 1 , further comprising:
performing processing on the masked glyph, wherein the processing includes at least one of:
blurring the masked glyph, or
injecting noise into the masked glyph.
5 . The method of claim 1 , further comprising:
applying a contrastive background to the masked glyph using an inverse of a parameter of the input and an inverse of the masked glyph.
6 . The method of claim 1 , further comprising:
removing a background of the stylized glyph to obtain a subject of the stylized glyph; and
displaying the subject of the stylized glyph.
7 . The method of claim 1 , further comprising:
caching the stylized glyph; and
responsive to receiving another input including the received glyph, displaying the cached stylized glyph.
8 . The method of claim 1 , further comprising:
storing a seed of the glyph generative model, wherein the seed is an initialization state of the glyph generative model.
9 . The method of claim 1 , further comprising:
evaluating an attribute of the stylized glyph, wherein the attribute is at least one of a readability attribute, a quality attribute, or a prompt similarity attribute.
10 . The method of claim 9 , further comprising:
determining to revise the stylized glyph responsive to the attribute of the stylized glyph not satisfying a threshold; and
generating an adjusted stylized glyph using the stylized glyph, wherein the adjusted stylized glyph is generated by comparing a pixel of the stylized glyph to a glyph in an alphabet and adding or removing the pixel based on the comparison.
11 . The method of claim 1 , wherein diffusion further comprises:
obtaining initialized noise; and
iteratively denoising the initialized noise based on the natural language text describing the target style and the glyph.
12 . A system comprising:
a memory component; and
a processing device coupled to the memory component, the processing device to perform operations comprising:
receiving a string of natural language text describing a target style and a glyph;
masking the received glyph;
inputting the string of natural language text describing the target style and the glyph into a glyph generative model;
generating, by the glyph generative model, a stylized glyph using the string of natural language text describing the target style and the glyph via diffusion;
and
rendering the stylized glyph as a unicode stylized glyph.
13 . The system of claim 11 , further comprising:
generating an image based on the target style using an image generation machine learning model, or
retrieving the image based on the target style using an image catalog; and
applying the image to the received glyph.
14 . The system of claim 12 , wherein the processing device further performs operations comprising:
performing processing on the masked glyph, wherein the processing includes at least one of:
blurring the masked glyph, or
injecting noise into the masked glyph.
15 . A non-transitory computer-readable medium storing executable instructions, which when executed by a processing device, cause the processing device to perform operations comprising:
generating, by a glyph generative model, a stylized glyph using a received string of natural language text describing a target style and a target glyph via diffusion;
determining whether the stylized glyph is validated using an attribute of the stylized glyph and a validation algorithm evaluating a quality of the stylized glyph; and
rendering the stylized glyph responsive to determining that the stylized glyph is validated.
16 . The non-transitory computer-readable medium of claim 15 , wherein the attribute is a readability attribute and wherein the quality of the stylized glyph is based on an optical character recognition algorithm recognizing the stylized glyph, the optical character recognition algorithm being the validation algorithm.
17 . The non-transitory computer-readable medium of claim 15 , wherein the attribute is a quality attribute and wherein the quality of the stylized glyph is based on an object recognition algorithm recognizing the stylized glyph, the object recognition algorithm being the validation algorithm.
18 . The non-transitory computer-readable medium of claim 15 , wherein the attribute is a prompt similarity attribute and wherein the quality of the stylized glyph is based on a similarity of a generated description determined by a descriptive model and the target style, the descriptive model being the validation algorithm.
19 . The non-transitory computer-readable medium of claim 15 , storing executable instructions that further cause the processing device to perform operations comprising:
determining that the stylized glyph is not validated using the attribute of the stylized glyph; and
revising the stylized glyph such that the stylized glyph is validated using the attribute.
20 . The non-transitory computer-readable medium of claim 15 , wherein revising the stylized glyph includes comparing a pixel of the stylized glyph to a glyph in an alphabet and adding or removing the pixel based on the comparison.