Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add stable diffusion UI #4

Merged
merged 58 commits into from
Jul 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
26d4616
Add sidebar entry
Lendruk May 22, 2024
549fa96
WIP img gen ui
Lendruk May 24, 2024
ebe0678
Merge branch 'master' of https://github.com/Lendruk/NoriBooru into ad…
Lendruk May 29, 2024
eaedb91
Merge branch 'master' of https://github.com/Lendruk/NoriBooru into ad…
Lendruk Jun 4, 2024
e0ee122
Restructure pages and add sidebar entries
Lendruk Jun 4, 2024
2177b72
Merge branch 'master' of https://github.com/Lendruk/NoriBooru into ad…
Lendruk Jun 10, 2024
6d1a0f3
Add SDUi installation
Lendruk Jun 11, 2024
fe23af3
Add vault store
Lendruk Jun 12, 2024
8ca918e
Add lifecycle management for SDUi process
Lendruk Jun 13, 2024
f6456c9
Add local stable diffusion prompting
Lendruk Jun 13, 2024
b51ae97
Save SD generated images to inbox
Lendruk Jun 13, 2024
8822c78
Expand general settings
Lendruk Jun 17, 2024
1091813
Add possible deletion of generated image
Lendruk Jun 17, 2024
e9eebfd
Add checkpoint switching
Lendruk Jun 17, 2024
7448978
Add fullscreen preview for generated image
Lendruk Jun 17, 2024
fb4b47b
Add image size presets
Lendruk Jun 18, 2024
dcbd30d
Add high res fix support
Lendruk Jun 20, 2024
fb9401c
Add interrupt sd generation support
Lendruk Jun 20, 2024
379f0d4
Add Cfg Scale input
Lendruk Jun 21, 2024
cbc98f1
Add prompt saving and loading
Lendruk Jun 21, 2024
8670476
Add save as new option for prompts
Lendruk Jun 21, 2024
d76ba9f
Fix mapping of prompt fetch
Lendruk Jun 21, 2024
4f9159c
Wip prompt search styling and structure
Lendruk Jun 22, 2024
00e0e0b
Improve prompt search styles & add more information
Lendruk Jun 24, 2024
402e258
Fix styling in save prompt modal & reset current prompt when deleted
Lendruk Jun 24, 2024
d01f23f
Fix offset in sidebar icons
Lendruk Jun 24, 2024
09be4b7
Add basic lora selection
Lendruk Jun 24, 2024
a99d71f
Move checkpoint select to general settings
Lendruk Jun 25, 2024
6278f81
Add image archive toggling with toast in generator
Lendruk Jun 25, 2024
d6213bb
Update drizzle
Lendruk Jun 25, 2024
1cfe445
Add button to gallery to send image gen info to generator
Lendruk Jun 25, 2024
cf333a8
Fix styling
Lendruk Jun 26, 2024
d10eb63
Add automatic port injection for starting SD UI
Lendruk Jun 26, 2024
8d9242c
Add findOpenPort implementation
Lendruk Jun 27, 2024
8abf5e2
Make Stable diffusion ui installation optional
Lendruk Jun 28, 2024
8ecec70
Add refiner checkpoint input
Lendruk Jun 28, 2024
422c10e
Wip lora metadata structures
Lendruk Jun 29, 2024
6201491
Create TagService
Lendruk Jun 30, 2024
c9854cc
Update Lora CRUDs
Lendruk Jun 30, 2024
b664aab
Add delete lora endpoint
Lendruk Jun 30, 2024
265cc00
WIP add lora metadata
Lendruk Jul 3, 2024
7174839
Fix lora image not updating locally when saving
Lendruk Jul 3, 2024
5e7f82d
Add prettier and format all files
Lendruk Jul 4, 2024
d130a80
Format all frontend files
Lendruk Jul 4, 2024
1b17596
Add lora tag based filtering
Lendruk Jul 4, 2024
267eb86
Make generation tabs horizontal
Lendruk Jul 4, 2024
2932cc6
Add wildcard CRUD
Lendruk Jul 4, 2024
2b5ee98
Fix margin on container
Lendruk Jul 4, 2024
f2f9c14
Fix showing refiner settings when there is only 1 checkpoint
Lendruk Jul 4, 2024
08026b8
Add refresh functionality for checkpoints and loras
Lendruk Jul 4, 2024
8ee78fa
Add generation batching
Lendruk Jul 5, 2024
13ee1ec
Add progress bar to generation
Lendruk Jul 5, 2024
a43f9b8
Minor style adjustments
Lendruk Jul 5, 2024
61e9dae
Add UI Structure to support the inclusion of Block prompting
Lendruk Jul 5, 2024
60bb627
Add wildcard parsing to prompt
Lendruk Jul 5, 2024
12b75fb
Add loading overlay to stable diffusion generator
Lendruk Jul 7, 2024
062fb6c
Tweak styling for generator components
Lendruk Jul 7, 2024
b2e4eed
Comment not yet implemented entry in sidebar
Lendruk Jul 7, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 18 additions & 35 deletions backend/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,37 +1,20 @@
{
"env": {
"es2021": true,
"node": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": [
"@typescript-eslint"
],
"rules": {
"indent": [
"error",
"tab"
],
"linebreak-style": [
"error",
"unix"
],
"quotes": [
"error",
"single"
],
"semi": [
"error",
"always"
],
"@typescript-eslint/no-explicit-any": "error"
}
"env": {
"es2021": true,
"node": true
},
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": ["@typescript-eslint"],
"rules": {
"indent": ["error", "tab"],
"linebreak-style": ["error", "unix"],
"quotes": ["error", "single"],
"semi": ["error", "always"],
"@typescript-eslint/no-explicit-any": "error"
}
}
6 changes: 6 additions & 0 deletions backend/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"useTabs": true,
"singleQuote": true,
"trailingComma": "none",
"printWidth": 100
}
8 changes: 4 additions & 4 deletions backend/master.drizzle.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import type { Config } from 'drizzle-kit';
export default {
schema: 'src/db/master/schema.ts',
out: 'migrations/master',
driver: 'better-sqlite',
dialect: 'sqlite',
dbCredentials: {
url: './master_db.sqlite',
url: './database.sqlite'
},
verbose: true,
} satisfies Config;
verbose: true
} satisfies Config;
7 changes: 7 additions & 0 deletions backend/migrations/master/0000_ancient_vermin.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
CREATE TABLE `vaults` (
`id` text PRIMARY KEY NOT NULL,
`name` text,
`path` text NOT NULL,
`createdAt` integer DEFAULT 1718055782029 NOT NULL,
`has_installed_sd` integer DEFAULT 0 NOT NULL
);
6 changes: 0 additions & 6 deletions backend/migrations/master/0000_deep_chronomancer.sql

This file was deleted.

110 changes: 59 additions & 51 deletions backend/migrations/master/meta/0000_snapshot.json
Original file line number Diff line number Diff line change
@@ -1,52 +1,60 @@
{
"version": "5",
"dialect": "sqlite",
"id": "723791c1-67ff-4c1f-8fda-36d9293f0086",
"prevId": "00000000-0000-0000-0000-000000000000",
"tables": {
"vaults": {
"name": "vaults",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"path": {
"name": "path",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"createdAt": {
"name": "createdAt",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": 1716239615803
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {}
}
},
"enums": {},
"_meta": {
"schemas": {},
"tables": {},
"columns": {}
}
}
"version": "5",
"dialect": "sqlite",
"id": "3389e9af-0dac-4d76-b173-b1b3ea9d68a1",
"prevId": "00000000-0000-0000-0000-000000000000",
"tables": {
"vaults": {
"name": "vaults",
"columns": {
"id": {
"name": "id",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"path": {
"name": "path",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"createdAt": {
"name": "createdAt",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": 1718055782029
},
"has_installed_sd": {
"name": "has_installed_sd",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": 0
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {}
}
},
"enums": {},
"_meta": {
"schemas": {},
"tables": {},
"columns": {}
}
}
24 changes: 12 additions & 12 deletions backend/migrations/master/meta/_journal.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"version": "5",
"dialect": "sqlite",
"entries": [
{
"idx": 0,
"version": "5",
"when": 1716239615805,
"tag": "0000_deep_chronomancer",
"breakpoints": true
}
]
}
"version": "5",
"dialect": "sqlite",
"entries": [
{
"idx": 0,
"version": "5",
"when": 1718055782032,
"tag": "0000_ancient_vermin",
"breakpoints": true
}
]
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
CREATE TABLE `loras_to_mediaItems` (
`media_item_id` integer NOT NULL,
`lora_id` text NOT NULL,
PRIMARY KEY(`lora_id`, `media_item_id`),
FOREIGN KEY (`media_item_id`) REFERENCES `media_items`(`id`) ON UPDATE no action ON DELETE cascade,
FOREIGN KEY (`lora_id`) REFERENCES `sd_loras`(`id`) ON UPDATE no action ON DELETE cascade
);
--> statement-breakpoint
CREATE TABLE `media_items` (
`id` integer PRIMARY KEY NOT NULL,
`file_name` text NOT NULL,
Expand Down Expand Up @@ -28,6 +36,40 @@ CREATE TABLE `playlists_media_items` (
FOREIGN KEY (`media_item_id`) REFERENCES `media_items`(`id`) ON UPDATE no action ON DELETE cascade
);
--> statement-breakpoint
CREATE TABLE `sd_loras` (
`id` text PRIMARY KEY NOT NULL,
`name` text NOT NULL,
`path` text NOT NULL,
`preview_image` text,
`activation_words` text NOT NULL
);
--> statement-breakpoint
CREATE TABLE `sd_prompts` (
`id` text PRIMARY KEY NOT NULL,
`name` text,
`preview_image` text,
`positive_prompt` text NOT NULL,
`negative_prompt` text NOT NULL,
`sampler` text NOT NULL,
`steps` integer NOT NULL,
`width` integer NOT NULL,
`height` integer NOT NULL,
`checkpoint` text NOT NULL,
`cfg_scale` integer NOT NULL,
`is_high_res_enabled` integer NOT NULL,
`high_res_upscaler` text,
`high_res_steps` integer,
`high_res_denoising_strength` integer,
`high_res_upscale_by` integer,
`created_at` integer NOT NULL
);
--> statement-breakpoint
CREATE TABLE `sd_wildcards` (
`id` text PRIMARY KEY NOT NULL,
`list_name` text NOT NULL,
`text` text NOT NULL
);
--> statement-breakpoint
CREATE TABLE `tags` (
`id` integer PRIMARY KEY NOT NULL,
`name` text NOT NULL,
Expand All @@ -36,6 +78,14 @@ CREATE TABLE `tags` (
`parent_id` integer
);
--> statement-breakpoint
CREATE TABLE `tags_to_loras` (
`tag_id` integer NOT NULL,
`lora_id` text NOT NULL,
PRIMARY KEY(`lora_id`, `tag_id`),
FOREIGN KEY (`tag_id`) REFERENCES `tags`(`id`) ON UPDATE no action ON DELETE cascade,
FOREIGN KEY (`lora_id`) REFERENCES `sd_loras`(`id`) ON UPDATE no action ON DELETE cascade
);
--> statement-breakpoint
CREATE TABLE `tags_to_media_items` (
`tag_id` integer NOT NULL,
`media_item_id` integer NOT NULL,
Expand Down
Loading