# Stable Diffusion with 6 fixed category

## Try it in the Widget Center

Click this [url](https://app.myshell.ai/robot-workshop/widget/1779862424125534208) to try this widget and copy the Pro Config template.

## Usage

Feeling too lazy to pick a model ID from Civitai? Give our pre-selected SD\&LORAS a try. Effortless version of Stable Diffusion with Civitai. Produce images across approximately 6 categories. Eliminates the need to select a model in Civitai. You have the freedom to adjust parameters like prompt, size, and more.

**Input Parameters**

<table><thead><tr><th>Name</th><th>Type</th><th>Description</th><th>Default</th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>category</td><td><code>string</code></td><td>Lazy to choose model id from civitai? try use our pre-picked sd&#x26;loras</td><td>Realistic &#x26; Photorealistic</td><td>true</td></tr><tr><td>prompt</td><td><code>string</code></td><td>The text prompt for image generation. Add lora? add `` to your prompt. `$id` is the series number and `$weight` is the lora weight you want (always set to 1.0). You can use multiple loras.</td><td></td><td>true</td></tr><tr><td>negative_prompt</td><td><code>string</code></td><td>The negative prompt for image generation.</td><td>(worst quality, low quality:1.4),(malformed hands:1.4),(poorly drawn hands:1.4),(mutated fingers:1.4),(extra limbs:1.35),(poorly drawn face:1.4),bad leg,strange leg, poor eyes, full screen of face</td><td>false</td></tr><tr><td>sampler</td><td><code>string</code></td><td>Sampler for diffusion model inference</td><td>DPM++ 2M Karras</td><td>false</td></tr><tr><td>height</td><td><code>integer</code></td><td>Height of the generated images</td><td>512</td><td>false</td></tr><tr><td>width</td><td><code>integer</code></td><td>Width of the generated images</td><td>512</td><td>false</td></tr><tr><td>steps</td><td><code>integer</code></td><td>Steps for sampler to step whle sampling</td><td>25</td><td>false</td></tr><tr><td>cfg_scale</td><td><code>number</code></td><td>Classifier Free Guidance Scale - how strongly the image should conform to prompt - lower values produce more creative results. Default to 7.</td><td>7.0</td><td>false</td></tr><tr><td>seed</td><td><code>integer</code></td><td>Random seed for generation process. -1 means random seed</td><td>-1</td><td>false</td></tr><tr><td>clip_skip</td><td><code>integer</code></td><td>Early stopping parameter for CLIP model; 1 is stop at last layer as usual, 2 is stop at penultimate layer, etc.</td><td>1</td><td>false</td></tr><tr><td>enable_hr</td><td><code>boolean</code></td><td>Enable the post-process high resolution. If it is set to false, please ignore the parameter with prefix `hr_`</td><td>False</td><td>false</td></tr><tr><td>hr_scale</td><td><code>integer</code></td><td>Improve the image quality by enlarging it in a way while maintains the original ratios. Default to 2. If `hr_height` or `hr_width` is set to a value other than zero, this parameter will not be applied.</td><td>2</td><td>false</td></tr><tr><td>hr_upscaler</td><td><code>string</code></td><td>The super resolution model used</td><td>ESRGAN_4x</td><td>false</td></tr><tr><td>hr_resize_x</td><td><code>integer</code></td><td>Resize width to, 0 means not defined. If x set to 0, and y is not 0, we will resize the length of image to y and change width accordingly. If x and y both not zero, use the max ratio max(hr_resize_x/image.width, hr_resize_y/image.height)</td><td>0</td><td>false</td></tr><tr><td>hr_resize_y</td><td><code>integer</code></td><td>Resize height to, 0 means not defined. If y set to 0, and x is not 0, we will resize the width of image to x and change width accordingly. If x and y both not zero, use the max ratio max(hr_resize_x/image.width, hr_resize_y/image.height)</td><td>0</td><td>false</td></tr><tr><td>hr_second_pass_steps</td><td><code>integer</code></td><td>Steps of sampling for second pass of diffusion model after hires. Set to 0 means the same steps as first pass.</td><td>0</td><td>false</td></tr><tr><td>hr_denoising_strength</td><td><code>number</code></td><td>Strength of image transfomation during hires transform. High means more influence during second pass sampling after hires</td><td>0.7</td><td>false</td></tr></tbody></table>

**Output Parameters**

| Name | Type     | Description                                                                                                  | File Type |
| ---- | -------- | ------------------------------------------------------------------------------------------------------------ | --------- |
| url  | `string` | The url of generated image, stored in the cloud. Only temporarily effective, will be cleared in a few hours. | `image`   |

**Output Example**

{% tabs %}
{% tab title="success" %}
{% code fullWidth="false" %}

```json
{
  "url": "https://image.myshell.ai/image/chat/embed_obj/40295/20240423/d828b567573141a29bdb0f44a33936c1.jpg"
}
```

{% endcode %}
{% endtab %}

{% tab title="fail" %}
{% code fullWidth="false" %}

```json
throw a Http error.
```

{% endcode %}
{% endtab %}
{% endtabs %}

## Detailed Guidelines

* Unique Parameter:
  * `category` : Feeling too lazy to pick a model ID from Civitai? Give our pre-selected SD\&LORAS a try.
    * Choose from `["Anime", "Realistic & Photorealistic", "Landscape", "Fantasy & Illustration", "3D & Cartoon", "Cute & Fantasy Characters"]`
