A custom Dify Tool Plugin that integrates MuAPI into Dify, enabling image generation directly from Dify workflows, chatflows, and agents.
-
Generate images using MuAPI
-
Configure MuAPI API key through Dify credentials
-
Return generated images directly into Dify
-
Support custom prompts
-
Configurable image generation parameters:
- Model
- Width
- Height
- Number of Images
- Video Generation
- Image Editing
- Background Removal
- Image Upscaling
- Audio Generation
- Audio Remix
- Model Discovery
- Dify Plugin SDK
- Python 3.12
- MuAPI Python SDK
- Docker
- Dify Plugin Daemon
muapi-dify-plugin/
│
├── main.py
├── manifest.yaml
├── requirements.txt
│
├── provider/
│ ├── muapi.yaml
│ └── muapi_provider.py
│
├── tools/
│ ├── generate_image.py
│ └── generate_image.yaml
│
└── _assets/
- Docker Desktop
- WSL2
- Dify
- Python 3.12
- Go (required for packaging plugins)
git clone https://github.com/2005-ab/dify-plugin-muapi.git
cd dify-plugin-muapipip install -r requirements.txtRequirements:
dify-plugin
git+https://github.com/SamurAIGPT/muapi-python.gitNavigate to the Dify Plugin Daemon repository:
cd dify-plugin-daemonPackage the plugin:
go run ./cmd/commandline plugin package <plugin-path>Example:
go run ./cmd/commandline plugin package D:\dify\muapi-dify-pluginOutput:
muapi-dify-plugin.difypkg
Edit:
dify/docker/.env
Change:
FORCE_VERIFYING_SIGNATURE=trueTo:
FORCE_VERIFYING_SIGNATURE=falseRestart Dify:
docker compose down
docker compose up -d- Open Dify
- Navigate to Plugins
- Click Local Package File
- Upload:
muapi-dify-plugin.difypkg
After installation:
- Open MuAPI Plugin
- Configure Provider Credentials
- Enter:
MUAPI API Key
Save configuration.
Add the Generate Image tool to a workflow.
Example prompt:
A futuristic city at sunset with flying cars
Example workflow:
User Input
↓
Generate Image
↓
Output Image
{
"files": [
{
"extension": ".avif",
"filename": "generated-image.avif"
}
]
}During development the following issues were resolved:
- Docker Desktop not starting
- WSL2 not configured
- Hypervisor disabled (
hypervisorlaunchtype Off) - Virtual Machine Platform configuration
- Invalid plugin identifier
- Plugin signature verification
- Missing provider metadata
- Missing YAML schema fields
- Incorrect plugin bootstrap
- Empty
main.py - Tool parameter validation errors
- Incorrect PyPI package (
muapi) - SDK packaging problems
- Missing command modules
- API key authentication failures
Dify Workflow
↓
MuAPI Tool
↓
MuAPI SDK
↓
MuAPI API
↓
Generated Image
↓
Returned to Dify
Status:
✅ Plugin Packaging
✅ Plugin Installation
✅ Credential Configuration
✅ Image Generation
✅ Image Delivery to Dify
MIT License
Built using:
- Dify Plugin SDK
- MuAPI
- Docker
- Python