DEV Community

Cover image for Design Memorable Logos with Lyzr's Logo Generator
Prajjwal Sule
Prajjwal Sule

Posted on

Design Memorable Logos with Lyzr's Logo Generator

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.


Welcome to Lyzr! | Lyzr Documentation

Explore the limitless possibilities of Generative AI with Lyzr, an enterprise alternative to popular Generative AI SaaS products. Lyzr offers a robust and secure solution for building and launching your own enterprise-grade Generative AI applications with speed and confidence.

favicon docs.lyzr.ai

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.

   git clone https://github.com/PrajjwalLyzr/Logo-Generator
Enter fullscreen mode Exit fullscreen mode

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

   python3 -m venv venv
   source venv/bin/activate
Enter fullscreen mode Exit fullscreen mode

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

   OPENAI_API_KEY = "Paste your openai api key here"
Enter fullscreen mode Exit fullscreen mode

Install Dependencies: Install the required dependencies.

   pip install lyzr-automata streamlit python-dotenv
Enter fullscreen mode Exit fullscreen mode

Structure

Logo-Generator


├── app.py

├── README.md

├── .gitignore

└── requirements.txt

Enter fullscreen mode Exit fullscreen mode

Core Components of the Logo Generator App

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

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

Enter fullscreen mode Exit fullscreen mode

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.

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('---')
Enter fullscreen mode Exit fullscreen mode

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

Top comments (0)

Some comments may only be visible to logged-in visitors. Sign in to view all comments.