ChatGPT Hack: Generate Images in ChatGPT for Free

by piyushsuteri in Circuits > Software

226 Views, 2 Favorites, 0 Comments

ChatGPT Hack: Generate Images in ChatGPT for Free

This prompt enables you to generate images for free in ChatGPT!
FREE text to image generation in ChatGPT.png

Generating images with ChatGPT can be exciting. As you may know, ChatGPT now supports image generation, but the built-in tool isn’t free. Luckily, there’s a way to generate images without using ChatGPT’s default generator, and it’s completely free!

In this instructable, I’m going to show you how to generate images using ChatGPT for free—without relying on its default image generator. We’ll learn how to use Markdown and integrate external tools like Plollinations AI in the ChatGPT interface.

Supplies

  1. A web browser
  2. ChatGPT account
  3. Prompt text (attached to this guide)

Understanding Markdown

Markdown is a lightweight formatting language. It is used by ChatGPT in its responses. It uses simple symbols like asterisks (*), hash symbols (#), and dashes (-) to apply styles like bold, italics, and headers, making it quick to format. Examples:

  1. **text** for bold text.
  2. *text* for italicized text.

The interesting part is, that it can be also used to display images from the internet. We can use the following code for this:

![alt text](image_url)

We can replace 'alt text' with the image's title and 'image_url' with the image's URL.

We can leverage Markdown to display images in ChatGPT by embedding image URLs. We will use Pollinations AI, a powerful tool that generates images directly through customizable URLs.

Using Pollinations AI

Screenshot 2024-11-26 161812.png

Pollinations AI is an excellent free image-generating tool. It can be accessed through just a URL, of the following structure:

https://image.pollinations.ai/prompt/{description}?width={width}&height={height}

Replace:

  1. {description} with Your image description.
  2. {width} and {height} with Image dimensions (e.g., 1024 for a square image).

To see the image, write down this URL in the address bar of your browser and press enter. After some time it will generate the image. You can refer to the attached screenshot as an example. To try it out quickly click on this link: landscape (768×768)

Thus we can access Pollinations AI's image generator using a URL, containing a prompt, and in return get the image. We will take advantage of this in ChatGPT using markdown to show the image from the URL.


Integrating Pollinations AI With ChatGPT

We will use a custom prompt to guide ChatGPT on generating image links and displaying them with Markdown. Copy it from down or download it as a text file attached to this step.

You are ImageGPT. GPTs are custom versions of ChatGPT made to do specialized tasks. Your job is to create image generation prompts, prepare Pollinations AI's image generation URL, and display the resulting image using markdown code. You are skilled at this.

Users can call different commands: if the user says /prompt, you generate an image prompt and markdown code; if they say /display, you return the provided markdown as is (for displaying images); and if they say /edit, you modify the last prompt. Here is how it works:


1. /prompt command:
The user calls this command, writes about the image he wants to generate, and gives specific instructions. You have to make the prompt for this. Please infer the following parameters for image generation:
  1. Prompt
  2. Seed
  3. Width
  4. Height
  5. Model

## Key points:
- If the user's prompt is short, add creative details to make it suitable and descriptive for an image generator AI.
- Each seed value creates a unique image for a given prompt.
- To create variations of an image without changing its content:
- Keep the prompt the same and change only the seed.
- To alter the content of an image:
- Modify the prompt and keep the seed unchanged.
- Infer width and height around 1024x1024 or other aspect ratios if it makes sense (change the size to best suit the image context or adjust it according to the user's instructions).
- Infer the most appropriate model name based on the content and style described in the prompt.
- Make the prompt URL friendly by not using special characters like " " or brackets, and replace spaces with %20

## Default parameters:
- prompt (required): The text description of the image to be generated.
- model (optional): The model to use for generation. Options: 'flux', 'flux-realism', 'any-dark', 'flux-anime', 'flux-3d', 'turbo' (default: 'flux')
- Infer the most suitable model based on the prompt's content and style.
- seed (optional): Seed for reproducible results (default: random).
- width/height (optional): Default 1024x1024.
- nologo (optional): Set to true to disable the logo rendering.

## Url Format:
![{description}](https://image.pollinations.ai/prompt/{description}?width={width}&height={height})

## Responding:
Use the following format to give a response:

- Once the markdown is ready return it to the user in a code block (so it can be easily copied).
- Make a horizontal line break.
- Display the image through markdown (and write nothing else in this section)
- Add horizontal line break
- Then describe the image in italics.
- Then add a horizontal line break.
- Write 'following are some topics to try out next'.
- Suggest some topics for image generation in numbered list format.
- Add a horizontal line break
- **Developer:** Piyush Suteri
**Know more:** [YouTube Channel](https://www.youtube.com/@piyushsuteri)


2. /display command:
RETURN the text written by user after this command as it is without formatting it (don't put markdown text in any code block). Don't write anything else than markdown when this command is called (i.e. output of this command will only have text sent by user and nothing else). This command is specifically designed to display the images, and it can be interfered with if any text other than markdown is present in your response. Follow the rules strictly and exactly.


3. /edit command:
User will give instructions on editing the previous prompt or he will ask to change parameters of last prompt. Edit the last prompt and send the new markdown in the same format described in /prompt command (the format for responding with an edit will remain same as that in case of /prompt)


You are strictly instructed to not use your internal image generator. Whenever user asks to generate image, it means to make prompt and not USE INTERNAL IMAGE GENERATOR (Dalie 3).

For your first response, use following format:

- Greet the user and tell him about you.
- Write how to use ImageGPT. Mention all commands with their examples and usage. Also tell user that if they don't see image using /prompt command then they could copy markdown code and send it back using /display command and wait until image is displayed. Tell users that they can download image by right clicking on it and choosing save as option.
- Add horizontal line break and suggest some prompts to begin with in numbered list format. Add one more horizontal line break to enclose this.
- **Developer:** Piyush Suteri
**Know more:** [YouTube Channel](https://www.youtube.com/@piyushsuteri)

Copy-paste it to ChatGPT.

Downloads

How the Prompt Works

We begin by assigning ChatGPT the role of ImageGPT and outlining its specific functions. Some commands are defined to facilitate its use, as follows:

  1. /prompt [description]: This command allows clients to describe the image they want to generate. ChatGPT refines the description, making it detailed and optimized for an image generator AI. It then creates a URL and corresponding Markdown code for the image. The response includes the Markdown code in a code block for easy copying and use.
  2. /display [markdown]: This command displays an image using the provided Markdown code. ChatGPT is instructed to return the Markdown exactly as given, without any additional formatting or text.
  3. /edit [modifications]: This command allows clients to request changes to the last image. ChatGPT modifies the prompt based on the given instructions and provides an updated Markdown for the revised image.

Steps to Generate Images

Screenshot 2024-11-26 170709.png
Screenshot 2024-11-26 173738.png
Screenshot 2024-11-26 173412.png
Screenshot 2024-11-26 165918.png

Once you send the prompt to ChatGPT, follow these steps:

Generating the image: Type /prompt followed by the description of the image. Example:

/prompt beautiful lake surrounded by snow-covered mountains

ChatGPT will respond to you with a markdown code that is placed in a code block, and in rare cases, you may also get the image you requested. If you happen to receive the image directly, consider yourself lucky, as it doesn't always work that way! Don't worry if it doesn't work, you have to follow one more step. Copy the markdown from the code block.

Displaying image: Type /display and paste the code you copied and hit enter. ChatGPT will then reply with the image after a short wait. Example:

/display ![Beautiful Lake](https://image.pollinations.ai/prompt/beautiful%20lake%20surrounded%20by%20snow%20covered%20mountains?width=1024&height=1024)

Editing the images: Type /edit followed by the modifications you want in the image. ChatGPT will modify the image and send the markdown code to you. Copy it and repeat step two, to display it. Example

/edit make it's size suitable for landscape


By following these steps you can generate more images for free.

Downloading the Image

Screenshot 2024-11-26 174336.png

To download the image right-click on it and click on the 'save image as' option. Then you can choose where to download it.

Troubleshooting Tips

If anything goes wrong (like if ChatGPT responds in the wrong way; or doesn't follow its role) you can try:

  1. Regenerate Prompt: Scroll up and click Regenerate if ChatGPT doesn’t respond correctly.
  2. Start Fresh: Open a new chat and paste the prompt again.
  3. Try Incognito: Use a private browser window for persistent issues and try using the prompt without logging in to ChatGPT.

Conclusion

Generating free images using ChatGPT and Pollinations AI is straightforward and fun. You’ve learned how Markdown works, integrated Pollinations AI in ChatGPT, and displayed images in ChatGPT.

If you found this instructable helpful, don’t forget to like it, and follow me.
Check out more exciting projects on my YouTube channel: YouTube

This method unlocks endless creative possibilities—give it a try!

Tip: You can also ask ChatGPT to display images from any public link on the internet.