Member Junction
    Preparing search index...

    Action that generates images using AI image generation models (DALL-E, Gemini, etc.)

    // Generate a simple image
    await runAction({
    ActionName: 'Generate Image',
    Params: [{
    Name: 'Prompt',
    Value: 'A serene mountain landscape at sunset with snow-capped peaks'
    }]
    });

    // Generate with specific model and size
    await runAction({
    ActionName: 'Generate Image',
    Params: [{
    Name: 'Prompt',
    Value: 'A futuristic cityscape with flying vehicles'
    }, {
    Name: 'Model',
    Value: 'dall-e-3'
    }, {
    Name: 'Size',
    Value: '1792x1024'
    }, {
    Name: 'Quality',
    Value: 'hd'
    }]
    });

    // Generate multiple images
    await runAction({
    ActionName: 'Generate Image',
    Params: [{
    Name: 'Prompt',
    Value: 'Abstract art in vibrant colors'
    }, {
    Name: 'NumberOfImages',
    Value: 3
    }]
    });

    // Image-to-image editing (transform a source image)
    await runAction({
    ActionName: 'Generate Image',
    Params: [{
    Name: 'Prompt',
    Value: 'Transform this into a professional infographic with dark theme'
    }, {
    Name: 'SourceImage',
    Value: 'base64_encoded_image_or_url'
    }]
    });

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    Methods

    Constructors

    Properties

    AuthorizesCaller: boolean

    True when the action authorizes its caller itself, so a public entry point such as the RunAction mutation may run it for an authenticated user without an MJ: Action Authorizations link. Set it only on an action that either checks an authorization the caller must hold, or reads and writes only with the caller's own permissions. Leave it false for an action that acts with more authority than its caller, or that reaches data or sends messages the caller chooses but could not otherwise reach.

    The engine reads the marker only from the class that runs, never from its parent classes. A subclass that overrides a marked action must declare the marker again.

    Methods

    • Generates or edits image(s) using AI image generation models.

      When SourceImage is provided, performs image-to-image editing (style transfer, transformation). When SourceImage is not provided, performs text-to-image generation.

      Parameters

      • params: RunActionParams

        The action parameters containing:

        • Prompt: Text description of the image to generate or edit instructions (required)
        • Model: Model name/ID to use (optional, uses default if not specified)
        • NumberOfImages: Number of images to generate (optional, default: 1)
        • Size: Image size like "1024x1024" (optional)
        • Quality: Quality level - "standard" or "hd" (optional)
        • Style: Style preset - "vivid" or "natural" (optional)
        • NegativePrompt: Things to avoid in the image (optional)
        • OutputFormat: "base64" or "url" (optional, default: "base64")
        • SourceImage: Source image for image-to-image editing (optional, base64 or URL)
        • Mask: Mask image for inpainting - white/transparent areas are regenerated (optional)

      Returns Promise<ActionResultSimple>

      Generated or edited image(s) as base64 or URLs