-
Notifications
You must be signed in to change notification settings - Fork 902
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
base: main
Are you sure you want to change the base?
Feat/claude images mcp #3029
Changes from 8 commits
3ef2423
e9c86bf
ee0d881
b4cf099
b617e25
1eb5d75
4c10f42
bcf6699
da19a18
faa7d76
84e24dc
f1fee7e
7055d99
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
evalstate marked this conversation as resolved.
Show resolved
Hide resolved
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,91 @@ | ||||||
--- | ||||||
title: "Generate Images with Claude and Hugging Face" | ||||||
thumbnail: /blog/assets/generate-images-with-claude-and-mcp/thumbnail.png | ||||||
authors: | ||||||
- user: evalstate | ||||||
--- | ||||||
|
||||||
# Create Images with Claude and Hugging Face | ||||||
evalstate marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
||||||
> [!TIP] | ||||||
> **TL;DR:** Its 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 and including text. | ||||||
evalstate marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
||||||
## 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 using this way are: | ||||||
evalstate marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
- The AI can assist in building detailed prompts that may improve the output quality of generated images. | ||||||
evalstate marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
- The AI can "see" the generated images, then help iterate on designs and techniques to get perfect results. | ||||||
evalstate marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
||||||
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>Conneting Claude to Hugging Face</figcaption> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
</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 - providing free access to large, powerful models that are would normally be expensive to use. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Perhaps we could tone down "free" a bit saying that users have free credits to use ZeroGPU (and later on in the post we could recommend to upgrade to Pro to get more credits). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've tweaked this and think it reads better. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did you push it? I'm not sure I'm seeing the latest revisions. |
||||||
|
||||||
Confirm that that the Hugging Face tools are available from the "Search and tools" menu... and now we are ready to try some of the latest models. | ||||||
|
||||||
evalstate marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
## 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). | ||||||
evalstate marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
||||||
<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 try **Krea**, go to [`huggingface.co/mcp/settings`](https://huggingface.co/settings/mcp) and add `evalstate/flux1-krea` to your "Spaces Tools". This will add a tool named something similar to "`flux1_krea_dev_infer`" to Claude. This enables Claude to generate beautiful, realistic looking images. Note the precise name may vary slightly depending on your configuration. | ||||||
evalstate marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
||||||
<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"> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This video shows how to add Qwen, not Krea (even if Krea is a tool already added to the user's config) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. will cut a new video; will be less confusing. |
||||||
</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 creating images with 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 `evalstate/qwen-image` from your [MCP Servers setting](https://huggingface.co/settings/mcp) page, then check it is enabled in Claude to start using it. | ||||||
evalstate marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
||||||
You can even keep both enabled and ask Claude to use both and compare results for similar concepts - for example: "Use Krea and Qwen to generate a street scene with 'Hugging Face' graffiti sprayed on the wall". | ||||||
evalstate marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
||||||
|
||||||
<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> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
(would be cool to see results from both side by side, as introduced in the text) |
||||||
</figure> | ||||||
|
||||||
|
||||||
|
||||||
## Conclusion | ||||||
|
||||||
Connecting Claude to Hugging Face Spaces makes using state-of-the-art models on the day of release as easy as clicking a button. Explore the AI App Directory at [https://huggingface.co/spaces](https://huggingface.co/spaces) and build amazing things with [Video Generation](https://huggingface.co/spaces/evalstate/ltx-video-distilled), [Text Generation](https://huggingface.co/spaces/amd/gpt-oss-120b-chatbot), [Image Editing](https://huggingface.co/spaces/evalstate/FLUX.1-Kontext-Dev) and many thousands more. Let us know what you find and create in the comments below. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Is the AMD gpt-oss space compatible with MCP? |
||||||
|
||||||
With a Hugging Face account, it's simple to add new tools to Claude and use them straight away. | ||||||
evalstate marked this conversation as resolved.
Show resolved
Hide resolved
|
Uh oh!
There was an error while loading. Please reload this page.