# Image Hub

Our Image Hub has two powerful tools: Text-to-Image and Image-to-Image.

## 1. Text-to-Image

It allows users to create high quality images. It is a fine-tuned version of [Stable Diffusion XL (SDXL)](https://stablediffusionxl.com/) model, and is optimized for generating comic style images.

This model was originally trained to generate the Skillful AI CyberCat NFT collection, which performs best with cartoon-style images. However, the model can be adapted for other styles with some experimentation.

<figure><img src="https://3620906879-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ft1TLw2CAY3Yjr54moPYE%2Fuploads%2FwH5ZPomualb4CZV50VqP%2Fimage.png?alt=media&#x26;token=2e34d7ed-08dd-45e3-9c72-cb6d0bad9b56" alt=""><figcaption></figcaption></figure>

### C**urrent Features**

* **History Section**: Users can view all previously generated images along with the prompts used. This feature helps users keep track of their creations and revisit past work.
* **Multiple Images:** Users can currently generate up to 4 images simultaneously from a single prompt.
* **Pricing:** At present, generating a single image costs 3 cents. For example, running one prompt with 4 variations will cost 12 cents.

### A**dvanced Customization Options**

**Inference Steps**

* It controls the number of steps the model takes during image generation.
* More Steps: Produces detailed and high-quality images but takes longer. Give more shadows, saturated colours and glossy effect. Works best for 3D character generations.
* Fewer Steps: Quicker generation but may result in simpler natural outputs. Sometimes, images may appear simplistic or overly smooth.
* Tip: Extreme values for inference steps or guidance scale may lead to overly saturated or distorted images. Start with middle ranges to balance detail and efficiency.

**Seed Number (1-1000):**&#x20;

* It ensures consistency or introduces variation in image outputs.
* Same Seed: Reproduces the exact image style every time.
* Different Seeds: Generates diverse styles.
* For instance, if you use the same seed (e.g., 75) and input the same prompt (e.g., "a elephant wearing sunglasses”), the resulting images will be identical for that seed.
* Seed feature is particularly useful for:
  * Consistency: Maintaining a uniform style across multiple images, such as creating a series featuring a animal, specific objects etc. in the same artistic style.
  * Variety: By changing the seed, you can explore different styles for the same subject.

**Guidance Scale:**&#x20;

* Adjusts how strictly the model follows the prompt.
* Higher Scale: Aligns more closely with the prompt, potentially reducing creativity.
* Lower Scale: Allows for more flexibility and imaginative results.
* Extremes in guidance scale might lead to unusual or broken images, especially if the prompt includes elements outside the system’s training scope.

**Comic Style Toggle**:&#x20;

* Activates the comic/cartoon effect. This is optimized for the model’s training style.

### How the Image Hub's Model Was Fine-Tuned?

The foundation of the Image Hub is Stable Diffusion XL (SDXL), an open-source model recognized for its exceptional image generation quality and flexible commercial licensing.&#x20;

We enhanced the model’s capabilities for **comic-style outputs** through a process of fine-tuning using LoRA (Low-Rank Adaptation). This allowed us to adapt the model without altering its original weights, while retaining memory efficiency and cost-effectiveness.

Using LoRA, we added extra layers (specialized learnable matrices) to the model that focused on the comic style, making it more efficient without using a lot of memory. The training was done using advanced NVIDIA L4 GPUs through Google Colab Pro, a cloud-based service. We used Hugging Face diffusers library and the Accelerate framework to manage resources.&#x20;

Through constant testing and improvements, the model was refined to generate high-quality comic-style images.

### 2. Image-to-Image

Skillful AI’s image editor lets you make targeted changes to any picture using simple controls. Just select the area you want to alter, pick the edit type, tweak a few settings, and generate the result.

1. **Mask Mode**

Defines which part of the image your edits will affect:

* **User Provided:** Paint your own mask to pinpoint exactly where changes happen.
* **Background:** AI detects and masks everything behind the main subject.
* **Foreground:** AI finds the primary subject and masks the rest so you can edit around it.

#### 2. Edit Mode

Select how Skillful AI handles the masked area:

* **Inpaint (Removal)**: Erase unwanted objects and fill the gap with matching detail.
* **Inpaint (Insertion)**: Add new elements inside the mask based on your text.
* **BGSwap**: Swap the background while keeping your subject unchanged.
* **Outpaint**: Expand the canvas, and let the AI generate the surrounding context.

#### 3. Basic Controls

* **Brush Size**: Slide to change how much area each mask stroke covers.
* **Prompt**: Describe what you want to add, remove, or modify (for example, “add a small cabin”).
* **Things to Avoid (optional)**: List any items you don’t want (for example, “no text or logos”).

#### 4. Advanced Settings

* **Guidance Scale**: Higher values force closer adherence to your prompt; lower values allow more natural variation.
* **Steps**: Number of passes the model takes. More steps sharpen details but take longer.
* **Dilation**: Expands the mask slightly for smoother edges.
* **Seed**: A fixed number guarantees the same result each time; random produces new variations.
