Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 19, 2025

Description

Adds importer for diffuser backend models following existing importer patterns (llama-cpp, mlx, vllm, transformers), including UI support in the model editor.

Implementation

  • diffuser.go: Implements DiffuserImporter matching models via:

    • backend: "diffusers" preference
    • HuggingFace files: model_index.json, scheduler/scheduler_config.json
    • Uses gopkg.in/yaml.v3 for consistency with the main importers module
  • diffuser_test.go: 18 ginkgo tests covering match/import logic and preferences

  • importers.go: Registered DiffuserImporter in defaultImporters

  • model-editor.html: Added diffuser preferences to model editor UI:

    • Backend dropdown now includes "diffusers" option
    • Dynamic fields appear when diffusers backend is selected: Pipeline Type, Scheduler Type, Enable Parameters, CUDA checkbox
    • All fields integrate with existing preferences system

Configuration Output

backend: diffusers
known_usecases:
- image
diffusers:
  cuda: true
  pipeline_type: StableDiffusion3Pipeline
  scheduler_type: k_dpmpp_2m
  enable_parameters: negative_prompt,num_inference_steps
parameters:
  model: https://huggingface.co/stabilityai/stable-diffusion-3-medium

Supports preference overrides: pipeline_type, scheduler_type, cuda, enable_parameters. Defaults to StableDiffusionPipeline with standard parameters.

UI Changes

The model editor now provides a user-friendly interface for configuring diffuser models with backend-specific options that appear dynamically when "diffusers" is selected.

Notes for Reviewers

18 new tests added (88 total). 3 pre-existing test failures in LlamaCPPImporter unrelated to changes.

Signed commits

  • Yes, I signed my commits.
Original prompt

Look at the already existing importers implementation and add one for the diffuser backend. Add also ginkgo tests.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@netlify
Copy link

netlify bot commented Nov 19, 2025

Deploy Preview for localai ready!

Name Link
🔨 Latest commit 9acb271
🔍 Latest deploy log https://app.netlify.com/projects/localai/deploys/691f27f946abbf0008fe9c84
😎 Deploy Preview https://deploy-preview-7316--localai.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copilot AI and others added 2 commits November 19, 2025 21:54
Co-authored-by: mudler <2420543+mudler@users.noreply.github.com>
Co-authored-by: mudler <2420543+mudler@users.noreply.github.com>
Copilot AI changed the title [WIP] Add importer for the diffuser backend with ginkgo tests [importers] Add diffuser backend importer with ginkgo tests Nov 19, 2025
Copilot AI requested a review from mudler November 19, 2025 22:00
Copilot finished work on behalf of mudler November 19, 2025 22:00
@mudler
Copy link
Owner

mudler commented Nov 19, 2025

@copilot add the new preferences to the common preferences of the model-editor import section

Co-authored-by: mudler <2420543+mudler@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Nov 19, 2025

@copilot add the new preferences to the common preferences of the model-editor import section

Added diffuser preferences to the model-editor import section in commit d6464fa.

The following fields now appear when "diffusers" backend is selected:

  • Pipeline Type (pipeline_type)
  • Scheduler Type (scheduler_type)
  • Enable Parameters (enable_parameters)
  • CUDA checkbox (cuda)

All fields integrate with the existing preferences system and are passed to the DiffuserImporter.

Screenshot

@github-actions github-actions bot added kind/documentation Improvements or additions to documentation dependencies labels Nov 19, 2025
Copilot AI changed the title [importers] Add diffuser backend importer with ginkgo tests [importers] Add diffuser backend importer with ginkgo tests and UI support Nov 19, 2025
Copilot finished work on behalf of mudler November 19, 2025 22:22
@mudler
Copy link
Owner

mudler commented Nov 20, 2025

@copilot be consistent and use yaml/v3

Co-authored-by: mudler <2420543+mudler@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Nov 20, 2025

@copilot be consistent and use yaml/v3

Updated to use gopkg.in/yaml.v3 for consistency in commit 9acb271.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • huggingface.co
    • Triggering command: /tmp/go-build2054339694/b001/importers.test -test.paniconexit0 -test.timeout=10m0s -test.v=true (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI requested a review from mudler November 20, 2025 14:41
Copilot finished work on behalf of mudler November 20, 2025 14:41
@mudler mudler marked this pull request as ready for review November 20, 2025 14:55
@mudler mudler changed the title [importers] Add diffuser backend importer with ginkgo tests and UI support feat(importers): Add diffuser backend importer with ginkgo tests and UI support Nov 20, 2025
@mudler mudler added enhancement New feature or request and removed kind/documentation Improvements or additions to documentation dependencies labels Nov 20, 2025
@github-actions github-actions bot added kind/documentation Improvements or additions to documentation dependencies labels Nov 20, 2025
@mudler mudler merged commit 16e5689 into master Nov 20, 2025
39 of 55 checks passed
@mudler mudler deleted the copilot/add-diffuser-backend-importer branch November 20, 2025 21:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies enhancement New feature or request kind/documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants