Skip to content

Pix2Pix assertion failed #352

@kacperd

Description

@kacperd

Hello!

I'm trying to use a model https://huggingface.co/timbrooks/instruct-pix2pix. I successfully converted it to a CoreML model. However when I'm trying to run the pipeline, it crashes with an error:

StableDiffusion/Scheduler.swift:278: Assertion failed

It's specifically the assertion in this part of the code:

 func convertModelOutput(modelOutput: MLShapedArray<Float32>, timestep: Int, sample: MLShapedArray<Float32>) -> MLShapedArray<Float32> {
        assert(modelOutput.scalarCount == sample.scalarCount)
        let scalarCount = modelOutput.scalarCount
        let (alpha_t, sigma_t) = (self.alpha_t[timestep], self.sigma_t[timestep])
        ....
}

Can this somehow be avoided by adjusting StableDiffusionPipeline.Configuration?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions