-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a6ddc80
commit 8c78374
Showing
8 changed files
with
279 additions
and
9 deletions.
There are no files selected for viewing
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import importlib | ||
import logging | ||
|
||
from django.core.management.base import BaseCommand | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
class Command(BaseCommand): | ||
help = "shell plus" | ||
|
||
def handle(self, *args, **options): | ||
from IPython import embed | ||
import cProfile | ||
import pdb | ||
import django.apps | ||
|
||
models = {model.__name__: model for model in django.apps.apps.get_models()} | ||
main = importlib.import_module("__main__") | ||
ctx = main.__dict__ | ||
ctx.update( | ||
{ | ||
**models, | ||
"ipdb": pdb, | ||
"cProfile": cProfile, | ||
} | ||
) | ||
embed(user_ns=ctx, banner2="", colors="neutral", using='asyncio') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
# Generated by Django 4.2.3 on 2023-08-02 13:14 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
initial = True | ||
|
||
dependencies = [] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name="SdImage", | ||
fields=[ | ||
("id", models.BigAutoField(primary_key=True, serialize=False)), | ||
("sort_num", models.IntegerField(db_index=True, default=999)), | ||
("created_at", models.DateTimeField(auto_now_add=True, db_index=True)), | ||
("updated_at", models.DateTimeField(auto_now=True)), | ||
], | ||
options={ | ||
"db_table": "sd_image", | ||
}, | ||
), | ||
migrations.CreateModel( | ||
name="SdModelCheckpoint", | ||
fields=[ | ||
("id", models.BigAutoField(primary_key=True, serialize=False)), | ||
("name", models.CharField(max_length=100)), | ||
("slug", models.CharField(max_length=100, unique=True)), | ||
("sort_num", models.IntegerField(db_index=True, default=999)), | ||
("created_at", models.DateTimeField(auto_now_add=True, db_index=True)), | ||
("updated_at", models.DateTimeField(auto_now=True)), | ||
], | ||
options={ | ||
"db_table": "sd_model_checkpoint", | ||
}, | ||
), | ||
migrations.CreateModel( | ||
name="SdModelLora", | ||
fields=[ | ||
("id", models.BigAutoField(primary_key=True, serialize=False)), | ||
("name", models.CharField(max_length=100)), | ||
("slug", models.CharField(max_length=100, unique=True)), | ||
("sort_num", models.IntegerField(db_index=True, default=999)), | ||
("created_at", models.DateTimeField(auto_now_add=True, db_index=True)), | ||
("updated_at", models.DateTimeField(auto_now=True)), | ||
], | ||
options={ | ||
"db_table": "sd_model_lora", | ||
}, | ||
), | ||
migrations.CreateModel( | ||
name="SdModelVae", | ||
fields=[ | ||
("id", models.BigAutoField(primary_key=True, serialize=False)), | ||
("name", models.CharField(max_length=100)), | ||
("slug", models.CharField(max_length=100, unique=True)), | ||
("sort_num", models.IntegerField(db_index=True, default=999)), | ||
("created_at", models.DateTimeField(auto_now_add=True, db_index=True)), | ||
("updated_at", models.DateTimeField(auto_now=True)), | ||
], | ||
options={ | ||
"db_table": "sd_model_vae", | ||
}, | ||
), | ||
migrations.CreateModel( | ||
name="SdPrompt", | ||
fields=[ | ||
("id", models.BigAutoField(primary_key=True, serialize=False)), | ||
("checkpoint", models.CharField(max_length=100)), | ||
("prompt", models.TextField()), | ||
("n_prompt", models.TextField()), | ||
("sampler", models.CharField(max_length=50)), | ||
("cfg_scale", models.IntegerField(default=7)), | ||
("steps", models.IntegerField(default=30)), | ||
("seed", models.BigIntegerField(default=-1)), | ||
("sort_num", models.IntegerField(db_index=True, default=999)), | ||
("created_at", models.DateTimeField(auto_now_add=True, db_index=True)), | ||
("updated_at", models.DateTimeField(auto_now=True)), | ||
], | ||
options={ | ||
"db_table": "sd_prompt", | ||
}, | ||
), | ||
migrations.CreateModel( | ||
name="SdPromptTag", | ||
fields=[ | ||
("id", models.BigAutoField(primary_key=True, serialize=False)), | ||
("name", models.CharField(max_length=100)), | ||
("name_zh", models.CharField(max_length=100)), | ||
("slug", models.CharField(max_length=100, unique=True)), | ||
("sort_num", models.IntegerField(db_index=True, default=999)), | ||
("created_at", models.DateTimeField(auto_now_add=True, db_index=True)), | ||
("updated_at", models.DateTimeField(auto_now=True)), | ||
], | ||
options={ | ||
"db_table": "sd_prompt_tag", | ||
}, | ||
), | ||
migrations.CreateModel( | ||
name="SdSpellTemplate", | ||
fields=[ | ||
("id", models.BigAutoField(primary_key=True, serialize=False)), | ||
("checkpoint", models.CharField(max_length=100)), | ||
("prompt", models.TextField()), | ||
("n_prompt", models.TextField()), | ||
("sampler", models.CharField(max_length=50)), | ||
("cfg_scale", models.IntegerField(default=7)), | ||
("steps", models.IntegerField(default=30)), | ||
("seed", models.BigIntegerField(default=-1)), | ||
("sort_num", models.IntegerField(db_index=True, default=999)), | ||
("created_at", models.DateTimeField(auto_now_add=True, db_index=True)), | ||
("updated_at", models.DateTimeField(auto_now=True)), | ||
], | ||
options={ | ||
"db_table": "sd_spell_template", | ||
}, | ||
), | ||
] |
24 changes: 24 additions & 0 deletions
24
tifa/migrations/0002_sdprompt_slug_sdspelltemplate_slug.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Generated by Django 4.2.3 on 2023-08-02 13:18 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("tifa", "0001_initial"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="sdprompt", | ||
name="slug", | ||
field=models.CharField(default="", max_length=100), | ||
preserve_default=False, | ||
), | ||
migrations.AddField( | ||
model_name="sdspelltemplate", | ||
name="slug", | ||
field=models.CharField(default="", max_length=100), | ||
preserve_default=False, | ||
), | ||
] |
17 changes: 17 additions & 0 deletions
17
tifa/migrations/0003_rename_slug_sdprompt_template_slug.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Generated by Django 4.2.3 on 2023-08-02 13:18 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("tifa", "0002_sdprompt_slug_sdspelltemplate_slug"), | ||
] | ||
|
||
operations = [ | ||
migrations.RenameField( | ||
model_name="sdprompt", | ||
old_name="slug", | ||
new_name="template_slug", | ||
), | ||
] |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters