Design Memorable Logos with Lyzr's Logo Generator
Tags: lyzrai, tutorial, python, beginners
Published: 2024-04-04 18:26:20

In today's competitive business landscape, a visually appealing and memorable logo is essential for establishing brand identity and attracting customers. Lyzr's Logo Generator offers an innovative solution to this challenge by harnessing the power of artificial intelligence to craft personalized logos tailored to users' specifications. In this article, we'll explore how this cutting-edge tool empowers businesses and individuals to create logos that reflect their unique identity and values.


Lyzr offers an agent-centric approach to rapidly developing LLM (Large Language Model) applications with minimal code and time investment. Even if you’re unfamiliar with the GenAI stack, Lyzr empowers you to build your AI applications effortlessly. It is the go-to solution for constructing GenAI apps without requiring an in-depth understanding of Generative AI.

---
{% embed https://docs.lyzr.ai/homepage?source=post_page-----9e347e0f18a1-------------------------------- %}
---

## Setting up the Project

To get started with Lyzr's Logo Generator, follow these steps:

**Clone the App**: Clone the Logo Generator app repository from GitHub.

   ```bash
   git clone https://github.com/PrajjwalLyzr/Logo-Generator
   ```

**Create a Virtual Environment**: Set up a virtual environment and activate it.

   ```bash
   python3 -m venv venv
   source venv/bin/activate
   ```

**Set Environment Variables**: Create a `.env` file and add your OpenAI API key.

   ```python
   OPENAI_API_KEY = "Paste your openai api key here"
   ```

**Install Dependencies**: Install the required dependencies.

   ```bash
   pip install lyzr-automata streamlit python-dotenv
   ```

## Structure

```scss
Logo-Generator
│
│
├── app.py
│
├── README.md
│
├── .gitignore
│
└── requirements.txt

```
## Core Components of the Logo Generator App

Let's explore the key components of Lyzr's Logo Generator app:

```python
import os
import streamlit as st
from lyzr_automata.ai_models.openai import OpenAIModel
from lyzr_automata import Agent, Task, Logger
from lyzr_automata.tasks.task_literals import InputType, OutputType
from lyzr_automata.pipelines.linear_sync_pipeline import LinearSyncPipeline
from dotenv import load_dotenv

load_dotenv()

API_KEY = os.getenv('OPENAI_API_KEY')

open_ai_model_image = OpenAIModel(
    api_key=API_KEY,
    parameters={
        "n": 1,
        "model": "dall-e-3",
    },
)

def logo_generator(user_specification):
   
    graphic_designer = Agent(
        prompt_persona="""As a seasoned Graphic Designer specializing in logo creation for brands, your mission is to visually communicate the essence and identity of each client through compelling and memorable designs. Leveraging your expertise in color theory, typography, and visual storytelling, you'll craft logos that resonate with target audiences and effectively represent the values and personality of each brand. Your goal is to create visually stunning and versatile logos that leave a lasting impression, elevating the presence and credibility of the brands you collaborate with.""",
        role="Graphic Designer",
    )


    logo_generator_image = Task(
        name="Logo Generation",
        agent=graphic_designer,
        output_type=OutputType.IMAGE,
        input_type=InputType.TEXT,
        model=open_ai_model_image,
        log_output=True,
        instructions="Generate an Image which is suitable to the given description. Capture every detail. Minimalistic style. [IMPORTANT!] Avoid any text or numbers in the image.",
        default_input=user_specification
    )


    logo_generator_image_innovative = Task(
        name="Logo Generation",
        agent=graphic_designer,
        output_type=OutputType.IMAGE,
        input_type=InputType.TEXT,
        model=open_ai_model_image,
        log_output=True,
        instructions="Generate a fresh logo concept to the given description. Minimalistic style. [IMPORTANT!] Avoid any text or numbers in the image.",
        default_input=user_specification
    )


    logo_generator_image_dynamic = Task(
        name="Logo Generation",
        agent=graphic_designer,
        output_type=OutputType.IMAGE,
        input_type=InputType.TEXT,
        model=open_ai_model_image,
        log_output=True,
        instructions="Generate a dynamic logo to the given description. Minimalistic style. [IMPORTANT!] Avoid any text or numbers in the image.",
        default_input=user_specification
    )


    logo_generator_image_luxury = Task(
        name="Logo Generation",
        agent=graphic_designer,
        output_type=OutputType.IMAGE,
        input_type=InputType.TEXT,
        model=open_ai_model_image,
        log_output=True,
        instructions="Generate a luxury standout logo to the given description. Minimalistic style. [IMPORTANT!] Avoid any text or numbers in the image.",
        default_input=user_specification
    )


    logger = Logger()


    main_output = LinearSyncPipeline(
        logger=logger,
        name="Logo Generator",
        completion_message="App Generated logo's!",
        tasks=[
            logo_generator_image,
            logo_generator_image_innovative,
            logo_generator_image_dynamic,
            logo_generator_image_luxury
        ],
    ).run()


    return main_output

```

## Initializing the Application

The entry point of the Logo Generator application prompts the user to input details about their business and the desired logo. Upon clicking the submit button, the `logo_generator` function is invoked with the user's input as the specification for logo generation. The generated logos are then displayed in a visually appealing manner.

```python
if __name__ == "__main__":
    user_input = st.text_area("What kind of Business do you have?, Write about logo!")

    button=st.button('Submit')
    if (button==True):
        generated_output = logo_generator(user_specification=user_input)

        col1, col2 = st.columns(2)

        with col1:
            image_file_name = generated_output[0]['task_output'].local_file_path
            st.subheader("Logo")
            st.image(image_file_name, caption='Logo Generator - Lyzr')
            st.markdown('---')

            st.subheader('Innovative Logo')
            second_image_file_name = generated_output[1]['task_output'].local_file_path
            st.image(second_image_file_name, caption='Logo Generator - Lyzr')
            st.markdown('---')
        
        with col2:
            st.subheader('Dynamic Logo')
            fourth_image_file_name = generated_output[2]['task_output'].local_file_path
            st.image(fourth_image_file_name, caption='Logo Generator - Lyzr')
            st.markdown('---')

            st.subheader('Luxury Logo')
            fifth_image_file_name = generated_output[3]['task_output'].local_file_path
            st.image(fifth_image_file_name, caption='Logo Generator - Lyzr')
            st.markdown('---')
```

## Conclusion

Lyzr's Logo Generator, businesses and individuals can effortlessly create visually stunning and versatile logos that leave a lasting impression. Embrace the power of artificial intelligence to craft logos that effectively represent your brand's identity and values.

### References

- [Logo Generator GitHub Repository](https://github.com/PrajjwalLyzr/Logo-Generator)
- [Lyzr Website](https://www.lyzr.ai/)
- [Book a Demo](https://www.lyzr.ai/book-demo/)
- Lyzr Community Channels: [Discord](https://discord.gg/nm7zSyEFA2), [Slack](https://join.slack.com/t/genaiforenterprise/shared_invite/zt-2a7fr38f7-_QDOY1W1WSlSiYNAEncLGw)