You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
1.2 KiB
37 lines
1.2 KiB
using System.ComponentModel.DataAnnotations; |
|
using StabilityMatrix.Avalonia.Controls; |
|
using StabilityMatrix.Avalonia.Models.Inference; |
|
using StabilityMatrix.Avalonia.Services; |
|
using StabilityMatrix.Core.Attributes; |
|
using StabilityMatrix.Core.Models.Api.Comfy.Nodes; |
|
|
|
namespace StabilityMatrix.Avalonia.ViewModels.Inference.Video; |
|
|
|
[View(typeof(ModelCard))] |
|
[ManagedService] |
|
[Transient] |
|
public class ImgToVidModelCardViewModel : ModelCardViewModel |
|
{ |
|
public ImgToVidModelCardViewModel(IInferenceClientManager clientManager) |
|
: base(clientManager) |
|
{ |
|
DisableSettings = true; |
|
} |
|
|
|
public override void ApplyStep(ModuleApplyStepEventArgs e) |
|
{ |
|
var imgToVidLoader = e.Nodes.AddTypedNode( |
|
new ComfyNodeBuilder.ImageOnlyCheckpointLoader |
|
{ |
|
Name = "ImageOnlyCheckpointLoader", |
|
CkptName = |
|
SelectedModel?.RelativePath |
|
?? throw new ValidationException("Model not selected") |
|
} |
|
); |
|
|
|
e.Builder.Connections.BaseModel = imgToVidLoader.Output1; |
|
e.Builder.Connections.BaseClipVision = imgToVidLoader.Output2; |
|
e.Builder.Connections.BaseVAE = imgToVidLoader.Output3; |
|
} |
|
}
|
|
|