Game Asset Generator

by mubarakhalketbi

146 stars
932 downloads
Not rated
GitHub

About

Generate 2D and 3D game assets using AI models hosted on Hugging Face Spaces.

Details

Author
mubarakhalketbi
GitHub stars
146
Downloads
932
Categories
Developer Tools, Other, AI, Design, Media
Tags
#game-development, #content-creation

- 2D asset generation from text prompts (e.g., pixel art sprites).
- 3D asset generation in OBJ and GLB formats.
- Supports multiple 3D model spaces: InstantMesh, Hunyuan3D-2, Hunyuan3D-2mini-Turbo.
- MCP integration for use with compatible clients like Claude Desktop.
- Automatic file management with local assets directory and resource URIs.
- Configurable 3D generation parameters via environment variables.

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name Game Asset Generator
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Clone the repository, install dependencies (npm install), configure your Hugging Face API token and a duplicated 3D model space in a .env file, then run the server (e.g., npm start for local stdio transport, or node src/index.js --sse for remote SSE). Interact via an MCP client like Claude Desktop using commands such as generate_2d_asset prompt:"pixel art sword" or generate_3d_asset prompt:"isometric 3D castle".

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "game asset generator": {
            "game-asset-mcp": {
                "command": "node",
                "args": [
                    "src/index.js",
                    "/path/to/directory"
                ]
            }
        }
    }
}

McpServers

{
    "game-asset-mcp": {
        "command": "node",
        "args": [
            "src/index.js",
            "/path/to/directory"
        ]
    }
}

Game Asset Generator using MCP and Hugging Face Spaces

This project is an innovative tool that simplifies game asset creation by leveraging AI-powered generation. Whether you're a game developer seeking rapid prototypes or an AI enthusiast exploring generative models, this tool enables you to create2Dand3D game assetsfrom text prompts effortlessly. It integrates AI models fromHugging Face Spaces—powered by"gokaygokay/Flux-2D-Game-Assets-LoRA","gokaygokay/Flux-Game-Assets-LoRA-v2", and one of three 3D model generation spaces (InstantMesh,Hunyuan3D-2, orHunyuan3D-2mini-Turbo, which you must duplicate to your account)—and uses theModel Context Protocol (MCP)for seamless interaction with AI assistants likeClaude Desktop.
- Project Overview
-
Features
-
How It Works
-
Prerequisites
-
Installation
-
Usage
-
Configuration
-
File Management
-
MCP Integration
-
Troubleshooting
-
Advanced
-
Contributing
-
License

TheGame Asset Generator(version0.3.0) harnesses AI to streamline the creation of game assets. It supports generating2D assets(e.g., pixel art sprites) and3D assets(e.g., OBJ and GLB models) from text prompts, integrating withHugging Face Spacesand theModel Context Protocol (MCP). This release introduces support for multiple 3D model generation spaces—InstantMesh,Hunyuan3D-2, andHunyuan3D-2mini-Turbo—offering flexibility and enhanced performance. Built withNode.jsand theMCP TypeScript SDK (v1.7.0), it provides a robust, cross-platform solution for asset generation.

- 2D Asset Generation: Create pixel art, sprites, or other 2D assets from text prompts (e.g., "pixel art sword").
- 3D Asset Generation: Generate 3D models (OBJ and GLB formats) from text descriptions, with automatic image-to-model conversion.
- Multiple 3D Model Spaces: SupportsInstantMesh,Hunyuan3D-2, andHunyuan3D-2mini-Turbofor varied 3D generation workflows.
- MCP Integration: Seamlessly interact with the tool via MCP-compatible clients likeClaude Desktop.
- File Management: Automatically saves and organizes assets in a localassetsdirectory with resource URIs (e.g.,asset://{type}/{id}).
- Robust Input Validation: UsesZodfor secure and reliable input processing.
- Multi-Client Support: Handles multiple simultaneous connections viaSSE transport.
- Secure Remote Access: OptionalHTTPSsupport for safe remote communication.
- Extensible Backend: Modular design for easy integration of new models or features.
- Cross-Platform: Compatible with Windows, macOS, and Linux usingNode.js.
- Configurable 3D Generation: Customize parameters like inference steps, guidance scale, and turbo mode via environment variables.

The Game Asset Generator transforms text prompts into game-ready assets through an automated pipeline:
- User Input: Submit a text prompt (e.g., "pixel art sword" or "isometric 3D castle").
- MCP Server: Routes the prompt to the appropriate tool (generate_2d_assetorgenerate_3d_asset).
- AI Model Interaction:

- 2D Assets: Utilizes theHugging Face Inference APIwith"gokaygokay/Flux-2D-Game-Assets-LoRA"(50 steps).
- 3D Assets:

- Generates an initial image using"gokaygokay/Flux-Game-Assets-LoRA-v2"(30 steps).
- Converts the image to a 3D model using one of:

- InstantMesh: Multi-step process (/preprocess,/generate_mvs,/make3d).
- Hunyuan3D-2: Single-step process (/generation_all).
- Hunyuan3D-2mini-Turbo: Single-step process (/generation_all) with configurable turbo modes.

User Prompt → MCP Server → AI Model(s) → Local File → Resource URI Response

Prompts are automatically enhanced with "high detailed, complete object, not cut off, white solid background" for optimal quality.

- Node.js: Version 16+ (includesnpm).
- Git: For cloning the repository.
- Internet Access: Required for Hugging Face API connectivity.
- Hugging Face Account: Needed for API access; obtain your token from
huggingface.co/settings/tokens.
- NPM Packages:

- @gradio/client: Interacts with Hugging Face Spaces.
- @huggingface/inference: For direct model inference.
- @modelcontextprotocol/sdk: Implements the MCP server.
- dotenv: Loads environment variables.
- express: Enables SSE transport.
- zod: Ensures input validation.
- sharp: Handles image processing.

git clone https://github.com/yourusername/game-asset-mcp.git cd game-asset-mcp

- Copy the example.envfile:

cp .env.example .env

Note: Uses ES modules ("type": "module"inpackage.json). Ensure Node.js 16+ is installed (node --version).

Interact with the server via anMCP client(e.g., Claude Desktop) or programmatically:

- Command:generate_2d_asset prompt:"pixel art sword"
- Output: Saves a PNG file (e.g.,2d_asset_generate_2d_asset_1698765432.png) and returns its URI.

- Command:generate_3d_asset prompt:"isometric 3D castle"
- Output: Saves OBJ/GLB files and intermediate images, returning their URIs. Provides an operation ID for long-running tasks.

- Natural Interaction:

- generate_2d_sprite prompt:"pixel art sword"
- generate_3d_model prompt:"isometric 3D castle"

After configuring (seeConfiguration), type commands directly in the interface.

- HF_TOKEN: Hugging Face API token.

HF_TOKEN=your_hf_token

- Duplicate one of:

- InstantMesh
-
Hunyuan3D-2
-
Hunyuan3D-2mini-Turbo

- InstantMesh:

- Steps: 30-75 (default: 75)
- Seed: Default 42

- Steps: 20-50 (default: 20)
- Guidance Scale: Default 5.5
- Octree Resolution:256,384,512(default:256)
- Seed: Default 1234

- Steps: 1-100 (default: 5 forTurbo, 10 forFast, 20 forStandard)
- Guidance Scale: Default 5.0
- Octree Resolution: 16-512 (default: 256)
- Seed: Default 1234

- PORT: SSE transport port (default: 3000).

PORT=3000

- MacOS:~/Library/Application Support/Claude/claude_desktop_config.json
- Windows:%APPDATA%\Claude\claude_desktop_config.json

{ "mcpServers": { "game-asset-generator": { "command": "node", "args": ["/full/path/to/game-asset-mcp/src/index.js"] } } }

- Storage Location: Assets are saved in./assetswithin the working directory.
- Naming Convention: Files use a prefix, tool name, timestamp, and unique ID (e.g.,2d_asset_generate_2d_asset_1698765432_abcd1234.png).
- Customization: Set a custom directory:

node src/index.js /path/to/custom/directory

TheModel Context Protocol (MCP)enables this tool to serve AI clients securely:

- Tools:generate_2d_asset,generate_3d_asset.
- Resources: Managed viaasset://URIs.
- Prompts:generate_2d_sprite,generate_3d_model.
- Compatibility: Works withClaude Desktopand other MCP clients.

- API Errors: Check network connectivity or rate limits; review./logs/server.log.
- Authentication Issues: VerifyHF_TOKENandMODEL_SPACEin.env.
- ES Modules Error: Ensure Node.js 16+ (node --version).
- Logs: Inspect detailed logs:

tail -f ./logs/server.log

- 2D Asset Generation: Uses"gokaygokay/Flux-2D-Game-Assets-LoRA"(50 steps).
- 3D Asset Image Generation: Uses"gokaygokay/Flux-Game-Assets-LoRA-v2"(30 steps).
- 3D Model Conversion:

- InstantMesh: Multi-step (/check_input_image,/preprocess,/generate_mvs,/make3d).
- Hunyuan3D-2: Single-step (/generation_all).
- Hunyuan3D-2mini-Turbo: Single-step (/generation_all) with turbo modes.

- Current Version: 0.3.0 (Added Hunyuan3D-2mini-Turbo support).
- MCP SDK Version: 1.7.0.
- Format: MAJOR.MINOR.PATCH (SemVer).

- Core File:src/index.js.
- Dependencies: Seepackage.json.
- Security: Zod validation, path traversal prevention, HTTPS support, rate limiting.
- Performance: Async processing, retry with backoff, GPU quota handling.

We welcome contributions! To participate:
- Fork the Repository: Create your copy on GitHub.
- Make Changes: Add features, fix bugs, or enhance docs.
- Submit a Pull Request: Detail your changes.
- Open Issues: Report bugs or suggest improvements.

Follow standard coding conventions and include tests where applicable.

Licensed under theMIT License. See theLICENSEfile for details.

This is a web browser that enables your coding agent, such as Claude Code, to visit websites on your behalf and assist you in identifying bugs or creating UI test cases.

MCP server for generating mock 2D PNG assets for Games prototypes

Generate storybook images for children's stories using Google's Gemini AI.

Generate high-quality images and vector graphics using the Replicate API.

Generate images using the Ideogram V3 Balanced model on Replicate.

Generate high-quality images using the Recraft V3 model via the Replicate API.

AI Video, Image & Audio Generation with over 150 models

Convert photos to LEGO-style brick mosaic previews with AI-powered color quantization. MCP server for Claude, Cursor, and other AI agents.

Hosted remote MCP server for AI image and video generation from one Streamable HTTP endpoint.

a specialised AI text remover for photos and graphics

BuildFloorPlan is an AI floor plan generator for homeowners, interior designers, builders, and small planning teams who need to move from rough input to a reviewable layout faster. It turns short briefs, sketches, images, and PDFs into clearer floor plan outputs in seconds, supports technical 2D layouts, colored presentation-ready plans, and quick 3D previews, and helps users compare layout directions before renovation, client presentation, or internal review. It is designed for fast first drafts, supports editing and refinement workflows, and does not require CAD experience. You can start free with starter credits, and paid plans add more credits, longer history, and commercial usage options.

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.