File size: 3,494 Bytes
f0d9a3e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
# MCP (Model Context Protocol) Integration

This Space is accessible via the Model Context Protocol, allowing integration with MCP clients like Cursor, Claude Desktop, and other compatible tools.

## Configuration

### For Claude Desktop

Add the following to your Claude Desktop MCP configuration file:

**macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
**Windows:** `%APPDATA%\Claude\claude_desktop_config.json`

```json
{
  "mcpServers": {
    "flux-texture-lora": {
      "url": "https://huggingface.co/spaces/gokaygokay/Flux-Seamless-Texture-LoRA/gradio_api/mcp/",
      "type": "http"
    }
  }
}
```

### For Cursor

Add to your Cursor MCP configuration:

```json
{
  "mcpServers": {
    "flux-texture-lora": {
      "url": "https://huggingface.co/spaces/gokaygokay/Flux-Seamless-Texture-LoRA/gradio_api/mcp/",
      "type": "http"
    }
  }
}
```

## Available Tools

### `generate_texture`

Generate a texture image with specified parameters.

**Parameters:**
- `prompt` (str): Text prompt for generation
- `negative_prompt` (str, optional): Negative prompt
- `guidance_scale` (float, optional): Guidance scale (default: 7.5)
- `num_inference_steps` (int, optional): Number of steps (default: 50)
- `seed` (int, optional): Random seed
- `width` (int, optional): Image width (default: 1024)
- `height` (int, optional): Image height (default: 1024)

**Returns:**
- `dict`: Contains `success`, `image_path`, `seed`, and `message`

### `generate_batch_textures`

Generate multiple textures in batch.

**Parameters:**
- `prompts` (List[str]): List of prompts
- `guidance_scale` (float, optional): Guidance scale
- `num_inference_steps` (int, optional): Number of steps

**Returns:**
- `dict`: Contains `success`, `total`, and `results` list

### `get_presets`

Get list of available presets.

**Returns:**
- `dict`: Contains `presets` list and `details` dictionary

### `get_history`

Get generation history.

**Parameters:**
- `limit` (int, optional): Maximum entries to return (default: 10)

**Returns:**
- `dict`: Contains `total` and `entries` list

### `download_image`

Get information about an image for download.

**Parameters:**
- `image_path` (str): Path to the image

**Returns:**
- `dict`: Contains `success`, `image_path`, and `metadata`

## Available Resources

### `presets://`

Access preset definitions as JSON.

**Example:**
```
presets://wood-texture
```

### `history://`

Access generation history as JSON.

**Example:**
```
history://recent
```

### `examples://`

Access example images information.

**Example:**
```
examples://list
```

## Usage Examples

### Using with Claude Desktop

1. Configure MCP in Claude Desktop settings
2. Restart Claude Desktop
3. Ask Claude to generate a texture:
   ```
   Generate a wood texture using the flux-texture-lora tool
   ```

### Using with Cursor

1. Configure MCP in Cursor settings
2. Use the MCP tools in your code:
   ```python
   # Cursor can now access the MCP tools
   # to generate textures programmatically
   ```

## Troubleshooting

### Connection Issues

- Verify the Space URL is correct
- Check that the Space is running
- Ensure MCP is enabled in the Space configuration

### Tool Errors

- Check parameter types and ranges
- Verify prompts are not empty
- Ensure image dimensions are multiples of 8

## API Endpoint

The MCP endpoint is available at:
```
/gradio_api/mcp/
```

Full URL:
```
https://huggingface.co/spaces/gokaygokay/Flux-Seamless-Texture-LoRA/gradio_api/mcp/
```