diff --git a/3rd-PARTY-LICENSES b/3rd-PARTY-LICENSES index bd29393a..78bfe3bb 100644 --- a/3rd-PARTY-LICENSES +++ b/3rd-PARTY-LICENSES @@ -712,3 +712,31 @@ FileSaver.js is licensed under the MIT license: SOFTWARE. [1]: http://eligrey.com + +croppr.js +========= +https://github.com/jamesssooi/Croppr.js + +croppr.js is licensed under the MIT license: + + MIT License + + Copyright (c) 2017 James Ooi + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. diff --git a/ui/easydiffusion/bucket_manager.py b/ui/easydiffusion/bucket_manager.py index 023ec192..6e0e217d 100644 --- a/ui/easydiffusion/bucket_manager.py +++ b/ui/easydiffusion/bucket_manager.py @@ -71,9 +71,8 @@ def init(): bucket = crud.get_bucket_by_path(db, path) if bucket == None: - bucket_id = crud.create_bucket(db=db, bucket=schemas.BucketCreate(path=path)) - else: - bucket_id = bucket.id + bucket = crud.create_bucket(db=db, bucket=schemas.BucketCreate(path=path)) + bucket_id = bucket.id bucketfile = schemas.BucketFileCreate(filename=filename, data=file) result = crud.create_bucketfile(db=db, bucketfile=bucketfile, bucket_id=bucket_id) diff --git a/ui/easydiffusion/easydb/crud.py b/ui/easydiffusion/easydb/crud.py index 7550a52a..65bea255 100644 --- a/ui/easydiffusion/easydb/crud.py +++ b/ui/easydiffusion/easydb/crud.py @@ -19,7 +19,6 @@ def create_bucketfile(db: Session, bucketfile: schemas.BucketFileCreate, bucket_ db_bucketfile = models.BucketFile(**bucketfile.dict(), bucket_id=bucket_id) db.merge(db_bucketfile) db.commit() - from pprint import pprint db_bucketfile = db.query(models.BucketFile).filter(models.BucketFile.bucket_id==bucket_id, models.BucketFile.filename==bucketfile.filename).first() return db_bucketfile diff --git a/ui/easydiffusion/easydb/database.py b/ui/easydiffusion/easydb/database.py index e3c92845..6cb43ecb 100644 --- a/ui/easydiffusion/easydb/database.py +++ b/ui/easydiffusion/easydb/database.py @@ -7,7 +7,6 @@ from sqlalchemy.orm import sessionmaker os.makedirs(app.BUCKET_DIR, exist_ok=True) SQLALCHEMY_DATABASE_URL = "sqlite:///"+os.path.join(app.BUCKET_DIR, "bucket.db") -print("## SQLALCHEMY_DATABASE_URL = ", SQLALCHEMY_DATABASE_URL) engine = create_engine(SQLALCHEMY_DATABASE_URL, connect_args={"check_same_thread": False}) SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine) diff --git a/ui/index.html b/ui/index.html index 0531933c..65be9480 100644 --- a/ui/index.html +++ b/ui/index.html @@ -18,12 +18,14 @@ + +
@@ -686,6 +688,15 @@ + +  
@@ -693,6 +704,34 @@
+ +
+
+

Use as thumbnail

+ Use a pictures as thumbnail for embeddings, LORAs, etc. +
+
+ +
+
+
+
+
+
+
+
+
+ +
+
+ + +
+
+
+
+