Spaces:
Running on Zero
Running on Zero
Maikeu Locatelli
Update SDK version to 6.1.0 in README and requirements.txt to prevent mismatch with HF Spaces. Enhance image handling in model_handler.py to sanitize metadata from providers, improving compatibility with Gradio.
49d3665 A newer version of the Gradio SDK is available: 6.22.0
metadata
title: Gokaygokay Flux Seamless Texture LoRA
emoji: ⚡
colorFrom: purple
colorTo: blue
sdk: gradio
sdk_version: 6.1.0
app_file: app.py
pinned: false
Flux Seamless Texture LoRA
Generate seamless textures using the Flux LoRA model. This Space provides a modern interface with advanced controls, presets, batch generation, gallery, and MCP (Model Context Protocol) integration.
Features
- 🎨 Advanced Generation Controls: Fine-tune guidance scale, steps, seed, dimensions, and more
- 🎯 Presets: Pre-configured settings for common texture types (wood, fabric, metal, stone, etc.)
- 📦 Batch Generation: Generate multiple textures at once with progress tracking
- 🖼️ Gallery: View and download all generated textures
- 📜 History: Track and reuse previous generation parameters
- 🔌 MCP Integration: Access via Model Context Protocol for AI tool integration
- 🎨 Modern UI: Clean, responsive interface built with Gradio 6
Quick Start
- Enter a prompt describing the texture you want
- Adjust parameters or select a preset
- Click "Generate" to create your texture
- View results in the Gallery tab
- Access history in the History tab
Usage
Basic Generation
- Go to the Generate tab
- Enter your prompt (e.g., "seamless wood texture, natural grain")
- Optionally select a preset from the dropdown
- Adjust parameters as needed:
- Guidance Scale: Controls how closely the model follows the prompt (1-20)
- Inference Steps: Number of denoising steps (10-100)
- Seed: Random seed for reproducibility (-1 for random)
- Width/Height: Image dimensions (must be multiples of 8)
- Click Generate
Using Presets
Select a preset from the dropdown to automatically apply optimized settings:
- Wood Texture
- Fabric Texture
- Metal Texture
- Stone Texture
- Brick Texture
- Leather Texture
- Concrete Texture
- Marble Texture
Batch Generation
- Go to the Batch Generate tab
- Enter multiple prompts, one per line
- Set common parameters
- Click Generate Batch
- Monitor progress and view results
Gallery
- View all generated textures in a grid
- Click Refresh Gallery to update
- Download all images as a ZIP file
History
- View generation history with timestamps
- Reuse parameters from previous generations
- Export history data
MCP Integration
This Space supports Model Context Protocol (MCP) for integration with AI tools.
Configuration
See docs/MCP.md for detailed setup instructions.
Quick Setup:
- Add to your MCP client configuration:
{
"mcpServers": {
"flux-texture-lora": {
"url": "https://huggingface.co/spaces/gokaygokay/Flux-Seamless-Texture-LoRA/gradio_api/mcp/",
"type": "http"
}
}
}
- Restart your MCP client
- Use tools like
generate_texture,get_presets, etc.
Available MCP Tools
generate_texture- Generate a texture with parametersgenerate_batch_textures- Generate multiple texturesget_presets- List available presetsget_history- Get generation historydownload_image- Get image information
See docs/MCP.md for complete documentation.
Parameters
Generation Parameters
- Prompt: Text description of the desired texture
- Negative Prompt: What to avoid in generation
- Guidance Scale (1-20): How closely to follow the prompt
- Inference Steps (10-100): Number of denoising steps
- Seed (-1 or positive): Random seed for reproducibility
- Width/Height (256-2048, multiple of 8): Image dimensions
- CFG Scale (1-20): Classifier-free guidance scale
- LoRA Strength (0-2): Strength of LoRA adaptation
Installation
Hugging Face Spaces (recomendado)
- Entry point:
app.py(já configurado no YAML do topo deste README). - Secrets: se o modelo for privado, adicione
HF_TOKENem Settings → Secrets do Space. - Storage: se você habilitar Persistent Storage, os arquivos gerados serão gravados em
/dataautomaticamente (fallback para o diretório do repo se/datanão existir). - Queue: o app roda com
queue()habilitado para suportar inferência demorada sem travar o servidor.
Desenvolvimento local (opcional)
- Clone the repository:
git clone https://huggingface.co/spaces/gokaygokay/Flux-Seamless-Texture-LoRA
cd Flux-Seamless-Texture-LoRA
- Install dependencies:
pip install -r requirements.txt
- Set up environment variables (optional):
cp .env.example .env
# Edit .env with your settings
- Run the application:
python app.py
Project Structure
.
├── app.py # Main Gradio application
├── requirements.txt # Python dependencies
├── config/
│ └── settings.py # Configuration settings
├── src/
│ ├── model_handler.py # Model management
│ ├── image_processor.py # Image processing
│ ├── presets.py # Texture presets
│ ├── utils.py # Utility functions
│ └── mcp_server.py # MCP server implementation
├── tests/ # Unit tests
├── docs/ # Documentation
└── assets/ # Assets and examples
Documentation
- API Documentation - Complete API reference
- MCP Integration - MCP setup and usage
- Gradio 6 Migration - Migration details
Development
Running Tests
pytest tests/
Code Style
- Type hints required
- Google-style docstrings
- Follow PEP 8
Troubleshooting
Common Issues
Generation fails:
- Check that dimensions are multiples of 8
- Verify prompt is not empty
- Ensure parameters are within valid ranges
MCP not working:
- Verify Space URL is correct
- Check that MCP is enabled
- Ensure client configuration is correct
Images not saving:
- Check write permissions
- Verify OUTPUT_DIR exists
- Check disk space
Contributing
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
License
See the repository for license information.
Acknowledgments
- Flux model by Black Forest Labs
- Gradio for the UI framework
- Hugging Face for hosting
Changelog
Version 2.0.0 (Current)
- ✅ Migrated to Gradio 6
- ✅ Added MCP integration
- ✅ Modernized UI with tabs
- ✅ Added batch generation
- ✅ Added gallery and history
- ✅ Added presets system
- ✅ Comprehensive documentation
Version 1.0.0
- Initial release with basic generation
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference