Rename diffusionkit to sdkit; Delete runtime.py (historic moment)

This commit is contained in:
cmdr2 2022-12-19 19:27:28 +05:30
parent 1595f1ed05
commit e483071894
7 changed files with 14 additions and 1093 deletions

View File

@ -1,6 +1,6 @@
from pydantic import BaseModel from pydantic import BaseModel
from diffusionkit.types import GenerateImageRequest from sdkit.types import GenerateImageRequest
class TaskData(BaseModel): class TaskData(BaseModel):
request_id: str = None request_id: str = None

View File

@ -1,11 +1,10 @@
import os import os
import logging import logging
import picklescan.scanner import picklescan.scanner
import rich
from sd_internal import app, TaskData, device_manager from sd_internal import app, TaskData, device_manager
from diffusionkit import model_loader from sdkit.models import model_loader
from diffusionkit.types import Context from sdkit.types import Context
log = logging.getLogger() log = logging.getLogger()

View File

@ -6,8 +6,8 @@ import logging
from sd_internal import device_manager, save_utils from sd_internal import device_manager, save_utils
from sd_internal import TaskData, Response, Image as ResponseImage, UserInitiatedStop from sd_internal import TaskData, Response, Image as ResponseImage, UserInitiatedStop
from diffusionkit import model_loader, image_generator, image_utils, filters as image_filters, data_utils from sdkit import model_loader, image_generator, image_utils, filters as image_filters
from diffusionkit.types import Context, GenerateImageRequest, FilterImageRequest from sdkit.types import Context, GenerateImageRequest, FilterImageRequest
log = logging.getLogger() log = logging.getLogger()

File diff suppressed because it is too large Load Diff

View File

@ -3,8 +3,8 @@ import time
import base64 import base64
import re import re
from diffusionkit import data_utils from sdkit.utils import save_images, save_dicts
from diffusionkit.types import GenerateImageRequest from sdkit.types import GenerateImageRequest
from sd_internal import TaskData from sd_internal import TaskData
@ -33,12 +33,12 @@ def save_to_disk(images: list, filtered_images: list, req: GenerateImageRequest,
metadata_entries = get_metadata_entries(req, task_data) metadata_entries = get_metadata_entries(req, task_data)
if task_data.show_only_filtered_image or filtered_images == images: if task_data.show_only_filtered_image or filtered_images == images:
data_utils.save_images(filtered_images, save_folder_path, file_name=make_filename_callback(req), output_format=task_data.output_format, output_quality=task_data.output_quality) save_images(filtered_images, save_folder_path, file_name=make_filename_callback(req), output_format=task_data.output_format, output_quality=task_data.output_quality)
data_utils.save_metadata(metadata_entries, save_folder_path, file_name=make_filename_callback(req), output_format=task_data.metadata_output_format) save_dicts(metadata_entries, save_folder_path, file_name=make_filename_callback(req), output_format=task_data.metadata_output_format)
else: else:
data_utils.save_images(images, save_folder_path, file_name=make_filename_callback(req), output_format=task_data.output_format, output_quality=task_data.output_quality) save_images(images, save_folder_path, file_name=make_filename_callback(req), output_format=task_data.output_format, output_quality=task_data.output_quality)
data_utils.save_images(filtered_images, save_folder_path, file_name=make_filename_callback(req, suffix='filtered'), output_format=task_data.output_format, output_quality=task_data.output_quality) save_images(filtered_images, save_folder_path, file_name=make_filename_callback(req, suffix='filtered'), output_format=task_data.output_format, output_quality=task_data.output_quality)
data_utils.save_metadata(metadata_entries, save_folder_path, file_name=make_filename_callback(req, suffix='filtered'), output_format=task_data.metadata_output_format) save_dicts(metadata_entries, save_folder_path, file_name=make_filename_callback(req, suffix='filtered'), output_format=task_data.metadata_output_format)
def get_metadata_entries(req: GenerateImageRequest, task_data: TaskData): def get_metadata_entries(req: GenerateImageRequest, task_data: TaskData):
metadata = get_printable_request(req) metadata = get_printable_request(req)

View File

@ -15,7 +15,7 @@ import queue, threading, time, weakref
from typing import Any, Hashable from typing import Any, Hashable
from sd_internal import TaskData, device_manager from sd_internal import TaskData, device_manager
from diffusionkit.types import GenerateImageRequest from sdkit.types import GenerateImageRequest
log = logging.getLogger() log = logging.getLogger()

View File

@ -15,7 +15,7 @@ from pydantic import BaseModel
from sd_internal import app, model_manager, task_manager from sd_internal import app, model_manager, task_manager
from sd_internal import TaskData from sd_internal import TaskData
from diffusionkit.types import GenerateImageRequest from sdkit.types import GenerateImageRequest
log = logging.getLogger() log = logging.getLogger()