Featured image of post AI Tips, Generate Images with Local DeepSeek Too

AI Tips, Generate Images with Local DeepSeek Too

We all know that DeepSeek is a text model and has no ability to generate images. Meanwhile, the various online image-generation AIs are either paid or subject to quota limits. Here I would like to share with you a completely free AI image-generation trick using a locally deployed DeepSeek.

The AI Image Generation API

DeepSeek itself certainly cannot generate images at present, but GitHub, that treasure trove, is naturally full of surprises. The image-generation tool introduced in this article comes from a German AI startup and supports text-to-image, text-to-audio, and other functions.

Introduction to pollinations.ai

This project supports image generation through a basic Restful API interface.

Open-source project address:

https://github.com/pollinations/pollinations

Official website:

https://pollinations.ai/

The official website may be plain, but it requires no registration or keys, is open source and free—simply wonderful.

API Definition

The API for generating images is the most basic get method:

1
GET https://image.pollinations.ai/prompt/{prompt}

Parameters supported by the API:

ParameterRequiredDescriptionDefault
promptYesImage generation prompt
modelNoImage generation model usedflux
seedNoRandom seed
widthNoImage width (pixels)1024
heightNoImage height (pixels)1024
nologoNoWhether to keep the pollinations logofalse
privateNoWhether to make the generated image publicfalse
enhanceNoWhether to use an LLM to enhance the promptfalse
safeNoAdult contentfalse
transparentNoTransparent background (only effective for the gptimage model).false

List of supported models:

  • flux (base model)
  • flux-pro (enhanced effect)
  • flux-realism (realistic style)
  • flux-anime (anime style)
  • flux-3d (3D style)
  • flux-cablyai (unknown)
  • turbo (fast generation)

The http get method can actually be requested and rendered directly through html, which gives us the opportunity to complete image generation based on DeepSeek. In other words, we can define rules that let DeepSeek generate the required prompt and present the image generated by the pollinations api in html according to the HTML format.

Local DeepSeek and cherry studio Configuration

The method of deploying DeepSeek locally via Ollama and interacting with it through cherry studio was described in detail in a previous article [], so I will not repeat it here.

After running the DeepSeek model locally, for example deepseek-r1:14b, open cherry studio, add a role such as Image Generation Assistant, and set its system prompt to define the relevant rules (see the end of the article for the specific prompt).

Next, let’s test it by entering the following in cherry studio:

1
Autumn, at the foot of an ancient city wall, a clump of wild grass swaying in the wind, anime style, 16:9

After some thinking, DeepSeek successfully generated a Picture of Autumn Grass Beneath the City Wall.

Give it a try, everyone~~

Appendix:

Prompt rule-setting template:

 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
#Role: You are a professional image creation assistant.

#Skills: Based on a simple description entered by the user, generate a "detailed description" of a complete picture.

#Rules:
1. Insert the simple description entered by the user into the {user_prompt} part of [Output].
2. Make the generated "detailed description" as comprehensive and rich in detail as possible, supplementing it from a professional image-generation perspective with aspects such as lighting, composition, materials, viewpoint, color, and rendering method.
3. Insert the "detailed description" into the {ai_chinese_prompt} part of [Output].
4. Translate the "detailed description" completely and accurately into English, and insert it into the {ai_english_prompt} part of [Output].
5. If the user's description contains height information, insert it directly into the {width} part of [Output]; otherwise insert the default value 1280.
6. If the user's description contains width information, insert it directly into the {height} part of [Output]; otherwise insert the default value 1280.
7. If a ratio appears, it means width:height, with the width defaulting to 1280; calculate the height from the ratio and insert it into the {height} part of [Output].
8. Randomly generate an integer and insert it into the {seed} part of [Output].
9. Select the corresponding model based on the user's description of the picture style. If the user has not specified one, randomly choose a model from the 7 models below and insert it into the {model} part of [Output].
- `flux` (base model)
- `flux-pro` (enhanced effect)
- `flux-realism` (realistic style)
- `flux-anime` (anime style)
- `flux-3d` (3D style)
- `flux-cablyai` (unknown)
- `turbo` (fast generation)
10. Render the output result directly; do not display it as a code block.

#Output:
<html>
  <title>Image Generator</title>
  <body>
    <h2>{ai_chinese_prompt}</h2>
    <h4>{ai_english_prompt}</h4>
    <img 
      src="https://image.pollinations.ai/prompt/{ai_english_prompt}?width={width}&height={height}&seed={seed}&enhance=true&private=true&nologo=true&safe=false&model={model}" 
      alt="{user_prompt}"
    />
  </body>
</html>
Built with Hugo
Theme Stack designed by Jimmy