Ktiseos_Nyx

Ktiseos_Nyx

Of the darkened Sky.
326
Followers
9
Following
383.4K
Runs
356
Downloads
548
Likes
4.5K
Stars

Articles

View All
The Easy Guide to Creating Textual Inversions with Stable Diffusion

The Easy Guide to Creating Textual Inversions with Stable Diffusion

The Easy Guide to Creating Textual Inversions with Stable DiffusionLast Updated Feb 2024 (Originally Published Mid 2023)PrefaceThis guide provides a straightforward method to create your own Textual Inversions (TIs). While it doesn't replace traditional training, which offers numerous advantages, it serves as an efficient way to store prompts for future use. Note that this tool now works with SDXL and outputs safetensors by default, eliminating the need for manual conversion.Introduction to the ToolThis tool is an extension for the AUTOMATIC1111/stable-diffusion-webui, designed for creating and merging Textual Inversion embeddings at runtime from string literals. You can find it on the Stable Diffusion WebUI Embedding Merge GitHub page. The Usage and some of the updated text is heavily borrowed from the original repository, please note it was added for better clarification on how to make your Embedding.PurposeStable Diffusion interprets your prompts using tokens, which are multidimensional numerical vectors that represent words and phrases. This extension allows you to create new words by merging different vectors, potentially combining meanings. However, results may vary, and it's a feature worth experimenting with.How to Install an Extension via Automatic1111 WebUIOpen Automatic1111 WebUI:Launch your Automatic1111 WebUI in your browser.Go to Extensions Tab:Navigate to the "Extensions" tab in the WebUI.Install from URL:Click on "Install from URL."Paste the GitHub URL:Paste the following URL into the provided box: https://github.com/klimaleksus/stable-diffusion-webui-embedding-merge.Install the Extension:Click the "Install" button to install the extension.Reload the UI:After installation, reload your WebUI to apply the changes.How to Create a Textual InversionInstall and Restart:Ensure the extension is installed and restart the UI.Prepare Your Prompt:Use the txt2img or img2img tools to create a prompt. Ensure it is correctly spaced and under 75 tokens for SD 1.5, and up to 77 vector tokens for SDXL.Checking Token Length:In the WebUI, you can check your token length in either the Text to Image or Image to Image tabs. Note that the limit refers to the number of tokens, not words. Tokens are subword units used by the model to process text. For example, "running" might be split into "run" and "ning" as two tokens.Safety of PT Files:Creating your own PT files in A1111 is safe. As of 2024, you do not need to convert your files to safetensors; the output now comes as safetensors by default.Input Your Prompt:Paste your prompt into the larger text box in the tool.Enter a relevant token name for your TI in the second text box.Troubleshooting:If it fails, check your spacing and token count. Remove unnecessary words or phrases to meet the token limit.Training vs. Creating TIs:Training TIs usually yields better results. This method is a quick alternative but may not be as effective.Usage InstructionsThe EM tab in the extension can be used to:Inspect your prompt or specific words.Create TI embeddings from text fragments with or without merging.Check the correctness of your merge expressions.Merging TokensUse the syntax < 'one thing' + 'another thing' > to merge terms "one thing" and "another thing" into a single embedding in your positive or negative prompts at runtime.Examples:< 'your words' * 0.5 > to adjust the influence of "your words".(< 'one' + 'two' >:0.9) to use attention with round brackets.Viewing Text or Embedding VectorsPaste your prompt into the textbox in the EM tab to see how it is parsed by the WebUI. The extension will show detected Textual Inversion embeddings along with literal text tokens. This helps ensure your prompt is interpreted as expected.Test Merge ExpressionsEnter a "merge expression" in the EM tab to see how it will be parsed and combined by the extension. For example, 'greg rutkowski'/4 + 'gustav dore'*0.75.Expression syntax includes:'one' + 'two' for addition.'text' * NUM for multiplication.'text' : NUM to change vector count.Use curly brackets {} if other extensions interfere with the angular bracket syntax.Using Merge Expressions in PromptsYou can place merge expressions in angular or curly brackets in your txt2img or img2img prompts. The extension will create temporary TI embeddings that replace the expressions, allowing for complex prompt structures.Several Merge ExpressionsCombine different subjects or styles using merge expressions:A realistic photo of the < 'girl' + 'doll' > in a rainbow dress standing on a shore.Art by < 'greg rutkowski' * X + 'hayao miyazaki' * Y > style.Changing Word WeightsAdjust the influence of words in your prompt:A < 'peacock' * X > is standing on top of < 'giraffe' * Y >.worst quality, ugly, < 'bad anatomy,':0 > blurry, cropped.High multipliers can increase the presence of a concept, while lower values can diminish it.Practical ExamplesTo merge strings of unequal length, pad the shortest one with zero vectors:'close-up', 00, 00 + 'out-of-frame' + 'cropped', 00, 00, 00, 00'up', 00, 00 + 'of-frame' + 'cropped', 00, 00, 00Use CasesPrepare a prompt for actual training by using existing embeddings for initialization.Test and refine merge expressions before creating a regular TI embedding.Earth & Dusk Community and SupportJoin our supportive community and access additional resources:DeviantArt GroupKo-Fi Support (Send Dusk Sanity Money)DiscordRedditTwitchCelebrations and AwarenessSupport Plural Pride Month and Disability Pride Month in July. Learn more about the plural community at The Plural Association.Enjoy the JourneyExplore and experiment with the features of this extension to enhance your creative prompts. Never be ashamed of your quirks; embrace them and join our community for support and inspiration.
My Setup for Testing Checkpoints & Loras (A Guide)

My Setup for Testing Checkpoints & Loras (A Guide)

My Setup for Testing Checkpoints & Loras (A Guide)This is an EXTREMELY in depth article and guide towards the tools, tips and tricks i've learned across the years. Some text IS SHARED from Guy90's article, due to the local generation option being easier to copy from his article rather than fudge it from my lack of knowledge. His article is here: https://civitai.com/articles/759. My settings and setup for renting GPU's and rolling my stuff is a little different than his. Read on if you're interested in finding out.Before that join up the Ktiseos Nyx discord for more updates on our loras and content as well as AI/ML Discussions. https://discord.gg/HhBSvM9gBYKoFi if you want more in depth AI & Art Commissions: https://ko-fi.com/duskfallcrew/Merch Shop: https://duskfallcrew-shop.fourthwall.com/Stable Diffusionscratches head .... This one can't be as short as Guy90's considering there's no way I can lie to you and say I only use one tool.Local Generation Users (Automatic1111)To start if you haven't already, please have Automatic1111. If you need help downloading check out this guide from Wrench1815--> https://civitai.com/articles/1722/the-no-way-to-fuck-it-up-this-time-guide-to-installing-auto1111-or-forge-or-the-proompt-ninjaThat's it, pretty much. IF you're running AMD, please note that might be covered in Wrench's guide or Guy90's original article i'm unsure. AMD cards do run Auto, Comfy and otherwise. Forge installs much like Auto, so please feel free to read up on that via above.Local Generation Users (ComfyUI)Hooboy, I don't use this a lot IF AT ALL ... so right now I don't have a local installation guide nor the replacement for if you have an AMD card. If i can find you one - I'll GLADLY link it here.Renting a GPU and getting access to Comfy, Forge or AutoIf you're not running a decent tower with the latest gear, or like me are running a potato Imac:You can use my affiliate link to VastAI here: https://cloud.vast.ai/?ref_id=70354This allows me to earn back a small amount to use so I don't have to put as much INTO my account.You'll note that you will have access to: https://cloud.vast.ai/templates/ - Which gives you a guide to what templates are available.If you want direct access to the version i've got for a template it's here: https://cloud.vast.ai/?ref_id=70354&creator_id=70354&name=Auto%201111%20Webui%2013.0.0%20(Runpod)Extensions & Suggested Add ons for Automatic & Forge:Currently I run a list of the things I use, and it's easier if I just sort of dump the links, and explain roughly what each one of them does.adetailer (This is the Detailer tool most of us use, it takes Yolo V8 models and will detail/redraw small amounts of a picture and clarify it) https://github.com/Bing-su/adetailer.gitsd-webui-supermerger (This merges loras, checkpoints etc) https://github.com/hako-mikan/sd-webui-supermerger.gitstable-diffusion-webui-model-toolkit (Auto pruning, and other goodies) https://github.com/arenasys/stable-diffusion-webui-model-toolkit.gitbatchlinks-webui (Batchlink things like Huggingface and other downloadables) https://github.com/etherealxx/batchlinks-webuiSD Web UI Lobe Theme: (Make your AI setup pretty) https://github.com/canisminor1990/sd-webui-lobe-themeEmbedding Merge (Textual Inversion Merging): https://github.com/klimaleksus/stable-diffusion-webui-embedding-mergeCivitai Browser + (Browser for Civitai) https://github.com/BlafKing/sd-civitai-browser-plus Danbooru Prompt: https://github.com/EnsignMK/danbooru-prompt.gitUntitled Merger: (An advanced WIP merger by Silveroxides) https://github.com/silveroxides/sd-webui-untitledmerger.gitVAESD 1.5: You'll note SOMETIMES we use the Earth & Dusk Vae, and that it's not clear that its' as effective as other VAE. This is because it's a sidestep or merge vae that's like 3% other vaes and 97% Waifu VAE/KF L VAE. There's so many to list, and a lot of the time it depends on your preferences on this to this day I'm not going to argue what works best because I do not even recall.SDXL, Pony, Illustrious, Animagine & Noob: I prefer as of recent to use the Luna XL Vae, as this works with IllustriousXL, I really love the vibrance it brings. Most Illustrious models and PonyXL models come with VAE's baked in. Mine have recently started being baked with LunaXL, and this is because of a color preference. Some Vaes are more pastel, grey or otherwise. PonyXL just takes the standard SDXL vae and should work even with most XL vaes.Flux/SD3 etc: Don't have a clue if they use a built in one, or need one or what. Ask me later... muuuch later.UpscalerThis is something that i'm not sure how much different my choices effect the output, because i'm weird and I use different ones. So i'd rather give you Guy 90's details which are more in par with our peer's usual dealings. I experiment alot, so it's best you get a handle of the basics before being like me.Here is a website for more options: https://openmodeldb.info/EmbeddingsAh, the thing that starts arguments on the kitchen table.SD 1.5 embeddings DO NOT GO ON SDXL, ILLUSTRIOUS AND PONYXL.First of all it's because the text encoders YES are dual on SDXL base models, but it's also that the two text encoders are TRAINED entirely different than SD 1.5. So even if you had dual embeddings to fit both encoders, your old SD 1.5 ones will not work properly.Yes, because they're the same base architecture, they DO work "IN A WAY" - but most of the time they just crunch your image out and make it look weird.Read more about this here: https://civitai.com/articles/10566/the-hidden-truth-about-textual-inversions-in-sdxlIf anything, I have my personal ones I use for all of them, but I'm not going to sit here and advertise ones that are my own, you can search for whatever.One thing you need to note is: Embeddings work differently than loras, and don't usually change the style MUCH. Trained embeddings seem to do this a little more than Embedding merge type embeddings on SD 1.5. However, iv'e not seen much of a difference on XL based model sets.If you'd like to see Embedding Merge in action and see how you can make your own watch my recent VOD here:https://youtu.be/U6t_I5WUBjoMerging & Lora FusionThis is one that isn't always covered much, but as you note there's two plugins/extensions listed above. Untitled Merger doesn't have a lora function as of yet, but has some more advanced MBW settings that Supermerger does not. If you watch the above VOD that i've linked in the Embeddings section, you'll see Supermerger in action, and how to use it.I recommend that when you're using LORAS to bake/fuse into your model that you vary the weights enough to not override the text encoders, or rather not terribly FORCE the change too much of the model.. This is because you can sometimes overcook a model by forcing too many high strength loras in.This is because sometimes your best option sadly is and I will admit this myself: IF you're going for a strong style, you may want to consider learning to train the model instead of lora fusion. Lora fusion is great for the most part, but it's not efficient, and sometimes can burn and cook a model in the wrong way.I've had luck most of the time, but sometimes my models suffer in the name of influencing the style.Adetailer & OthersI haven't always been using Adetailer as much as I could, because on XL based models it takes longer and i'm impatient. However it still plays an absolute VITAL role. Sadly some of the best of these have been "BANNED" off the site since Anzch has been removed from the site after the creator program beta was removed from the site.Their YoloV8 models can be seen on Huggingface here: https://huggingface.co/Anzhc/Anzhcs_YOLOsYou can use batchlinks to access them.Online Generators (Not Local or Rented)Small bits of options here and there besides just Civitai's generator!Diffusers is evidently still running on Google Colab, as some ComfyUI users are dodging the AUP for this. Hell, some people are trying to do the inevitable and still run 30 accounts running Automatic1111. (The original reason why Auto1111 got banned on Colab in the first place.)I don't link to Colabs for generation, because I don't want to get you in the risk of your account getting terminated. Lora training and other things seem to still be OK, and i'm not saying ALL free generations are "BANNED" - just I prefer not to mess with Google with the fact i'm all tied up with an android phone, storage etc...You CAN run free things via Amazon Sagemaker still, but that's a risk on you and I have never tested it. I've heard it's slow, and you get VERY LITTLE space to work with.SeaArt (Yes, yes I get it , they "STEAL" but they're just ... automating a bot to sync your content, lmao stop abusing their staff XD)TensorArt: I'm back, and yea i had some issues - Generator is mostly decent!Moescape/Yodayo: https://moescape.ai/@duskfallcrewShakkerAi: Personally don't bother, not because their site isn't nice or their staff aren't nice, but the site is slow and the users will steal and claim your content as their own and not even credit you.There are MANY other paid and free generation sites, and if you want me to test and rate yours after two years of being in this game: All I ask for is either a place to upload my content to your site OR if you're somewhere like DiffusionHub or otherwise that has rentables with space: I usually grab 120-150gb of space at a time, and if y'all got reasonable up/down speed and let me have a few hours of your time i'll be a happy camper!ConclusionEveryone is entitled to their own opinion and I AM ABUSING my own privileges. No, I'm just joking. Basically everything is variables, and everyone's got different things. I will be absolutely be updating this article, and editing it, maybe even cleaning up the lingo. I started writing this in the middle of playing Final Fantasy XIV.

Posts