Skip to content

Commit c8fa7dd

Browse files
committed
v0.5.6 - SkyReelsV2 Pipeline, Fix Incorrect diffusers URL
1 parent 8dc06a2 commit c8fa7dd

File tree

10 files changed

+169
-13
lines changed

10 files changed

+169
-13
lines changed

DiffuseApp/DiffuseApp/Common/DiffusionDefaultOptions.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ public record DiffusionDefaultOptions
1313
public int Width { get; set; }
1414
public int Frames { get; set; }
1515
public float FrameRate { get; set; } = 16;
16+
public int FrameChunk { get; set; }
17+
public int FrameChunkOverlap { get; set; }
18+
public int NoiseCondition { get; set; }
19+
1620
public SchedulerType Scheduler { get; set; }
1721
public SchedulerType[] Schedulers { get; set; }
1822

DiffuseApp/DiffuseApp/Common/DiffusionInputOptions.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ public record DiffusionInputOptions : BaseRecord
2626
private List<LoraOptionModel> _loraOptions;
2727
private int _frames;
2828
private float _frameRate;
29+
private int _noiseCondition;
30+
private int _frameChunkOverlap;
31+
private int _frameChunk;
2932

3033
public int Width
3134
{
@@ -128,6 +131,23 @@ public float FrameRate
128131
set { SetProperty(ref _frameRate, value); }
129132
}
130133

134+
public int FrameChunk
135+
{
136+
get { return _frameChunk; }
137+
set { SetProperty(ref _frameChunk, value); }
138+
}
139+
140+
public int FrameChunkOverlap
141+
{
142+
get { return _frameChunkOverlap; }
143+
set { SetProperty(ref _frameChunkOverlap, value); }
144+
}
145+
146+
public int NoiseCondition
147+
{
148+
get { return _noiseCondition; }
149+
set { SetProperty(ref _noiseCondition, value); }
150+
}
131151

132152

133153
[JsonIgnore]

DiffuseApp/DiffuseApp/Controls/DiffusionInputControl.xaml.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,9 @@ private Task OnPipelineChanged(PipelineModel oldPipeline, PipelineModel newPipel
203203

204204
Frames = newOptions.Frames,
205205
FrameRate = newOptions.FrameRate,
206+
FrameChunk = newOptions.FrameChunk,
207+
FrameChunkOverlap = newOptions.FrameChunkOverlap,
208+
NoiseCondition = newOptions.NoiseCondition,
206209
SchedulerOptions = new SchedulerInputOptions
207210
{
208211
Shift = newOptions.Shift,

DiffuseApp/DiffuseApp/Services/DiffusionService.cs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using System.Collections.Generic;
66
using System.IO;
77
using System.Linq;
8+
using System.Text.Json.Serialization;
89
using System.Threading;
910
using System.Threading.Tasks;
1011
using TensorStack.Common;
@@ -206,6 +207,7 @@ public async Task<ImageTensor> GenerateImageAsync(DiffusionInputOptions options)
206207
IsExecuting = true;
207208
try
208209
{
210+
var imageFileName = _mediaService.GetTempFile(MediaType.Image);
209211
options.Seed = options.Seed > 0 ? options.Seed : Random.Shared.Next();
210212
options.NegativePrompt = options.GuidanceScale > 1f && string.IsNullOrEmpty(options.NegativePrompt) ? " " : options.NegativePrompt;
211213
var generateOptions = new PipelineOptions
@@ -226,6 +228,8 @@ public async Task<ImageTensor> GenerateImageAsync(DiffusionInputOptions options)
226228
InputControlImages = options.InputControlImages,
227229
SchedulerOptions = GetSchedulerOptions(options.SchedulerOptions),
228230
LoraOptions = GetLoraOptions(options),
231+
TempFileName = imageFileName,
232+
NoiseCondition = options.NoiseCondition
229233
};
230234

231235
var tensorResult = await _pipelineClient.RunAsync(generateOptions);
@@ -249,7 +253,7 @@ public async Task<VideoInputStream> GenerateVideoAsync(DiffusionInputOptions opt
249253
IsExecuting = true;
250254
try
251255
{
252-
var videoFileName = _mediaService.GetTempVideoFile();
256+
var videoFileName = _mediaService.GetTempFile(MediaType.Video);
253257
options.Seed = options.Seed > 0 ? options.Seed : Random.Shared.Next();
254258
options.NegativePrompt = options.GuidanceScale > 1f && string.IsNullOrEmpty(options.NegativePrompt) ? " " : options.NegativePrompt;
255259
var generateOptions = new PipelineOptions
@@ -272,7 +276,10 @@ public async Task<VideoInputStream> GenerateVideoAsync(DiffusionInputOptions opt
272276
InputControlImages = options.InputControlImages,
273277
SchedulerOptions = GetSchedulerOptions(options.SchedulerOptions),
274278
LoraOptions = GetLoraOptions(options),
275-
TempFileName = videoFileName
279+
TempFileName = videoFileName,
280+
NoiseCondition = options.NoiseCondition,
281+
FrameChunk = options.FrameChunk,
282+
FrameChunkOverlap = options.FrameChunkOverlap,
276283
};
277284

278285
var tensorResult = await _pipelineClient.RunAsync(generateOptions);

DiffuseApp/DiffuseApp/Services/InterpolationService.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public async Task<VideoInputStream> ExecuteAsync(InterpolationRequest options, I
109109
try
110110
{
111111
IsExecuting = true;
112-
var resultVideoFile = _mediaService.GetTempVideoFile();
112+
var videoFileName = _mediaService.GetTempFile(MediaType.Video);
113113
using (_cancellationTokenSource = new CancellationTokenSource())
114114
{
115115
var cancellationToken = _cancellationTokenSource.Token;
@@ -122,7 +122,7 @@ public async Task<VideoInputStream> ExecuteAsync(InterpolationRequest options, I
122122
}, progressCallback, cancellationToken: cancellationToken);
123123

124124

125-
return await _mediaService.SaveWithAudioAsync(processedVideo, options.VideoStream.SourceFile, resultVideoFile, cancellationToken);
125+
return await _mediaService.SaveWithAudioAsync(processedVideo, options.VideoStream.SourceFile, videoFileName, cancellationToken);
126126
}
127127
}
128128
finally

DiffuseApp/DiffuseApp/Services/MediaService.cs

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System;
1+
using Diffuse.Common;
2+
using System;
23
using System.Collections.Generic;
34
using System.Threading;
45
using System.Threading.Tasks;
@@ -27,9 +28,17 @@ public MediaService(Settings settings)
2728
/// Gets a new temporary video filename.
2829
/// </summary>
2930
/// <returns>System.String.</returns>
30-
public string GetTempVideoFile()
31+
public string GetTempFile(MediaType mediaType)
3132
{
32-
return FileHelper.RandomFileName(_settings.DirectoryTemp, "mp4");
33+
var extension = mediaType switch
34+
{
35+
MediaType.Text => "txt",
36+
MediaType.Audio => "wav",
37+
MediaType.Image => "png",
38+
MediaType.Video => "mp4",
39+
_ => throw new NotImplementedException()
40+
};
41+
return FileHelper.RandomFileName(_settings.DirectoryTemp, extension);
3342
}
3443

3544

@@ -88,7 +97,7 @@ public async Task<VideoInputStream> SaveWithAudioAsync(VideoInputStream videoInp
8897

8998
public interface IMediaService : IVideoService
9099
{
91-
string GetTempVideoFile();
100+
string GetTempFile(MediaType mediaType);
92101
Task<VideoInputStream> GetStreamAsync(string filename);
93102
Task<VideoInputStream> SaveWithAudioAsync(IAsyncEnumerable<VideoFrame> processedVideo, string sourceFile, string resultVideoFile, CancellationToken cancellationToken = default);
94103
Task<VideoInputStream> SaveWithAudioAsync(VideoInputStream videoInput, string videoOutputFile, Func<VideoFrame, Task<VideoFrame>> frameProcessor, CancellationToken cancellationToken = default);

DiffuseApp/DiffuseApp/Services/UpscaleService.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ public async Task<VideoInputStream> ExecuteAsync(UpscaleVideoRequest request, IP
174174
try
175175
{
176176
IsExecuting = true;
177-
var resultVideoFile = _mediaService.GetTempVideoFile();
177+
var videoFileName = _mediaService.GetTempFile(MediaType.Video);
178178
using (_cancellationTokenSource = new CancellationTokenSource())
179179
{
180180
var frameCount = request.VideoStream.FrameCount;
@@ -194,7 +194,7 @@ async Task<VideoFrame> FrameProcessor(VideoFrame frame)
194194
return new VideoFrame(frame.Index, processedFrame, frame.SourceFrameRate, frame.AuxFrame);
195195
}
196196

197-
return await _mediaService.SaveWithAudioAsync(request.VideoStream, resultVideoFile, FrameProcessor, cancellationToken);
197+
return await _mediaService.SaveWithAudioAsync(request.VideoStream, videoFileName, FrameProcessor, cancellationToken);
198198
}
199199
}
200200
finally

DiffuseApp/DiffuseApp/Settings.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ public HashSet<string> GetPipelines()
201201
"LTXPipeline",
202202
"LTX2Pipeline",
203203
"QwenImagePipeline",
204+
"SkyReelsV2Pipeline",
204205
"StableDiffusion3Pipeline",
205206
"StableDiffusionXLPipeline",
206207
"WanPipeline",

DiffuseApp/DiffuseApp/Settings.default.json

Lines changed: 114 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"wheel==0.45.1",
2323
"transformers==4.57.3",
2424
"accelerate==1.12.0",
25-
"diffusers@git+https://github.com/huggingface/diffusers.git@d32483913ae1aaf6f9a0b8abce0a3bd7a78eebe5",
25+
"diffusers@https://github.com/huggingface/diffusers/archive/d32483913ae1aaf6f9a0b8abce0a3bd7a78eebe5.zip",
2626
"protobuf==6.33.2",
2727
"sentencepiece==0.2.1",
2828
"ftfy==6.3.1",
@@ -58,7 +58,7 @@
5858
"wheel==0.45.1",
5959
"transformers==4.57.3",
6060
"accelerate==1.12.0",
61-
"diffusers@git+https://github.com/huggingface/diffusers.git@d32483913ae1aaf6f9a0b8abce0a3bd7a78eebe5",
61+
"diffusers@https://github.com/huggingface/diffusers/archive/d32483913ae1aaf6f9a0b8abce0a3bd7a78eebe5.zip",
6262
"protobuf==6.33.2",
6363
"sentencepiece==0.2.1",
6464
"ftfy==6.3.1",
@@ -2706,6 +2706,118 @@
27062706
"Height": 2176
27072707
}
27082708
]
2709+
},
2710+
{
2711+
"Id": 200,
2712+
"Backend": "PyTorch",
2713+
"Name": "SkyReels v2 1B 540P",
2714+
"Pipeline": "SkyReelsV2Pipeline",
2715+
"Path": "Skywork/SkyReels-V2-DF-1.3B-540P-Diffusers",
2716+
"Source": "HuggingFace",
2717+
"MemoryProfile": [
2718+
{
2719+
"DataType": "int8",
2720+
"MemoryModes": [ 4, 10, 20, 22, 32 ]
2721+
},
2722+
{
2723+
"DataType": "float8",
2724+
"MemoryModes": [ 4, 10, 20, 22, 32 ]
2725+
},
2726+
{
2727+
"DataType": "float16",
2728+
"MemoryModes": [ 4, 21, 23, 30, 32 ]
2729+
},
2730+
{
2731+
"DataType": "bfloat16",
2732+
"MemoryModes": [ 4, 21, 23, 30, 32 ]
2733+
}
2734+
],
2735+
"BaseType": "bfloat16",
2736+
"ProcessTypes": [ "TextToVideo", "ImageToVideo" ],
2737+
"Link": "https://huggingface.co/Skywork/SkyReels-V2-DF-1.3B-540P-Diffusers",
2738+
"DefaultOptions": {
2739+
"Steps": 30,
2740+
"Width": 960,
2741+
"Height": 544,
2742+
"Frames": 97,
2743+
"FrameRate": 24,
2744+
"GuidanceScale": 0,
2745+
"Scheduler": "UniPC",
2746+
"Schedulers": [ "UniPC", "FlowMatchEulerDiscrete" ],
2747+
"TimestepSpacing": "linspace",
2748+
"PredictionType": "flow_prediction",
2749+
"SolverType": "bh2",
2750+
"StepsOffset": 0,
2751+
"Shift": 3,
2752+
"FramesMin": 97,
2753+
"FramesMax": 2048,
2754+
"FrameChunk": 97,
2755+
"FrameChunkOverlap": 17,
2756+
"NoiseCondition": 20
2757+
},
2758+
"Resolutions": [
2759+
{
2760+
"Width": 960,
2761+
"Height": 544,
2762+
"IsDefault": true
2763+
}
2764+
]
2765+
},
2766+
{
2767+
"Id": 201,
2768+
"Backend": "PyTorch",
2769+
"Name": "SkyReels v2 14B 540P",
2770+
"Pipeline": "SkyReelsV2Pipeline",
2771+
"Path": "Skywork/SkyReels-V2-DF-14B-540P-Diffusers",
2772+
"Source": "HuggingFace",
2773+
"MemoryProfile": [
2774+
{
2775+
"DataType": "int8",
2776+
"MemoryModes": [ 4, 10, 20, 22, 32 ]
2777+
},
2778+
{
2779+
"DataType": "float8",
2780+
"MemoryModes": [ 4, 10, 20, 22, 32 ]
2781+
},
2782+
{
2783+
"DataType": "float16",
2784+
"MemoryModes": [ 4, 21, 23, 30, 32 ]
2785+
},
2786+
{
2787+
"DataType": "bfloat16",
2788+
"MemoryModes": [ 4, 21, 23, 30, 32 ]
2789+
}
2790+
],
2791+
"BaseType": "bfloat16",
2792+
"ProcessTypes": [ "TextToVideo", "ImageToVideo" ],
2793+
"Link": "https://huggingface.co/Skywork/SkyReels-V2-DF-1.3B-540P-Diffusers",
2794+
"DefaultOptions": {
2795+
"Steps": 30,
2796+
"Width": 960,
2797+
"Height": 544,
2798+
"Frames": 97,
2799+
"FrameRate": 24,
2800+
"GuidanceScale": 0,
2801+
"Scheduler": "UniPC",
2802+
"Schedulers": [ "UniPC", "FlowMatchEulerDiscrete" ],
2803+
"TimestepSpacing": "linspace",
2804+
"PredictionType": "flow_prediction",
2805+
"SolverType": "bh2",
2806+
"StepsOffset": 0,
2807+
"Shift": 3,
2808+
"FramesMin": 97,
2809+
"FramesMax": 2048,
2810+
"FrameChunk": 97,
2811+
"FrameChunkOverlap": 17,
2812+
"NoiseCondition": 20
2813+
},
2814+
"Resolutions": [
2815+
{
2816+
"Width": 960,
2817+
"Height": 544,
2818+
"IsDefault": true
2819+
}
2820+
]
27092821
}
27102822
],
27112823
"LoraAdapterModels": [

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project>
22
<PropertyGroup>
3-
<Version>0.5.5</Version>
3+
<Version>0.5.6</Version>
44
<Company>TensorStack</Company>
55
<Copyright>TensorStack - 2026</Copyright>
66
<RepositoryUrl>https://github.com/TensorStack-AI/Diffuse</RepositoryUrl>

0 commit comments

Comments
 (0)