Merge pull request #1010 from ZeroCool940711/dev

Added some basic layout for the Model Manager tab.
This commit is contained in:
ZeroCool 2022-09-11 03:36:36 -07:00 committed by GitHub
commit b66056842a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 33 additions and 4 deletions

View File

@ -20,6 +20,7 @@ general:
extra_models_cpu: False
extra_models_gpu: False
save_metadata: True
save_format: "png"
skip_grid: False
skip_save: False
grid_format: "jpg:95"

View File

@ -31,6 +31,7 @@ dependencies:
- kornia==0.6
- omegaconf==2.1.1
- opencv-python-headless==4.6.0.66
- pandas==1.4.3
- piexif==1.1.3
- pudb==2019.2
- pynvml==11.4.1

View File

@ -13,6 +13,7 @@ from PIL import Image, ImageFont, ImageDraw, ImageFilter, ImageOps
from PIL.PngImagePlugin import PngInfo
import requests
from scipy import integrate
import pandas as pd
import torch
from torchdiffeq import odeint
from tqdm.auto import trange, tqdm
@ -35,7 +36,7 @@ from contextlib import contextmanager, nullcontext
from einops import rearrange, repeat
from itertools import islice
from omegaconf import OmegaConf
from io import BytesIO
from io import BytesIO, StringIO
from ldm.models.diffusion.ddim import DDIMSampler
from ldm.models.diffusion.plms import PLMSSampler
from ldm.util import instantiate_from_config
@ -2352,10 +2353,36 @@ def layout():
# use the current col2 first tab to show the preview_img and update it as its generated.
#preview_image.image(output_images)
with model_manager_tab:
st.write("Model Manager")
#
with model_manager_tab:
#search = st.text_input(label="Search", placeholder="Type the name of the model you want to search for.", help="")
csvString = f"""
,Stable Diffusion v1.4 , ./models/ldm/stable-diffusion-v1 , https://www.googleapis.com/storage/v1/b/aai-blog-files/o/sd-v1-4.ckpt?alt=media
,GFPGAN v1.3 , ./src/gfpgan/experiments/pretrained_models , https://github.com/TencentARC/GFPGAN/releases/download/v1.3.0/GFPGANv1.3.pth
,RealESRGAN_x4plus , ./src/realesrgan/experiments/pretrained_models , https://github.com/xinntao/Real-ESRGAN/releases/download/v0.1.0/RealESRGAN_x4plus.pth
,RealESRGAN_x4plus_anime_6B , ./src/realesrgan/experiments/pretrained_models , https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.2.4/RealESRGAN_x4plus_anime_6B.pth
,Waifu Diffusion v1.2 , ./models/custom , http://wd.links.sd:8880/wd-v1-2-full-ema.ckpt
,TrinArt Stable Diffusion v2 , ./models/custom , https://huggingface.co/naclbit/trinart_stable_diffusion_v2/resolve/main/trinart2_step115000.ckpt
"""
colms = st.columns((1, 3, 5, 5))
columns = ["",'Model Name','Save Location','Download Link']
# Convert String into StringIO
csvStringIO = StringIO(csvString)
df = pd.read_csv(csvStringIO, sep=",", header=None, names=columns)
for col, field_name in zip(colms, columns):
# table header
col.write(field_name)
for x, model_name in enumerate(df["Model Name"]):
col1, col2, col3, col4 = st.columns((1, 3, 4, 6))
col1.write(x) # index
col2.write(df['Model Name'][x])
col3.write(df['Save Location'][x])
col4.write(df['Download Link'][x])
if __name__ == '__main__':