. === This plugin includes code based on WordPress. WordPress licensing and copyright information is included in ./license/wp-license.txt. */ class WpzAiImageLab { const VERSION = '0.1.1'; const KEY_ISSUE_URL = 'https://wpzone.co/connect-ai/?keyTarget=30037105'; const API_URL = 'https://api.aiimagelab.com/api.php'; const REQUESTS_BASE_URL = 'https://api.aiimagelab.com/get/'; const PROMPT_MODIFIERS = [ 'type' => [ 'label' => 'Type', 'values' => [ 'photo' => [ 'label' => 'Photo', 'sample-image' => 'type-photo.jpg', 'default' => true ], 'painting' => [ 'label' => 'Painting', 'sample-image' => 'type-painting.jpg' ], 'illustration' => [ 'label' => 'Illustration', 'sample-image' => 'type-illustration.jpg' ], 'pencil-drawing' => [ 'label' => 'Pencil Drawing', 'sample-image' => 'type-pencil-drawing.jpg' ], 'digital-art' => [ 'label' => 'Digital Art', 'sample-image' => 'type-digital-art.jpg' ], ], ], 'photo-lens' => [ 'label' => 'Camera Lens', 'values' => [ 'wide-angle' => [ 'label' => 'Wide Angle', 'sample-image' => 'lens-wide-angle.jpg', ], 'macro' => [ 'label' => 'Macro', 'sample-image' => 'lens-macro.jpg' ] ], 'showIfCondition' => 'type', 'showIfValue' => 'photo' ], 'photo-effect' => [ 'label' => 'Photo Effect', 'values' => [ 'grayscale' => [ 'label' => 'Grayscale', 'sample-image' => 'effect-grayscale.jpg', ], ], 'showIfCondition' => 'type', 'showIfValue' => 'photo' ], 'photo-lighting' => [ 'label' => 'Lighting', 'values' => [ 'other' => [ 'bioluminescent' => 'Bioluminescent', 'cinematic-lighting' => 'Cinematic Lighting', 'dark' => 'Dark', 'diffuse-lighting' => 'Diffuse Lighting', 'dramatic-lighting' => 'Dramatic Lighting', 'global-illumination' => 'Global Illumination', 'glowing-lights' => 'Glowing Lights', 'god-rays' => 'God Rays', 'hard-shadows' => 'Hard Shadows', 'long-exposure' => 'Long Exposure', 'luminescence' => 'Luminescence', 'natural-lighting' => 'Natural lighting', 'neon' => 'Neon', 'radiant-light-rays' => 'Radiant Light Rays', 'rim-lighting' => 'Rim Lighting', 'soft-box-lighting' => 'Soft Box Lighting', 'studio-lighting' => 'Studio Lighting', 'sunlight' => 'Sunlight', 'translucent' => 'Translucent', 'volumetric-lighting' => 'Volumetric Lighting' ] ], 'showIfCondition' => 'type', 'showIfValue' => 'photo', 'class'=> 'wpz-form-row' ], 'painting-style' => [ 'label' => 'Painting Style', 'values' => [ 'impressionism' => [ 'label' => 'Impressionism', 'sample-image' => 'painting-impressionism.jpg', ], 'expressionism' => [ 'label' => 'Expressionism', 'sample-image' => 'painting-expressionism.jpg', ], 'abstract' => [ 'label' => 'Abstract', 'sample-image' => 'painting-abstract.jpg', ], 'realistic' => [ 'label' => 'Realistic', 'sample-image' => 'painting-realistic.jpg', ], ], 'showIfCondition' => 'type', 'showIfValue' => 'painting' ], 'painting-medium' => [ 'label' => 'Painting Medium', 'values' => [ 'oil-on-canvas' => [ 'label' => 'Oil on Canvas', 'sample-image' => 'painting-oil-on-canvas.jpg', ], 'watercolor' => [ 'label' => 'Watercolor', 'sample-image' => 'painting-watercolor.jpg', ], 'graffiti' => [ 'label' => 'Graffiti', 'sample-image' => 'painting-graffiti.jpg', ], ], 'showIfCondition' => 'type', 'showIfValue' => 'painting' ], 'illustration-style' => [ 'label' => 'Illustration Style', 'values' => [ 'comic-book' => [ 'label' => 'Comic Book', 'sample-image' => 'illustration-comic-book.jpg', ], 'childrens-book' => [ 'label' => 'Children\'s Book', 'sample-image' => 'illustration-childrens-book.jpg', ], 'outline' => [ 'label' => 'Outline', 'sample-image' => 'illustration-outline.jpg', ], ], 'showIfCondition' => 'type', 'showIfValue' => 'illustration' ], 'pencil-drawing-style' => [ 'label' => 'Pencil Drawing Style', 'values' => [ 'comic-book' => [ 'label' => 'Monochrome', 'sample-image' => 'pencil-drawing-monochrome.jpg', ], 'pencil-crayon' => [ 'label' => 'Pencil Crayon', 'sample-image' => 'pencil-drawing-pencil-crayon.jpg', ], ], 'showIfCondition' => 'type', 'showIfValue' => 'pencil-drawing' ], 'digital-art-style' => [ 'label' => 'Digital Art Style', 'values' => [ '3d-render' => [ 'label' => '3D Render', 'sample-image' => 'digital-art-3d-render.jpg', ], '8-bit' => [ 'label' => '8-Bit', 'sample-image' => 'digital-art-8-bit.jpg', ], ], 'showIfCondition' => 'type', 'showIfValue' => 'digital-art' ], '3d-art-style' => [ 'label' => 'Advanced', 'values' => [ 'other' => [ 'dreamworks' => 'Disney Style', 'pixar' => 'Pixar Style', 'polygon-art' => 'Made with shapes and polygons' ] ], 'showIfCondition' => 'type', 'showIfValue' => 'digital-art', 'class' => 'wpz-form-row' ], 'artist' => [ 'label' => 'Artist', 'values' => [ 'other' => [ 'Brad-Rigney' => 'Brad Rigney - Dark, surreal fantasy landscapes', 'David-Cronenberg' => 'David Cronenberg - Realistic, cinematic character design', 'Dave-Rapoza' => 'Dave Rapoza - Body horror, sci-fi surrealism', 'Edwin-Deakin' => 'Edwin Deakin - Luminous, atmospheric California landscape', 'Frida-Kahlo' => 'Frida Kahlo - Intensely personal, surreal self-portraiture', 'Greg-Rutkowski' => 'Greg Rutkowski - Moody, ethereal fantasy environments', 'Henry-Asencio' => 'Henry Asencio - Dynamic, textured figurative painting', 'Huang-Guangjian' => 'Huang Guangjian - Colorful, playful pop art characters', 'Ilya-Kuvshinov' => 'Ilya Kuvshinov - Dreamy, anime-inspired digital portraits', 'Jackson-Pollock' => 'Jackson Pollock - Abstract expressionist drip painting', 'JB-Monge' => 'JB Monge - Whimsical, detailed fantasy creature design', 'John-Collier' => 'John Collier - Realistic, haunting figurative painting', 'John-Singer-Sargent' => 'John Singer Sargent - Elegant, impressionistic portrait painting', 'Josephine-Wall' => 'Josephine Wall - Mystical, romantic fantasy illustration', 'Kilian-Eng' => 'Kilian Eng - Retro-futuristic sci-fi digital art', 'Kim-Jung-Gi' => 'Kim Jung Gi - Hyper-detailed, surreal pen and ink drawings', 'Krenz-Cushart' => 'Krenz Cushart - Cute, whimsical character design', 'Milo-Manara' => 'Milo Manara - Sensual, erotic comic book art', 'Mort-Kunstler' => 'Mort Kunstler - Historical, narrative figurative painting', 'Otto-Dix' => 'Otto Dix - Expressionist, socially critical figurative painting', 'Pablo-Picasso' => 'Pablo Picasso - Inventive, groundbreaking modern art', 'Ross-Tran' => 'Ross Tran - Loose, expressive digital character sketches', 'russ-mills' => 'Russ Mills - Collage-like mixed media portrait art', 'Salvador-Dali' => 'Salvador Dali - Surrealist, dreamlike imagery', 'Stanley-Artgerm-Lau' => 'Stanley Artgerm Lau - Gorgeous, glamorous comic book covers', 'Takashi-Murakami' => 'Takashi Murakami - Colorful, playful pop art sculpture', 'Tooth-Wu' => 'Tooth Wu - Dynamic, stylized character illustration', 'Vincent-van-Gogh ' => 'Vincent van Gogh - Vibrant, emotional post-impressionist painting', 'Yoshitaka-Amano' => 'Yoshitaka Amano - Elaborate, ornate fantasy illustration', 'Zdzisław-Beksiński' => 'Zdzisław Beksiński -Dark, surreal gothic painting', ] ], 'class' => 'wpz-form-row' ], 'website' => [ 'label' => 'Website', 'values' => [ 'other' => [ 'ArtStation'=>'ArtStation - Digital concept art and 3D modeling', 'Behance'=>'Behance - Graphic design, branding, and typography', 'CGSociety'=>'DCGSociety - igital animation and visual effects', 'DeviantArt'=>'DeviantArt - Fan art, anime/manga, and surrealism', 'Dribbble'=>'Dribbble - UI/UX design and illustration', 'iStock'=>'iStock - Stock photography and vector illustrations', 'Pixabay'=>'Pixabay - Wide range of stock photos and videos', 'Pixiv'=>'Pixiv - Anime and manga fan art, illustrations', 'Zerochan'=>'Zerochan - Anime and manga fan art, illustrations', ] ], 'class' => 'wpz-form-row' ], 'color' => [ 'label' => 'Color', 'values' => [ 'other' => [ 'aesthetic' => 'Aesthetic', 'colorful' => 'Colorful', 'color-grading' => 'Color Grading', 'ektachrome' => 'Ektachrome', 'enamelled' => 'Enamelled', 'iridescent-accents' => 'Iridescent Accents', 'iridescent-gold' => 'Iridescent Gold', 'muted-colors' => 'Muted Colors', 'neon' => 'Neon', 'silver' => 'Silver', 'tone-mapping' => 'Tone Mapping', 'vibrant-color' => 'Vibrant Color', 'vintage' => 'Vintage', 'vivid' => 'Vivid', ] ], 'class' => 'wpz-form-row' ], ]; const SAMPLE_PROMPTS = [ 'snowy rocky mountains, low clouds', 'red car, city street, at night', 'a frog, on a lilypad, in a pond' ]; private $pluginUrl; function __construct() { $this->pluginUrl = plugin_dir_url(__FILE__); add_action('admin_menu', [$this, 'adminMenu']); add_action('post-upload-ui', [$this, 'uploadUi']); add_action('wp_enqueue_media', [$this, 'mediaScripts']); add_action('wp_ajax_wpz-ai-images-upload', [$this, 'ajaxUpload']); add_action('admin_enqueue_scripts', [$this, 'adminScripts']); } function mediaScripts() { wp_enqueue_script('wpz-ai-images-media', $this->pluginUrl.'js/media.js', ['jquery'], self::VERSION); wp_localize_script('wpz-ai-images-media', 'wpzAiImagesConfig', [ 'ajaxurl' => admin_url('admin-ajax.php') ]); wp_enqueue_style('wpz-ai-images-media', $this->pluginUrl.'css/media.css', null); } function adminScripts() { global $pagenow; wp_enqueue_style('wpz-ai-images-admin', $this->pluginUrl.'css/admin.css', null, self::VERSION); wp_enqueue_script('wpz-ai-images-admin', $this->pluginUrl.'js/admin.js', ['jquery'], self::VERSION); if (isset($pagenow) && $pagenow == 'media-new.php') { $this->mediaScripts(); } } function ajaxUpload() { if (empty($_POST['url']) || substr($_POST['url'], 0, strlen(self::REQUESTS_BASE_URL)) !== self::REQUESTS_BASE_URL) { status_header(400); exit; } $attachmentId = media_sideload_image(add_query_arg('key', get_option('wpz_ai_images_key'), $_POST['url']), isset($_POST['postId']) ? (int) $_POST['postId'] : 0, isset($_POST['prompt']) ? $_POST['prompt'] : null, 'id'); if (!is_wp_error($attachmentId)) { wp_send_json_success( wp_prepare_attachment_for_js( $attachmentId ) ); } } function adminMenu() { add_menu_page('AI Image Lab', 'AI Image Lab', 'manage_options', 'wpz-ai-images', [$this, 'adminPage'], '', 600); } function adminPage() { if (isset($_GET['wpzKey'])) { if ($_GET['wpzKey']) { update_option('wpz_ai_images_key', sanitize_key($_GET['wpzKey']), true); } else { delete_option('wpz_ai_images_key'); } } ?>

WP Zone logoAI Image Lab by WP Zone

Congratulations! You are ready to use AI Image Lab to generate images for your site.

Get Started

Visit the Media Library and click the Generate Image with AI button near the top of the page

– or –

Select the option to upload an image in the compatible content editor of your choice, such as the WordPress block editor or the Divi builder, and click the Generate Image with AI button in the image upload window

You have connected this site to the AI Image Lab service. If at anytime you need to reconnect to your AI Image Lab account, you can do so using the button below. This will redirect you to the WP Zone site.

Welcome to AI Image Lab!

To use The AI Image Lab service, you need to connect this site to your WP Zone account. Please review the terms of use below, then click the button below to initiate the connection process. This will redirect you to the WP Zone site where you can log in or create a free account.

Connect Disconnect

By connecting your site to AI Image Lab, or using the AI Image Lab service, you agree to be bound by the terms of use below.

Terms of Use

These terms of use govern your use of the WP Zone AI Image Lab service. You agree to be bound by these terms if you connect your site to or use the WP Zone AI Image Lab service. You are responsible for ensuring that all users of the service on your site comply with these terms.

Definitions

"WP Zone" and "us" refers to Aspen Grove Studios, LLC, dba WP Zone.

The "Terms" are the Terms of Use specified herein.

The "Service" is the WP Zone AI Image Lab service.

The "Model" is the model used by the Service to generate images when requests are made to the Service.

The "Software" is the AI Image Lab WordPress plugin published by WP Zone.

Disclaimer

To the extent permitted by applicable law, the Service is provided as-is, without any warranty, express or implied. Without limiting the foregoing, WP Zone makes no guarantees or representations as to the availability of the Service or the suitability of the output generated by the Service.

Our Use of Your Prompts and Images

By using the Service, you give us an irrevocable and perpetual license to use your text prompts, other image generation settings, and the images generated by the Service in connection with your requests, for the purposes of improving the Service and conducting research related to the Service. You acknowlede that you will not include any personally identifying information or other sensitive data in your prompt text.

Use Restrictions

You agree not to use the Service:

- In any way that violates applicable law or regulation;
- In any way that degrades the Service for other users due to the volume and/or content of requests you make to the Service;
- In any way that constitutes an attempt at unauthorized access to any system or server;
- In any way that results in an unauthorized use of the Model (see below);
- As part of an image generation service other than the Service;
- By any means other than the official Software, or such other access methods as may be made available by WP Zone from time to time

You agree not to use the Model or Derivatives of the Model:

- In any way that violates any applicable national, federal, state, local or international law or regulation;
- For the purpose of exploiting, harming or attempting to exploit or harm minors in any way;
- To generate or disseminate verifiably false information and/or content with the purpose of harming others;
- To generate or disseminate personal identifiable information that can be used to harm an individual;
- To defame, disparage or otherwise harass others;
- For fully automated decision making that adversely impacts an individual’s legal rights or otherwise creates or modifies a binding, enforceable obligation;
- For any use intended to or which has the effect of discriminating against or harming individuals or groups based on online or offline social behavior or known or predicted personal or personality characteristics;
- To exploit any of the vulnerabilities of a specific group of persons based on their age, social, physical or mental characteristics, in order to materially distort the behavior of a person pertaining to that group in a manner that causes or is likely to cause that person or another person physical or psychological harm;
- For any use intended to or which has the effect of discriminating against individuals or groups based on legally protected characteristics or categories;
- To provide medical advice and medical results interpretation;
- To generate or disseminate information for the purpose to be used for administration of justice, law enforcement, immigration or asylum processes, such as predicting an individual will commit fraud/crime commitment (e.g. by text profiling, drawing causal relationships between assertions made in documents, indiscriminate and arbitrarily-targeted use).

Modification

WP Zone reserves the right to modify these Terms at any time without notice. WP Zone may publish modified terms on its website and/or in updated versions of the Software. By using the Service, you agree to the most recently published version of the Terms.

To start using AI Image Lab for AI-based image generation, please follow the instructions on the AI Image Lab admin page to connect your site, then refresh this page!

$modifier) { foreach ($modifier['values'] as $value => $valueInfo) { if (!empty($valueInfo['default'])) { $defaultValues[$category] = $value; break; } } } ?>

AI Image Lab

Describe Image

Prompt Priority

Need Inspiration?

Style

$modifier) { $className = 'wpz-ai-prompt-modifier'; isset( $modifier['class']) ? $className .= ' ' . $modifier['class'] : ''; ?>
data-show-condition="" data-show-value="" class="">

    $valueInfo) { ?>
  • 1) { ?>
  • >
    <?php echo(esc_attr(sprintf('%s sample image', $valueInfo['label']))); ?>

Generated Images

Exclamation mark icon
Unfortunately, this is taking longer than expected.

We aim to have your first image preview complete within 30 seconds of your request, but in case our servers are extra busy right now, please wait for at least a minute before trying again.

If you are still not able to generate your images after a second attempt, you may be encountering one of the following situations:

  • AI Image Lab is super popular right now! If our servers are too busy to accept new requests within a reasonable timeframe, please try again later.
  • You've been extra busy! We do have some limitations on how many images you can generate within specific timeframes to help ensure that our service remains available for all users. If you have generated a lot of images within a 24 hour period, please try again tomorrow.

  • Your prompt was blocked Our AI may not permit certain prompts based on their content, possibly including NSFW prompts and prompts that violate our terms of use. If you think this is the case, please try a different prompt.