Skip to content

[Feature Request] Add new way to manage timestep distribution and new loss offset feature #1375

@Anzhc

Description

@Anzhc

We were working some time on an way to create timestep distribution specific to any particular dataset used in training.

We tested it for last couple months using Derrian easy scripts trainer with hardcoded changes, but we're not familiar with sd-scripts structure enough to fully integrate that as toggleable feature on our own at the current point in time, hence feature request.

https://github.com/Anzhc/Timestep-Attention-and-other-shenanigans

Here we give code of functions structured roughly correctly for usage with variables in sd-scripts. Also examples how we implemented it in hardcoded way are included in repo (look into "Kohya file examples" folder).
It builds distribution based on received loss values, similar to this:
322636402-c5368e3c-c074-45a9-a929-e49808f87618
But unique to each dataset(as it's based on particular loss values received in scope of training).

In majority of cases it improved convergence speed and quality of outcome in our tests.

We also provide code for Loss Offset Curve feature that works with said distribution, can be scaled and scheduled. It also supposed to improve convergence speed.

Some experimental loss functions are included too, but those are really just experiments.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions