Skip to content

partial models spec in model_index.json #10413

Description

@sayakpaul
          one slightly offtopic note - if we're coming up with new format, lets make sure it covers the painpoints of existing ones, otherwise its-just-another-standard.

as is dduf does have benefits, but it would be great if it could cover one of the most common use-cases: partial models.
e.g.

  • typical sdxl model in single-file format includes unet and vae, but te1 and te2 are up to user to load.
  • same sdxl model in diffusers folder-style format includes all components, but that creates significant duplication of storage

why not have model config that can point each model component not just to subfolder, but to other repo as well.
so for example, sdxl model could have unet-only with links to vae, te1, te2 in reference repo if they are unchanged.

for example:

{
  "_class_name": "StableDiffusionXLPipeline",
  "scheduler": ["diffusers", "EulerDiscreteScheduler"],
  "unet": ["diffusers", "UNet2DConditionModel"],
  "vae": ["diffusers", "AutoencoderKL"],
  "text_encoder": ["transformers", "CLIPTextModel",
  "text_encoder_2": ["transformers", "CLIPTextModelWithProjection"],
  "tokenizer": ["transformers", "CLIPTokenizer"],
  "tokenizer_2": ["transformers", "CLIPTokenizer"]
  "_locations": {
      "text_encoder": "stabilityai/stable-diffusion-xl-base-1.0/text_encoder",
      "tokenizer": "stabilityai/stable-diffusion-xl-base-1.0/tokenizer",
      "text_encoder_2": "stabilityai/stable-diffusion-xl-base-1.0/text_encoder_2",
      "tokenizer_2": "stabilityai/stable-diffusion-xl-base-1.0/tokenizer_2"
  }
}

Originally posted by @vladmandic in #10037 (comment)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

staleIssues that haven't received updates

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions