chaiNNer-org / spandrel

Spandrel gives your project support for various PyTorch architectures meant for AI Super-Resolution, restoration, and inpainting. Based on the model support implemented in chaiNNer.
MIT License
103 stars 7 forks source link

Add support for seemore #272

Open umzi2 opened 3 weeks ago

umzi2 commented 3 weeks ago

https://github.com/eduardzamfir/seemoredetails

to maybe save you some work, I got the parameters from the state like this

#seemore detect
    scale = 4  # tracked
    in_chans = 3  # tracked
    num_experts = 3  # tracked
    num_layers = 8  # tracked
    embedding_dim = 48  # tracked
    img_range = 1.0  # can't be tracked
    use_shuffle = True  # can't be tracked
    global_kernel_size = 11  # tracked
    recursive = 2  # can't be tracked
    lr_space = "exp"  # can't be tracked
    topk = 1  # can't be tracked

    global_kernel_size = state["body.0.global_block.block.attn.conv.0.weight"].shape[3]
    conv1_shape = state["upsampler.0.weight"].shape
    in_chans = conv1_shape[2]
    embedding_dim = state["conv_1.weight"].shape[0]
    scale = int((conv1_shape[0] / in_chans) ** 0.5)
    num_layers = get_seq_len(state, "body")
    num_experts = get_seq_len(state, "body.0.local_block.block.moe_layer.experts")
    recursive = 1 if num_layers == 16 and embedding_dim == 48 else 2