Skip to content

Commit

Permalink
Merge pull request #4 from Lendruk/add-stable-diffusion-ui
Browse files Browse the repository at this point in the history
Add stable diffusion UI
  • Loading branch information
Lendruk committed Jul 7, 2024
2 parents 735079c + b2e4eed commit ef1b219
Show file tree
Hide file tree
Showing 205 changed files with 11,914 additions and 7,561 deletions.
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

0 comments on commit ef1b219

Please sign in to comment.