flutter_stable_diffusion 1.0.0
flutter_stable_diffusion: ^1.0.0 copied to clipboard
A Flutter plugin for generate 'Stable Diffusion' image.
flutter_stable_diffusion #
A Flutter plugin for create channel for platform object instance and dart object instance
iOS | macOS | |
---|---|---|
Support | 16.2+ | 13.1+ |
Usage #
To use this plugin, add flutter_stable_diffusion
as a dependency in your pubspec.yaml file.
Example #
// create pipeline params
final PlatformStableDiffusionPipelineCreationParams params = PlatformStableDiffusionPipelineCreationParams(modelPath:'your model path');
// create pipeline
final FlutterStableDiffusionPipeline pipeline = FlutterStableDiffusionPipeline(params);
// load resources
await pipeline.loadResources();
// generate params
final PlatformStableDiffusionPipelineGenerateParams generateParams = PlatformStableDiffusionPipelineGenerateParams(
prompt: "your prompt",
negativePrompt: "your negative prompt",
stepCount: 20,
guidanceScale: 7.5,
);
// generate
final PlatformStableDiffusionPipelineGenerateResult result = await pipeline.generate(generateParams);
more detail, see example