{"id":13788136,"url":"https://github.com/trevbook/sd-prompt-graph","last_synced_at":"2025-04-12T14:24:28.837Z","repository":{"id":73396970,"uuid":"544679949","full_name":"trevbook/sd-prompt-graph","owner":"trevbook","description":"A curve-editor for Stable Diffusion prompt interpolation","archived":false,"fork":false,"pushed_at":"2022-10-03T18:48:17.000Z","size":45122,"stargazers_count":21,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-12T14:24:09.477Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/trevbook.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2022-10-03T03:06:51.000Z","updated_at":"2023-06-16T08:14:48.000Z","dependencies_parsed_at":"2024-01-07T03:52:12.334Z","dependency_job_id":"285c4b7b-28a2-4a8f-ad5c-d7588f3802a5","html_url":"https://github.com/trevbook/sd-prompt-graph","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trevbook%2Fsd-prompt-graph","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trevbook%2Fsd-prompt-graph/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trevbook%2Fsd-prompt-graph/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trevbook%2Fsd-prompt-graph/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/trevbook","download_url":"https://codeload.github.com/trevbook/sd-prompt-graph/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248579060,"owners_count":21127754,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T21:00:37.328Z","updated_at":"2025-04-12T14:24:28.820Z","avatar_url":"https://github.com/trevbook.png","language":"Jupyter Notebook","funding_links":[],"categories":["Complementary Models and Tools"],"sub_categories":["Potentially Stale/Less active branches"],"readme":"# **Stable Diffusion Prompt Graph**\nThis is a React-based curve editor GUI for prompt interpolation animations made with Stable Diffusion! \n\nSince that sentence is a bit of a mouthful, how about I just show you how it works? \n\n![Alt text](stable-diffusion/assets/prompt-graph-demo.png?raw=true \"Screenshot of the SD Prompt Graph user interface\")\n*Users populate a \"prompt graph\", where the X-axis represents the progression of an animation, and the Y-axis\n represents the relative \"strength\" of a prompt. Each curve in the graph corresponds with one of the user's prompts.*\n\nAfter crafting a Prompt Graph, a series of Stable Diffusion generations can be launched. The resulting images will \ncorrespond with the interpolation you defined in your graph: \n\n![Alt text](stable-diffusion/assets/demo-generation-progression.png?raw=true \"Results of the previously-shown Prompt Graph generation\")\n\nThis repo is a clone of v0.9 of [basujindal's stable-diffusion fork](https://github.com/basujindal/stable-diffusion)!\nI picked this fork as a basis for my Prompt Graph app, since it contains a ton of optimizations that allow Stable Diffusion \nto be run on my local GPU (NVIDIA 2070 Super). In the future, I could easily swap out the \"engine\" Prompt Graph \nis using - by the time of publishing this, there'll probably be more insane optimizations to make things even faster. 😉\n\n---\n\n### **Installation**\n\nIn order to install this app, you'll need to install a couple of pre-requesites: \n\n- [**node.js**](https://nodejs.org/en/) - Since this is a React app, you'll need to download `node.js` in order to have access to `npm`.\n\n\n- [**conda**](https://docs.conda.io/en/latest/) - Conda is a package management system that you'll use to install the right Python packages.\n\n- [**ffmpeg**](https://ffmpeg.org/) - FFMPEG is a command-line tool that enables a lot of video-related functionality. It's what I use to create the .mp4 files of the animations\n\n\nOnce you've downloaded both of these, you should move into setting up [**Stable Diffusion**](https://github.com/CompVis/stable-diffusion#requirements). The first thing you ought to do is actually download the weights for the model. I've used [Stable Diffusion v1.4](https://huggingface.co/CompVis/stable-diffusion-v-1-4-original) successfully, but there might be newer models by the time you're reading this. \n\nAfter the model is downloaded, you ought to rename the `.ckpt` file to `model.ckpt`, and then place it into the `stable-diffusion/models/ldm/stable-diffusion-v1` folder. \n\nOnce you've placed the model into the correct folder, you ought to set up the Stable Diffusion conda environment. To set up this environment, run these commands from the root of the repo: \n\n```shell\ncd stable-diffusion/\nconda env create -f environment.yaml\nconda activate ldm\npip install -r ./requirements.txt --exists-action=w\n```\n\nOnce this is finished, you'll need to install all of the dependencies for the React app. To do that, run these commands from the repo root: \n\n```shell\ncd prompt-graph/\nnpm install \n```\n\nAfter this point, you should be all set up! Check out the **`Usage`** section below to learn more about how to actually run the app.\n\n---\n### **Usage**\n\nIn order to run the React app, you can run the following commands from the root of the repo: \n\n```\ncd prompt-graph/\nnpm start\n```\n\nThis will start a server running the React app at [http://localhost:3000](http://localhost:3000/). \n\nFrom there, you can specify the Prompt Graph that you want to create. (More detailed documentation / a video tutorial on how to use the app is to come!)\n\nOnce you're finished defining your prompt graph, click on the **Generate Configuration File** button. This will download a `.json` file containing all of the prompts you'd specified. \n\nFinally, you should be able to run \n\n```\npython run_generation_from_config.py\n``` \n\nfrom the root of the repo. This will ask you for the path of the configuration file you want to generate; once you paste in \nthe path and hit Enter, then the generation will begin! \n\nIf you're having any trouble using the app, please reach out to me - either through [a DM on Twitter](https://twitter.com/trevbook), \nor by starting an issue on this repo! \n\n---\n\n### **Future Development**\nI'm actively working on this repo, so I'd expect that things ought to change pretty radically in the future. \nAs follows is a list of some of the things I'm actively working on: \n\n- Simplifying installation process\n- CLIP-guided recursive latent interpolation (to smooth transitions between images) \n- Allowing users to load and edit already-created Prompt Graph configuration files\n- Adding additional polish to the user interface \u0026 fixing bugs\n- Allowing initial images to be used within the Prompt Graph\n- Development of a [Dash version](https://dash.plotly.com/) of the React application (which'll allow for in-browser use via Google Colab)\n- Better curve-editing capabilities / controls (i.e., non-linear curves)\n\n---","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrevbook%2Fsd-prompt-graph","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrevbook%2Fsd-prompt-graph","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrevbook%2Fsd-prompt-graph/lists"}