-
Notifications
You must be signed in to change notification settings - Fork 903
Feat/claude images mcp #3029
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Feat/claude images mcp #3029
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
3ef2423
first commit
evalstate e9c86bf
interim commit
evalstate ee0d881
interim commit
evalstate b4cf099
thumbnail, instruct videos. sample prompt
evalstate b617e25
prep draft
evalstate 1eb5d75
prep PR
evalstate 4c10f42
updates!
evalstate bcf6699
updates
evalstate da19a18
latest
evalstate faa7d76
update to use mcp-tools org spaces
evalstate 84e24dc
add instruction following description for qwen, mcp-tools
evalstate f1fee7e
fix yaml
evalstate 7055d99
prompt vs instruction
evalstate 6715287
add qwen prompt enhancer
evalstate 0372558
make thumbnail match title
evalstate f8adf3a
fix typo
evalstate c12331b
Merge branch 'main' into feat/claude-images-mcp
evalstate File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
--- | ||
title: "Generate Images with Claude and Hugging Face" | ||
thumbnail: /blog/assets/claude-and-mcp/thumbnail.png | ||
authors: | ||
- user: evalstate | ||
--- | ||
|
||
# Generate Images with Claude and Hugging Face | ||
|
||
> [!TIP] | ||
> **TL;DR:** It's easier than ever to generate detailed pictures with state-of-the-art AI models by connecting Claude to Hugging Face Spaces. This article describes how and why, and introduces recently launched models which excel at producing natural images or images that include text. | ||
|
||
## Introduction | ||
|
||
Recent advances in image generation models have improved their ability to produce realistic outputs and incorporate high quality text. It's easier than ever to use these models by connecting them directly to Claude. | ||
|
||
The advantages of generating pictures this way are: | ||
- The AI can assist in building detailed prompts that may improve the quality of generated images. | ||
- The AI can "see" the generated images, then help iterate on designs and techniques to get perfect results. | ||
linoytsaban marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- You can easily swap in the latest models or the one best suited for your needs. | ||
|
||
To get started, create a free [Hugging Face account](https://huggingface.co/join), then connect Claude from its "Search and tools" menu in the chat input box. The video below shows the exact steps needed: | ||
|
||
<figure class="image flex flex-col items-center text-center m-0 w-full"> | ||
<video | ||
alt="claude-auth-flow.mp4" | ||
autoplay loop autobuffer muted playsinline | ||
> | ||
<source src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/claude-images-mcp/claude-auth-flow.mp4" type="video/mp4"> | ||
</video> | ||
<figcaption>Connecting Claude to Hugging Face</figcaption> | ||
</figure> | ||
|
||
Behind the scenes Claude is now set up to use tools from the [Hugging Face MCP Server](https://huggingface.co/mcp?login), seamlessly extending it's capabilities. This includes the latest AI Applications running on our innovative [ZeroGPU](https://huggingface.co/docs/hub/spaces-zerogpu) powered Spaces. Your Hugging Face account provides free credits to use these large, powerful models. | ||
|
||
After Claude has been connected with Hugging Face, we'll show how to configure image generation tools that Claude can use. | ||
|
||
## Natural Images with Flux.1 Krea Dev | ||
|
||
[FLUX.1 Krea [dev]](https://huggingface.co/black-forest-labs/FLUX.1-Krea-dev) aims to eliminate the telltale "AI look" that often plague generated images - for example plastic skin, oversaturated colors, or overly smooth textures. If you want images that look like they were shot by a professional photographer rather than generated by a computer, Krea delivers the realistic textures, natural lighting, and authentic aesthetics that other AI models struggle with. You can read more about how they did this [on their blog](https://www.krea.ai/blog/flux-krea-open-source-release). | ||
|
||
<figure class="image text-center"> | ||
<img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/claude-images-mcp/bfl_krea_image_wide.avif" alt="Examples from Krea"> | ||
<figcaption>Examples from the Krea Image Generator</figcaption> | ||
</figure> | ||
|
||
To use **Krea** with Claude, go to [`huggingface.co/mcp/settings`](https://huggingface.co/settings/mcp) and add `mcp-tools/FLUX.1-Krea-dev` to your "Spaces Tools". That's all you need to enable Claude to generate beautiful, realistic looking images. | ||
|
||
<figure class="image flex flex-col items-center text-center m-0 w-full"> | ||
<video | ||
alt="adding-mcp-space.mp4" | ||
autoplay loop autobuffer muted playsinline | ||
> | ||
<source src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/claude-images-mcp/adding-mcp-space.mp4" type="video/mp4"> | ||
</video> | ||
<figcaption>Adding a Space in <a href='https://huggingface.co/settings/mcp'>MCP Settings</a></figcaption> | ||
</figure> | ||
|
||
|
||
You can then try a prompt in Claude like: | ||
|
||
> "Use Krea to create an image of a vibrant garden with victorian house". | ||
|
||
To begin generating pictures. | ||
|
||
## Qwen Image | ||
|
||
[Qwen-Image](https://huggingface.co/Qwen/Qwen-Image) is a powerful AI image generator that excels at following prompts and accurate text rendering, making it ideal for designing posters, signs, infographics, and marketing materials where text quality matters. Read more about the Qwen-Image model from their [blog post](https://qwenlm.github.io/blog/qwen-image/). | ||
|
||
<figure class="image text-center"> | ||
<img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/claude-images-mcp/qwen_sample.jpg" alt="Examples from Qwen"> | ||
<figcaption>Examples from the Qwen-Image Generator</figcaption> | ||
</figure> | ||
|
||
To use **Qwen-Image** add `mcp-tools/qwen-image` from your [MCP Servers setting](https://huggingface.co/settings/mcp) page, then check it is enabled in Claude to start using it. | ||
|
||
Qwen-Image comes with a Prompt Enhancer that helps write detailed prompts suitable for it. To try it, select "Qwen Prompt Enhancer" from the prompts menu and enter your idea before submitting it to Claude. | ||
|
||
<figure class="image flex flex-col items-center text-center m-0 w-full"> | ||
<video | ||
alt="qwen_image_prompt.mp4" | ||
autoplay loop autobuffer muted playsinline | ||
> | ||
<source src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/claude-images-mcp/qwen_image_prompt.mp4" type="video/mp4"> | ||
</video> | ||
<figcaption>Using the Qwen Prompt Enhancer from Claude</a></figcaption> | ||
</figure> | ||
|
||
You can even keep both Krea and Qwen-Image enabled and ask Claude to use both so you can compare results. For example: "Use Krea and Qwen to generate a street scene with 'Hugging Face' graffiti sprayed on the wall". | ||
|
||
<figure class="image text-center"> | ||
<img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/claude-images-mcp/krea_hf_example.webp" alt="Hugging Face Graffiti Street Scene"> | ||
<figcaption>Hugging Face Graffiti Street Scene</figcaption> | ||
</figure> | ||
|
||
|
||
## Conclusion | ||
|
||
Connecting Claude to Hugging Face Spaces makes using state-of-the-art models as easy as clicking a button, even the day new models are released. Explore the AI App Directory at [https://huggingface.co/spaces](https://huggingface.co/spaces) and build amazing projects with [Video Generation](https://huggingface.co/spaces/Lightricks/ltx-video-distilled), [Web Search](https://huggingface.co/spaces/victor/websearch), [Image Editing](https://huggingface.co/spaces/mcp-tools/FLUX.1-Kontext-Dev) and many thousands more. With a [Pro account](https://huggingface.co/pro) you get increased usage limits and more. Let us know what you find and create in the comments below! |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.