> ## Documentation Index
> Fetch the complete documentation index at: https://docs.img-processing.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Creation Methods

> The first step to start processing images with the IMG Processing API is to create an [Image Object](/sdk/image).

<ResponseField name="upload">
  Uploads a new image to the system from a file. This method is used to create a new Image object by uploading an
  image file.

  <CodeGroup>
    ```typescript node-sdk theme={null}
    upload(body: ImageUploadParams, options?: RequestOptions): APIPromise<ImageObject>;
    ```
  </CodeGroup>

  <Expandable title="uploadOptions">
    <ResponseField name="body" type="object" required>
      The body parameters for uploading an image.

      <Expandable title="ImageUploadParams">
        <ResponseField name="image" type="Uploadable" required>
          The image file to upload. It must be a valid image format (jpeg, png, webp) and not larger than
          20MB.
        </ResponseField>

        <ResponseField name="name" type="string" required>
          The name of the image to identify it on the dashboard.
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>

  <Expandable title="Examples">
    <CodeGroup>
      ```typescript node-sdk theme={null}
      import fs from 'fs';

      const imageObject = await client.images.upload({
          image: fs.createReadStream('path/to/file'),
          name: 'example-image',
      });
      ```
    </CodeGroup>
  </Expandable>
</ResponseField>

<ResponseField name="createFromURL">
  Creates a new image by downloading it from a URL. This method is used when you have an image hosted online and want
  to import it into the system.

  <CodeGroup>
    ```typescript node-sdk theme={null}
    createFromURL(body: ImageCreateFromURLParams, options?: RequestOptions): APIPromise<ImageObject>;
    ```
  </CodeGroup>

  <Expandable title="createFromURLOptions">
    <ResponseField name="body" type="object" required>
      The body parameters for creating an image from a URL.

      <Expandable title="ImageCreateFromURLParams">
        <ResponseField name="name" type="string" required>
          The name of the image to identify it on the dashboard.
        </ResponseField>

        <ResponseField name="url" type="string" required>
          The URL of the image to download. It must point to a supported image format (jpeg, png, webp).
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>

  <Expandable title="Examples">
    <CodeGroup>
      ```typescript node-sdk theme={null}
      const imageObject = await client.images.createFromURL({
          name: 'example-image',
          url: 'https://example.com/image.jpg',
      });
      ```
    </CodeGroup>
  </Expandable>
</ResponseField>

<ResponseField name="imagine">
  Generates a new image using AI based on a text prompt. This method allows you to create images from textual
  descriptions.

  <CodeGroup>
    ```typescript node-sdk theme={null}
    imagine(body: ImageImagineParams, options?: RequestOptions): APIPromise<ImageObject>;
    ```
  </CodeGroup>

  <Expandable title="imagineOptions">
    <ResponseField name="body" type="object" required>
      The body parameters for generating an image using AI.

      <Expandable title="ImageImagineParams">
        <ResponseField name="name" type="string" required>
          The name of the image to identify it on the dashboard.
        </ResponseField>

        <ResponseField name="prompt" type="string" required>
          The prompt for the image. It should describe what you want to see in the generated image.
        </ResponseField>

        <ResponseField name="model" type="string">
          The model to use for the image. If not provided, the default model will be used.
        </ResponseField>

        <ResponseField name="negative_prompt" type="string">
          The negative prompt for the image. It should describe what you don't want to see in the generated
          image.
        </ResponseField>

        <ResponseField name="seed" type="number">
          The seed for the image. It is used to generate the image. If not provided, a random seed will be
          used.
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>

  <Expandable title="Examples">
    <CodeGroup>
      ```typescript node-sdk theme={null}
      const imageObject = await client.images.imagine({
          name: 'example-image',
          prompt: 'A beautiful sunset over the ocean.',
      });
      ```
    </CodeGroup>
  </Expandable>
</ResponseField>
