File size: 1,825 Bytes
77783e7
ae49c06
77783e7
 
 
 
6e855de
77783e7
 
 
 
ae49c06
67b94be
a0ebe0e
67b94be
a0ebe0e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
67b94be
 
 
 
 
 
 
 
 
 
 
8859554
 
67b94be
 
 
 
 
 
 
 
 
8859554
 
 
 
 
 
 
 
 
 
 
 
 
67b94be
 
 
 
 
8859554
67b94be
8859554
67b94be
 
 
 
 
 
 
 
 
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
---
title: Prompt Craft
emoji: 😍
colorFrom: red
colorTo: yellow
sdk: gradio
sdk_version: "5.12.0"
app_file: app.py
pinned: false
---

# Prompt Craft

## Overview

This project leverages HuggingFace's `smolagent` library to create AI-generated images through a streamlined workflow.

## Technology Stack

- **Agent Framework**: Uses HuggingFace's `smolagent` with `Tool.from_space` implementation
- **Image Generation**: Powered by the `FLUX.1-schnell` model
- **Prompt Enhancement**: Utilizes `Qwen/Qwen2.5-Coder-32B-Instruct` model via HuggingFace Inference API

## How It Works

1. User provides an initial image prompt
2. The Qwen model enhances the prompt for better results
3. FLUX.1-schnell generates the final image based on the improved prompt

## Links

- [HuggingFace Smolagent Documentation](https://huggingface.co/docs/smolagents/main/en/index)
- [Qwen 2.5 Model](https://huggingface.co/Qwen/Qwen2.5-Coder-32B-Instruct)

## Prerequisites

- Python 3.x
- pip

## Setup

1. Clone the repository:

   ```sh
   git clone https://github.com/tebinraouf/agenticai_examples.git
   cd agenticai_examples
   ```

2. Create a virtual environment:

   ```sh
   python3 -m venv venv
   source venv/bin/activate  # On Windows use `venv\Scripts\activate`
   ```

3. Create a `.env` file in the root directory of the project and add your environment variables:

   ```sh
   touch .env
   ```

   Example `.env` file:

   ```
   HF_TOKEN=your_api_key_here
   ```

4. Install the dependencies:

   ```sh
   pip install -r requirements.txt
   ```

5. Run the project:
   ```sh
   python app.py
   ```

## Contributing

Please read `CONTRIBUTING.md` for details on our code of conduct, and the process for submitting pull requests.

## License

This project is licensed under the MIT License - see the `LICENSE` file for details.