Upload README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
pipeline_tag: text-to-image
|
| 3 |
+
---
|
| 4 |
+
# Z-Image-Turbo
|
| 5 |
+
Original: https://huggingface.co/Tongyi-MAI/Z-Image-Turbo
|
| 6 |
+
|
| 7 |
+
Model repository for `TensorStack` library and the windows `Diffuse` application <br />
|
| 8 |
+
`Diffuse App`: Coming Soon!<br />
|
| 9 |
+
`TensorStack`: https://github.com/TensorStack-AI/TensorStack<br />
|
| 10 |
+
|
| 11 |
+
## C# Inference Demo
|
| 12 |
+
```csharp
|
| 13 |
+
// Pipeline Config
|
| 14 |
+
var pipelineConfig = new PipelineConfig
|
| 15 |
+
{
|
| 16 |
+
Path = "TensorStack/Z-Image-Turbo-ts",
|
| 17 |
+
Pipeline = "ZImagePipeline",
|
| 18 |
+
ProcessType = ProcessType.TextToImage,
|
| 19 |
+
IsFullOffloadEnabled = true,
|
| 20 |
+
DataType = DataType.Bfloat16
|
| 21 |
+
};
|
| 22 |
+
|
| 23 |
+
// Create Pipeline
|
| 24 |
+
using (var pythonPipeline = new PythonPipeline(pipelineConfig))
|
| 25 |
+
{
|
| 26 |
+
// Download/Load Model
|
| 27 |
+
await pythonPipeline.LoadAsync();
|
| 28 |
+
|
| 29 |
+
// Generate Option
|
| 30 |
+
var options = new PipelineOptions
|
| 31 |
+
{
|
| 32 |
+
Prompt = "Cute doggo riding a bicycle",
|
| 33 |
+
Steps = 10,
|
| 34 |
+
Width = 1024,
|
| 35 |
+
Height = 1024,
|
| 36 |
+
GuidanceScale = 0f,
|
| 37 |
+
Scheduler = SchedulerType.FlowMatchEulerDiscrete
|
| 38 |
+
};
|
| 39 |
+
|
| 40 |
+
// Generate
|
| 41 |
+
var response = await pythonPipeline.GenerateAsync(options);
|
| 42 |
+
|
| 43 |
+
// Save Image
|
| 44 |
+
await response
|
| 45 |
+
.AsImageTensor()
|
| 46 |
+
.SaveAsync("Result.png");
|
| 47 |
+
}
|
| 48 |
+
```
|